Electronics > Beginners
Writing EEPROM, sudden battery loss, capacitor keep-alive calculation?
jnz:
Wait... I'm dumb.
Just because I know I have 2ms of run time... Doesn't mean I know when the 2ms started. If I'm buffering at the supply side, I don't know that they've already pulled the power and I'm in the middle or end of my 2ms before I start writing.
This 2ms buffer really needs to accompany monitoring on the supply side - where I don't start writing eeprom unless I'm over some minimum voltage. So if my nominal is 12V, I don't start unless I'm over 11.5v or so. If I'm at 7 and start, that LDO will drop at 6V and this was all for nothing.
So... This seems like an extra pain. Now I need some small voltage monitor or detector part/circuit just to see if I have 2ms by means of the capacitor to start with. First thought is a zener and voltage divider to my ADC, but I need a low power mode for the whole circuit to be under 1mA so I'm not sure the leakage and ADC speed will work out. I guess I know what I have to read next.
Any advice?
german77:
Well one solution is to use a transistor and make it to just turn on at 12v. And for example when the voltage reaches 11.5v it changes state and the micro will know when to save the data.
Here is a schematic, you may need to tweak the voltage divisor to make it work with your transistors. It may not be the best solution as is highly dependent on the transistor, but it's cheap.
jnz:
So fairly interesting update... (to me anyhow)
If I put a large cap on the supply side before the LDO, I need less capacity in uF but can’t really fit the desirable electrolytic becsause of size issues. Which leaves ceramic or tantelum or MLCC. Turns out there are a lot of MLCC parts that fit on paper but their rated uF is at their rated voltage, if you go over you burn the part, if you go under you get much less actual capacity. So a 47uF MLCC rated for worst case 50V might only get 20uF at 12V, and the mfgs make this data relatively hard to find. This is all in addition to the issue that just because the LDO hasn’t cut out, I don’t know I haven’t already been pulling power off my capacitor for the last 1.9mS - which is why I’d need a voltage detection circuit on the supply side from my last post.
So....
I discovered aluminum polymer electrolytics they have absurd uF ratings in the 200-400 range with less size, less cost - their downside is that they are very low voltage rated. About 6.3V seems common which is fine for me 5V LDO side. So yes, it’s less efficicient to buffer on the LDO side, but with 330uF I can get a lot more run time and I can use the micro’s brownout detection before writing to confirm the voltage hasn’t already started dropping.
I still need to look into it, but I thought it was an interesting idea and relatively new because the whole series of alum polymer caps I’m looking at are brand new.
mariush:
No, in general capacitors will have the same capacitance no matter the voltage, you don't get less capacitance at lower voltage. Ceramic capacitors have an important exception... their capacitance can DECREASE as the voltage gets close to their maximum rating, see https://pdfserv.maximintegrated.com/en/an/TUT5527.pdf (Temperature and Voltage Variation of Ceramic Capacitors, or Why Your 4.7μF Capacitor Becomes a 0.33μF Capacitor)
You could use a switching regulator instead of a LDO to increase the time... you'll find such regulators that can be up to 96-98% efficient, compared to LDOs which will always be as efficient the smallest the difference between input and output voltage is.
With 12v in , 5v out, you get at best 41% efficiency, get something like an AP65111 from Diodes Inc. and you get up to around 95% efficiency: https://www.diodes.com/assets/Datasheets/AP65111A.pdf
See page 5, second chart from the left, you get ~ 90% efficiency at 0.1A output and up to ~95%. So at least twice as efficient as your LDO, reducing the need for big capacitance even further. I only suggest this particular regulator because it's cheap (<0.4$ on digikey if you buy 10 or more and it's relatively easy to solder, easy package to deal with, and can work with tiny smd inductor and resistors so very little footprint)
You could add a tiny shottky diode in front and from there use a zener or resistor divider to detect when the voltage drops
12v ----> tap for detect input voltage ---> diode ---> bulk store capacitor --> switching regulator -> your circuit.
diode will prevent you from measuring the voltage on the bulk capacitor.. at very low currents like 0.1..0.5A you can find diodes that only drop only ~ 0.2v so you don't lose much. Use either a zener diode or a voltage divider to drop down input voltage to something reasonable like 3v or whatever. you can then use a digital input pin to know when input voltage is removed (though filter that a bit, in case you use for example a round barrel dc jack and power gets interrupted for something like 1 ms by twisting the jack in the socket or something like that)
GeorgeOfTheJungle:
E= V*I*t
5[V]*50e-3[A]*2e-3[s]= 0.5 mJ (after the LDO)
12[V]*50e-3[A]*2e-3[s]= 1.2 mJ (before the LDO)
E= CV²/2
22e-6[F]*12[V]*12[V]/2= 1.58 mJ
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version