PDA

View Full Version : Powering BS2p with Super Cap



civster
08-04-2005, 01:29 AM
I'm currently looking for a solution regarding a way to save variable values to eeprom in an event of a power failure and I've though of powering the BS2p with a super cap and a diode to isolate the cap and the stamp with the rest of the circuit. The super cap will only power the stamp for a few seconds, just enough time for the stamp to detect the power failure and write to the eeprom.

I'm wondering if anyone had any experience with super caps and BASIC Stamp together and whether the above design would work.

Manuel
08-04-2005, 01:32 AM
I dont really know very much, but i think there is a way to write to an external eeprom through I2C communication. i think i saw it on a nuts and volts article. You should check them.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Best Regards

Manuel C. Reinhard

Manuel
08-04-2005, 01:34 AM
I think there was also a battery backup project in one of the forums, i think that could also help

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Best Regards

Manuel C. Reinhard

Jonathan
08-04-2005, 02:10 AM
Civster,

Your plan should work fine. I have done the same thing with excellent results. As long as the cap has enought juice to power your circuit for long enough for the Stamp to detect the power out and write to the EEPROM, it's a good system. All Electronics has some good prices on super caps.

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info (http://www.madlabs.info) - Home of the Hydrogen Fuel Cell Robot

Paul Baker
08-04-2005, 03:06 AM
Civster, have you thought how you will charge the supercap? You'll need to trickle charge it, otherwise it would likely cause a bown out condition (unless you do the charging before turning the BS on).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10

civster
08-04-2005, 11:48 AM
Jonathan said...

Your plan should work fine. I have done the same thing with excellent results. As long as the cap has enought juice to power your circuit for long enough for the Stamp to detect the power out and write to the EEPROM, it's a good system. All Electronics has some good prices on super caps.



I'm not so sure about having the super cap available for the whole circuit. I'm leaning towards just the BS2p module.

I did an experiment today by placing a diode and the largest capacitor (10 uF) I have between the regulated 5 volt supply and the Vdd pin of the BS2p and I noticed that the stamp would not startup. I have ~5 volts going into the Vdd pin of the stamp according to my DMM.


Paul Baker said...

Civster, have you thought how you will charge the supercap? You'll need to trickle charge it, otherwise it would likely cause a bown out condition (unless you do the charging before turning the BS on).



I've read somewhere that when a super cap is in your application, they could simulate a short for a brief moment until they are fully charged. I've never though of trickle charging them for I'm hoping my regulator can handle one super cap and I'm also trying to make my application as simple as possible.

Any advise on trickle charging a super cap are welcome.

Paul Baker
08-04-2005, 11:38 PM
I think maybe devising a circuit to hold the BS2p in a state of reset until the supercap has charged may be the easiest solution. The problem with adding large caps is that it takes a period of time to charge them, during this period it will cause a serious sagging of the voltage causing problems with the startup of your stamp. The problem with the reset solution is that the entire circuit is going to be sagged and therefore the logic to hold the stamp in reset will have to be able to operate properly in the situation. As far as trickle charging, by using diodes (perferably with as minimal of a Vf as possible), the supercap can only discharge through the BS2 (hence supplying it power when the power is cut) and can only be charged through a circuit whose output current to charge the supercap is limited to prevent the voltage sagging. I have not designed either type of circuit but Ill see about finding one or coming up with one. My ability to do this at work is limited, and my home internet connection is currently not working, but Ill try my best.

Actually now that I think about it, just buy a brown-out detector chip which will hold the stamp in reset, this will be the easiest and most "bullet-proof" solution.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10

Post Edited (Paul Baker) : 8/4/2005 4:41:58 PM GMT

Paul Baker
08-04-2005, 11:56 PM
Read this: http://www.emesystems.com/BS2power.htm#Brownout

The MAX703 is an example of a circuit which should be able to be used, instead of the lithium battery, you should be able to replace it with a diode and supercap, while it charges the MAX703 will hold the stamp in reset. and the /PFO should provide indication of a power fault to your stamp.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10

Amaral
08-05-2005, 12:50 AM
why do you need to charge your super cap instantly ? you can add a resistor on the circuit that is charging it , it will charge the cap slower but will not drain all your power for if , put it to charge slower !

just what came in mu mind !

Amaral.

civster
08-06-2005, 11:23 AM
Paul Baker said...

Read this: http://www.emesystems.com/BS2power.htm#Brownout

The MAX703 is an example of a circuit which should be able to be used, instead of the lithium battery, you should be able to replace it with a diode and supercap, while it charges the MAX703 will hold the stamp in reset. and the /PFO should provide indication of a power fault to your stamp.



Thanks for the info regarding the MAX703, it's datasheet (http://"http://pdfserv.maxim-ic.com/en/ds/MAX703-MAX704.pdf") has a diagram regarding using a super cap and a diode.

My other question is, like Amaral suggested, I don't want to charge the super cap instantaneously and I'm wondering if there is a formula to calculate the resistor value to charge a 0.1 Farad 5v super cap in 5 seconds. The 5v regulator that will be charging the super cap can source up to 1 amp.

Paul Baker
08-06-2005, 08:38 PM
When working with resitor+capacitor charging/discharging there is an associated time constant (1/RC), this time constant is the time it takes to charge/discharge the capacitor 63.2%. To calculate the voltage across the capacitor at a given time, use the equation Vc=Vdd(1-e-t/RC).·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10

civster
08-07-2005, 12:31 PM
Paul Baker said...

When working with resitor+capacitor charging/discharging there is an associated time constant (1/RC), this time constant is the time it takes to charge/discharge the capacitor 63.2%. To calculate the voltage across the capacitor at a given time, use the equation Vc=Vdd(1-e-t/RC).



Thanks for the RC time formula. I calculated that I need approximately an 8 ohm resistor to recharge a 0.1 farad super cap to ~5v in 5 seconds. I understand that the super cap will never equal the charging voltage for the time to charge it will be infinite.

I also made a decision on how the BS2p will recognize a power failure. I will have it poll an active high input pin that it hardwired to a 5 volt source just outside of the MAX703 circuit. When a power failure occurs, that pin will go low and since the BS2p is still powered, it will see that the pin has changed state and it will then perform a write to the eeprom.

Post Edited (civster) : 8/7/2005 5:34:31 AM GMT

Paul Baker
08-07-2005, 01:19 PM
Very good, now if you want to make sure your circuit doesn't brown out while the cap is charging, youll need to make sure your supply can source the peak charge current of the supercap. This occurs when the supercap is completely discharged or 0 Volts across the two terminals, for an 8 ohm resistor the peak current will be (Vdd-Vf)/8, where Vf is the voltage drop across the diode used to prevent the capacitor·from discharging through your dead main power source. If you find this number to exceed 1 amp, you should consider a regulator with larger current capabilities or increase the resistor value. Increasing the resistor value will of course lengthen the time to charge the capacitor, but as long as the likelyhood of the power being cut very shortly after power up is very small the larger resistor will have no effect on the circuit's operation.

I haven't investigated it completely, but you should consider using the /PFO pin on the MAX703 as your polled indication of a power fault.

If I remember correctly, in college we considered a cap to be completly charged when it is at 99.1% capacity.·I think the figure comes from the Vdd/Vc·(Vc is the voltage across the capacitor) at a certain number of times the time constant, but my memory is fuzzy, and it was a·rule of thumb so I don't think I would be able to verify this by looking through my bookcase of electronics books.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10

civster
08-07-2005, 02:20 PM
Paul Baker said...

Very good, now if you want to make sure your circuit doesn't brown out while the cap is charging, youll need to make sure your supply can source the peak charge current of the supercap. This occurs when the supercap is completely discharged or 0 Volts across the two terminals, for an 8 ohm resistor the peak current will be (Vdd-Vf)/8, where Vf is the voltage drop across the diode used to prevent the capacitor from discharging through your dead main power source. If you find this number to exceed 1 amp, you should consider a regulator with larger current capabilities or increase the resistor value. Increasing the resistor value will of course lengthen the time to charge the capacitor, but as long as the likelyhood of the power being cut very shortly after power up is very small the larger resistor will have no effect on the circuit's operation.



Even with a "perfect" diode with zero voltage drop, the peak charge current for the super cap with 8 ohm resistor will be 0.625 amp. The rest of my application will probably draw around 200 mA, so that is within the limits of my 5 volt regulator with some underrating.


Paul Baker said...

I haven't investigated it completely, but you should consider using the /PFO pin on the MAX703 as your polled indication of a power fault.



According to the MAX703 datasheet (http://"http://pdfserv.maxim-ic.com/en/ds/MAX703-MAX704.pdf") the PFO works with PFI. When ever PFI goes below 1.25 volts, PFO goes low. PFI's maximum voltage input is 1.30 volts and the typical connection for it is to the unregulated source via a voltage divider.

The PFO will not work for my application due to my unregulated source can vary from 24 to 30 volts. Also, a voltage divider will increase the parts count for my application.


Paul Baker said...

If I remember correctly, in college we considered a cap to be completly charged when it is at 99.1% capacity. I think the figure comes from the Vdd/Vc (Vc is the voltage across the capacitor) at a certain number of times the time constant, but my memory is fuzzy, and it was a rule of thumb so I don't think I would be able to verify this by looking through my bookcase of electronics books.



I believed it's after the fifth iteration of the time constant that a capacitor should be considered fully charged.

Paul Baker
08-07-2005, 11:54 PM
Cool, it seems you have a firm handle on all the major aspects of using a supercap as backup power. Let me know how it works out for you once you've implemented it.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10

Jonathan
08-08-2005, 12:50 AM
Wow, I never worried about brown out or anything. I have a 10 0hm resistor from the charge side to the cap to limit inrush current, and thats all. Aothough I freely admit I am no EE and a barbarian to boot. I also have some super caps on the hydrogen powerd robot on the servo circuit to smooth the load on the fuel cell. I'd have to check, but I don't think they have a inrush resistor, just a diode to prevent them from poweriing anything after shut down. I have never had any brownout issues. Guess I just got lucky...

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info (http://www.madlabs.info) - Home of the Hydrogen Fuel Cell Robot