Getting stable voltage from dodgy battery - Page 1
Forum section: electronics / beginners

author: sean87
author_rank: Regular Contributor
timestamp: December 11, 2012, 08:24:46 pm
content: I am doing some progress on my roomba project. Roomba has a20 voltbattery that is a bit dodgy. When it motors turns on/off there is slight voltage drop.I want to power a pic microcontroller using this battery so I need or atleast I want a stable voltage source for it. I came accross this idea:Now my question is, does the 1N4007 and 470uA/25V cap do any good toward what I am trying to do? If not, should I remove them? Should I replace with another components?If I am totaly wrong, can you please tell me how can I get a stable voltage? What I mean is justfor learning porpusesI want to filter the voltage before the LM7805...I know that LM7805 will take care of voltage drop to some degrees.

author: PA0PBZ
author_rank: Super Contributor
timestamp: December 11, 2012, 08:50:08 pm
content: Why do you think a diode would do anything to stabilize the voltage?What voltage drop are we talking about when the motor turns on?

author: sean87
author_rank: Regular Contributor
timestamp: December 11, 2012, 08:58:08 pm
content: I though to put the diode there to prevent damage to the battery if something went wrong in my microcontroller board. just in case! Does it hurt? or I can safely remove it?Voltage drop is 3 to 4 volts and happens a lot because the motors turn on/of when roomba moves left right or changes direction or while it turns on its cleaning motors.

author: Mechatrommer
author_rank: Super Contributor
timestamp: December 11, 2012, 09:10:35 pm
content: Quote from: sean87 on December 11, 2012, 08:58:08 pmyour 1n4007 will prevent damage to the 7805 in case you connect the battery polarity wrong, leave it there you circuit looks ok to me. its unlikely the mcu board will damage your 20V battery

author: mariush
author_rank: Super Contributor
timestamp: December 11, 2012, 09:26:11 pm
content: The diode would just protect the circuit in case you connect the battery the other way around.Without it, if you connect the battery the other way around, you'd pop the capacitor due to reverse polarity.The diode has a voltage drop of about 0.6-0.8v , so your battery becomes a 19.4v batteryAn 100-220uF 25-35v should be enough in front of the linear regulator, and I would add a 100-220uF 10-16v capacitor after the regulator, dropping the 0.1uF ... you'd have one 0.1uF capacitor by the microcontroller.The 7805 needs about 2.5-3v above the 5v to function properly and output 5v, so the battery in the worst case would have to give 8v . As you say there's a drop in voltage of about 3-4v, the battery would then have to be at least 12 volts.If the battery goes that low during regular use, you may consider going for a better low voltage drop regulator, there are some that only need about 0.5v above 5v to work right. For example LM2931 springs to mind, it's just as simple to use as that 7805

author: sean87
author_rank: Regular Contributor
timestamp: December 11, 2012, 09:51:17 pm
content: Quote from: mariush on December 11, 2012, 09:26:11 pmThanks for reply.So you mean 470uF is big? And by "Front of the linear regulator" I assume you mean between output and ground of regulator?

author: mariush
author_rank: Super Contributor
timestamp: December 11, 2012, 10:03:05 pm
content: I meant front as in how it's drawn on the picture ... front is left side, everything before the input pin... after is the the right side , everything connected at the output pin of the chip and so on.470uF is a bit much, especially if the microcontroller only uses a few mA to operate. It's not bad to use it, just kind of pointless, too much for your needs.

author: MartinX
author_rank: Regular Contributor
timestamp: December 11, 2012, 10:44:24 pm
content: And the diode will also prevent the motor current that causes the voltage drop to discharge the 470µF capacitor, keeping the voltage to the 7805 more stable, increasing the capacitance will only improve the ability of the 5V supply to sustain its voltage in the presence of dips in the battery voltage. I am not sure how the diode will prevent damage to the battery if something went wrong in the microcontroller board. Put a fuse in there or a polyfuse, batteries can deliver a lot of current that can set fire to things.

author: IanB
author_rank: Super Contributor
timestamp: December 12, 2012, 01:04:32 am
content: Quote from: mariush on December 11, 2012, 09:26:11 pmThe data sheet does not say to do this. It is not helpful and may even be harmful. Put 0.1 uF on the output of the regulator as advised. Generally speaking, big capacitors go on the input side of regulators, not the output side.

author: ivan747
author_rank: Super Contributor
timestamp: December 12, 2012, 01:38:37 am
content: I don't think there's a need for a fuse. The 7805 has over-current protection on its output. He just has to be careful not to short the + and - before the regulator (left side).

author: mariush
author_rank: Super Contributor
timestamp: December 12, 2012, 03:58:31 am
content: Quote from: IanB on December 12, 2012, 01:04:32 amIf we're going strictly by the datasheet, the 7805 does not require ANY capacitors on the output side. Most datasheets only say that if the device powered by the 7805 is a few cm away from it, then you should use a 0.1uF capacitor or something close to that value.However, other linear regulators do require a capacitor on the output side, usually 1uF or 10uF being the recommended values (or a capacitor having esr below 1 ohm), and since having one doesn't really hurt that much, I found it a good habit to use one.For example, just browsing through some digikey low voltage drop regulators page ...lm317 recommends 1uF for improved transient response (http://www.ti.com/lit/ds/symlink/lm317l.pdf),LP295x requires 1uF or better for stability (http://www.ti.com/lit/ds/symlink/lp2950-n.pdf),LM2941 requires a capacitor " with a minimum capacitance value of 22 ?F, and ESR in the range of 0.01? to 5?, is required at the output pin for loop stability. It must be located less than 1 cm from the device. There is no limitation on any additional capacitance. " (http://www.ti.com/lit/ds/symlink/lm2941.pdf)lm138/lm338 : " A 1 ?F solid tantalum (or 25 ?F aluminum electrolytic) on the output swamps this effect and insures stability " (http://www.ti.com/lit/ds/symlink/lm138.pdf)lt1121 : " designed to be stable with a wide range of output capacitors. The minimum recommended value 1µF with an ESR of 3? or less." (http://cds.linear.com/docs/Datasheet/1121fg.pdf)enough... and like I said, this is just random regulators from the first two pages of digikey's low drop regulators section.I'm using (and therefore said) 100-220uF because in general, good capacitors of that value and 10-16v rating, have esr below 1ohm but still big enough not to cause instability or other problems (for example LM2941/MIC2941 can be unstable if the capacitor has <0.2 ohm esr and you pull less than 1-200 mA of current)