Go Down

Topic: detect loss of power quick ques (Read 1 time) previous topic - next topic

winner10920

Would it work to detect a loss of my external 5v power supply to simply have a diode going to a large capacitor, then read before the diode to see if the supply is there? I have these nice 5.5v 1F cap that fits nicely under my board, how much time would I have to do anything?  I have like 450ma load which id like to display a goodbye messgae on a tft lcd and log the off onto an sd card, would I have enough time to do this? Or is this idea shot because of the .7v drop of the diode?

robtillaart

#1
Mar 04, 2012, 06:40 pm Last Edit: Mar 04, 2012, 10:54 pm by robtillaart Reason: 1
Some people add a battery backup and read its voltage with a voltage divider (2x1M) with analogRead() and if the power drops to a certain limit they shit gracefully down.
shut gracefully down.

-- update --  :smiley-red: :smiley-red: :smiley-red:
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

winner10920

This is for a car and I don't want to have an extra battery, its powered when the car is running and when I turn the car off I want to be able to register that
id just check before my 5v supply but I don't feel like getting a more expensive capacitor

dc42

If it's for a car then presumably you are starting with around 12v and then using a 5v regulator. It's better to put the diode (with a small series resistor to limit the charging current) and capacitor before the regulator, rather than a capacitor after the regulator. Using a low dropout regulator, the capacitor can discharge to around 5.5v before the regulator output falls below 5v. To detect loss of power, you can use a voltage divider to monitor either the 12v input or the voltage across the capacitor.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

retrolefty

Quote
and if the power drops to a certain limit they shit gracefully down.


So who gets to clean up the mess after the power down.  ;)

jwatte

I Farad means 1 Columb per volt, which means one Ampere-second per volt. Thus, you will get the 5->4 volt drop through 450 milliAmperes in 2 seconds -- should be plenty of time.
You can use a Schottky diode with about 0.35V drop, instead of the typical 1N4001 drop of 0.8V. The Arduino should still run fine on 4.7V.
Btw: how can you draw 450 mA through the Arduino? Do you use the 5V rail directly? Because there's not enough juice in the digital output pins to draw that much :-)

robtillaart

Quote
So who gets to clean up the mess after the power down. 

Oops, string typo  :smiley-red: modified message ;)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

winner10920

Yeah mostly the 5v rails I mean, bluetooth, wireless nrf24l01, sd card, tft lcd, rtc, 8 outputs doing around 10ma ea,
450 is a peak number, usually around 350-400
I might try that other diode, being a 5v cap is alot cheaper than 16v

dc42


Yeah mostly the 5v rails I mean, bluetooth, wireless nrf24l01, sd card, tft lcd, rtc, 8 outputs doing around 10ma ea,
450 is a peak number, usually around 350-400


You might consider whether you can reduce the current draw from +5v by driving some things that are switched by transistors from +12v instead.


I might try that other diode, being a 5v cap is alot cheaper than 16v


If you put the capacitor before the regulator, then although you need a capacitor with a higher voltage rating, it can be a much lower value, because the voltage across it can drop a lot more. For example, 0.1F on the +5v line at 400mA load will lose 0.4v in 0.1 second. A capacitor on the 12v input can afford to drop around 7V, so you only need a capacitor of about 6800uF to power the system for the same amount of time.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

winner10920

Unfortunately that 12v is quickly killed by just about everything else
That stuff is all 5v run, like the lcd backlight and bluetooth etc, the nrf24l01 is 3.3v but that's no matter
everything I control is 12v and the 10ma per pin is to saturate my transistors
would running it at 4.7 16Mhz affect reliability

jwatte

the 10ma per pin is to saturate my transistors


So the simplest thing to do is change to use MOSFET transistors!

DVDdoug

Quote
This is for a car and I don't want to have an extra battery, its powered when the car is running and when I turn the car off I want to be able to register that...
In a car, you always have 12V available, and there is usually a clock running, remote door locks need constant power available etc.

Most car stereos have an always-on 12V signal as well as ignition-switched power.   The always-on power runs the clock, keeps the memory powered-up so you don't loose your favorite stations, and maybe to retain a security code.

Quote
I have these nice 5.5v 1F cap that fits nicely under my board, how much time would I have to do anything?  I have like 450ma load
I don't know, but I think there's something  "fishy" about those small 1F capacitors.... They are designed to maintain RAM memory and I have a feeling that those things can't put-out 450mA.

winner10920

I know,  I mean ignition 12v, which is what my arduino is running on
as for mosfets im terrible at picking them out, any good suggestions for around 1A that doesn't create noticeable heat?

winner10920

Well I haven't even attached my shield to my mega, and with only a single atmega328 and msqeq7, and 2 leds with 1k resistors and that 1F cap gives me about 2 minutes before the brownout detector shuts down the 328, however it drops below 4v fairly quick, maybe 15 seconds
it takes about 15 seconds to fully charge the cap and after that I level off at around 33ma load,
at this rate I doubt ill have more than a second or two with my full load on, which hopefully if I shutdown the screen, stop bluetooth, stop wireless,  kill my outputs, stop the slave 328, ill have enough time to write what I want on the sd card without corruption

jwatte


as for mosfets im terrible at picking them out, any good suggestions for around 1A that doesn't create noticeable heat?


Parametric search on digikey.com is your friend!

Here's how I do it:
Keyword "mosfet"
Click "FETs - single"
Parametric select 60V and higher, current 2A and higher, Vgs 2.8V or lower, through-hole, and in stock.
Click sort by price - quantity 10.
The winner is NTD5867NL-1G at $5.60 for 10.
http://search.digikey.com/us/en/products/NTD5867NL-1G/NTD5867NL-1GOS-ND/2401422

0.05 Ohms at 4.5V, which is the control voltage out of an Arduino.
At one ampere, I-squared-R says 50 milliWatts, which you'll have a hard time even feeling with your fingers :-)
http://www.onsemi.com/pub_link/Collateral/NTD5867NL-D.PDF

Go Up