Power loss detection - Page 1
Forum section: electronics / general

author: Jan Audio
author_rank: Frequent Contributor
timestamp: March 26, 2020, 04:35:59 pm
content: Hi, i have a PIC16F1789 with internal EEPROM, i would like to save parameters on power-down for my new project.The PIC16 runs at 32MHz, it has 256 bytes to save, with all perihpherals running.So i have these skottky diodes from ebay : 1N60PAnd i have these capacitors : 470UF @ 16v.Will it work ?I know i should not use chinese parts, i just have these diodes laying around and wanto use them.Maybe you suggest another diode type ?I am going for a 0,3v threshold to keep the chip close to 5v.Will this capacitor be enough of 470UF ?, i seen a schematic they use 1F.Is this 1N4007 a special diode for this ?, whats so special ?Do i have to worry about diode-peak-voltage on power on ?, maybe thats why the 1N4007 is so special ?I read a byte and compare it so i dont overwrite the same, and have a checksum.Maybe i need other parts ?thanks

author: ggchab
author_rank: Frequent Contributor
timestamp: March 26, 2020, 05:09:28 pm
content: I am not sure that having a so big capacitor after the regulator is a good idea. It's better to have it before and have the PD signal connected before it.I don't know where your 12V is coming from but in one of my projects, I use the attached circuit and it works very well. Plenty of time to save data in eeprom. Depending on the load of your circuit, you may have to adapt the value of the capacitors.(U$3 is the input for a small transformer)

author: Jan Audio
author_rank: Frequent Contributor
timestamp: March 26, 2020, 05:37:39 pm
content: ThanksSo your regulator only feeds the MCU.Question : Why do you have more of the same capacitors instead of a bigger one ?Nice one with the transistor, i could take it from the PSU (15v) input.I have 15v -> 12v regulator -> 5v regulator (PIC16s, opto, LCD) -> 3,3v regulator (DSPICs)I should take a seperate 5v regulator for the target PIC16 with EEPROM, then i dont need any diode.thanks again, i need to think about this.

author: ggchab
author_rank: Frequent Contributor
timestamp: March 26, 2020, 05:47:28 pm
content: I used several capacitors simply because I did not have enough space for bigger ones (too high)

author: techman-001
author_rank: Frequent Contributor
timestamp: March 26, 2020, 11:06:46 pm
content: Quote from: Jan Audio on March 26, 2020, 04:35:59 pmThere is absolutely nothing special about the 1N4007, it's a common 1 Amp diode rated for 700 volts.I recommend you just use a DSO to monitor the voltage into your MCU after you cut the electrical power to your device.If you don't have a scope, use the MCU ADC to do it as it writes the voltage to a terminal on your pc via a UART?When it stops writing values you also know when it crashed from under voltage etc.Never guess, always measure

author: ajb
author_rank: Super Contributor
timestamp: March 27, 2020, 04:15:45 am
content: For best results, isolate your MCU from as much of your other circuitry as possible, and on detecting a power loss, put any other circuitry you can into its lowest power state (turn off displays, LEDs, etc). Ideally, stop everything else the MCU is doing and just save what you need to save. This will reduce the amount of capacitance you need. Move your power loss detection to the input side of the regulator, that will give you more warning. It also means that any capacitance on that side of the regulator contributes more substantially to your time to save. By the time the MCU's rail starts to fall you are going to be very short on time. Checksum the data so that you can easily detect a failed save. If the parameters you're saving are configuration, consider saving two copies with a checksum on each so that if a save fails you can revert to the previous values.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: March 27, 2020, 02:01:08 pm
content: I need 2 diodes,1 for the check with small cap,1 for the power(400mA) with big cap, wich goes into the 12V regulator that powers the project.