1s power backup for mBed after main power if OFF

25 May 2012

Dear friends,

May I know if there is any way to keep the mBed ON for atleast 1s after the main power to mBed is OFF??

I am connecting main power to a digital pin of mBed. If power goes OFF, it will generate a interuupt so that I can save my work before mBed goes OFF. I tried connecting 0.3F 5V capacitor across GND and VIN of mBed but mBed goes OFF as soon as the main power goes OFF.

May I know if there is any hardware solution for this?

Connection details:

/media/uploads/enemra/pic.jpg

Used a diode between main power and capacitor so that capacitor does not gives voltage to main power when main power is switched off.

25 May 2012

I'm not any kind of electrical engineer - but here's what I would explore:

(This is all just naive guesswork - anyone who is qualified feel free to correct me)

I would have a 4.5v battery in parallel with your 5v supply, with a diode so that the 5v won't try to charge the battery (but the 4.5 can flow when the 5v drops out). You may need some capacitor and/or inductor to smooth the voltage drop when it happens.

You can also put a reed switch or relay on the battery which is controlled by an mbed digital output, so it can switch the battery off when your work is saved.

25 May 2012

Thanks for the suggestion but battery won't help out. The design is industrial level which will be sold to customers. So recharging the battery will be a problem. It should work out with capacitors and other components.

25 May 2012

e victor wrote:

Thanks for the suggestion but battery won't help out. The design is industrial level which will be sold to customers. So recharging the battery will be a problem. It should work out with capacitors and other components.

Lots of people sell batteries to customers :) Since you are rarely ever going to draw prwer from it, an appropriately chosen battery would last for years and years.

You can probably do what you want with an appropriately sized series inductor. That would delay your power-on for a second or so also.

25 May 2012

Batteries may not be a good idea when you need maintenance free solutions. Rechargeable batteries are a pain also: they are more expensive and breakdown after a few years. A SuperCap on 5V might work when you keep the discharge current low enough to last you for a second. I would suggest using a large capacitor on the 10V input and measuring a voltage drop there. When you loose the 10V supply and it drops to 9V you still have a large buffer before the mbed shuts down. The supplyvoltage to mbed may go down to 4.5V . You dont really need the lm117. I would use one of the well-known voltage monitors like the ttl7705 or something with a voltage divider between 10V and the 7705.

26 May 2012

In lieu of batteries.. your only choice is a supercapacitor. (supercap). The mBed is NOT a low power device - it uses a lot of mA. What you want to do isn't trivial, esp. as a product with liabilities and warranty issues.

26 May 2012

Wim Huiskamp wrote:

Batteries may not be a good idea when you need maintenance free solutions. Rechargeable batteries are a pain also: they are more expensive and breakdown after a few years. A SuperCap on 5V might work when you keep the discharge current low enough to last you for a second. I would suggest using a large capacitor on the 10V input and measuring a voltage drop there. When you loose the 10V supply and it drops to 9V you still have a large buffer before the mbed shuts down. The supplyvoltage to mbed may go down to 4.5V . You dont really need the lm117. I would use one of the well-known voltage monitors like the ttl7705 or something with a voltage divider between 10V and the 7705.

The capacitor what I am using is 0.3F 5V super capacitor. I am using LM1117 to powerup some other ICs and not especially for the interrupt. So do you think a greater capacitor like 10F across the input would do?

I calculated cap like this-

Q = I * t = 200mA * 1 = 0.2C

C = Q/V = 0.2/5 = 0.04F

Nearest available was 0.3F. Also 10F cap costs very high.

Super capacitor: http://in.element14.com/jsp/search/productdetail.jsp?SKU=1340832

26 May 2012

The supercap value depends on the required current as you know. That current has to be measured including all loads. The problem with your calculation is that you assume that all stored electrons can be used. In fact the voltage drops quickly when discharging and mbed stops when it has fallen from 5V to about 4V. Checkout one of the supercap calculators on the internet. For example http://www.circuits.dk/calculator_capacitor_discharge.htm

My point is that the interrupt derived from the lm117 output is too late. You have to move up the powersupply foodchain to the first possible location where you can detect a shutdown. This gives you the maximum available time to backup your data.

26 May 2012

Assuminng your 10 volt rail falls quickly, then all you need is a signal diode (1n4148) feeding a voltage divider 10K, 20K, to give approx 3.3 volts, on mbed pin, also with 10 to 100nf accros it to stop spikes,

A quick look at your circuit, and your 3 volt line to interrupt, will probably NOT drop befor the 5 v from the super cap.

Hope i made sense.

Ceri

26 May 2012

ceri clatworthy wrote:

A quick look at your circuit, and your 3 volt line to interrupt, will probably NOT drop befor the 5 v from the super cap.

<facepalm> - Yes, if your circuit really is as simple as the diagram above, you can't get the interrupt until the capacitor is already discharged, right?

EDIT: Ah, I see below the diagram you say you have a diode. As long as the diode is between the cap and the interrupt line.

30 Jul 2012

It seems to me that the gap between the capacitor voltage and the MBED minimum voltage may be too narrow. I see that 6.3v supercaps are available, that extra volt could greatly increase the usable discharge time. Right now if you have a diode from the 5v regulator to the capacitor you might be below the MBED minimum voltage even when the power is still on. I looked up 9v and 12v supercaps but the price was getting insane.

Also I wonder if the supercap's internal resistance is too high for the current you require, making the voltage collapse. I think anything over 4 ohms will stop it instantly. In that case you might get better results from a conventional electrolytic, 47000uf 16v is about £5 I think.

The capacitance is less but if you start from 10v a time of 1s should still be possible.