# Raspberry Pi Zero 12V Battery backup to 5V - do I need the resistor?

I found this diagram on the internet which seems to divide the voltage down to 5V and still be able to deliver 1A with the 7805 just like I want.

It will use a 12V lead acid battery and a 12V IN transformator. The 5V OUT is for the RPi and the 12V OUT is for a solenoid I'll be using in my project.

My question is, why do we need the 1k resistor in this? Also, does the 1N4007's make the battery charge from the 12V IN or what are their purpose?

• Welcome to EE.SE. – Sparky256 Jun 13 at 20:29
• I found this diagram on the internet Can you provide a link to that? (Please edit your question with the link) Right now this question is extremely vague and we have no context for this circuit. – KingDuken Jun 13 at 20:29
• This is an truly terrible proposal: even if it might work, with a linear regulator like a 7805 you're going to waste over half of the battery capacity as heat so it's not even worth studying the details to determine if it will work. Use a switching regulator for this. – Chris Stratton Jun 13 at 20:33
• Also, does the 1N4007's make.. Which one, D2 or D3? (From context probably D2, still, please use the component's reference designator . – Huisman Jun 13 at 20:33
• If you intend to charge a 12V lead-acid battery with this circuit, then the "12V_IN" needs to be at least 14V to actually do any charging. – Elliot Alderson Jun 14 at 1:31

The two diodes (D2 & D3) work to OR the voltages, the idea being your 12V_IN will be slightly higher than 12V_BATTERY, so current will flow from 12V_IN to power the device when its present... Minus a diode drop.

When 12V_IN is removed current will flow from 12V_BATTERY through D3

R1 is probably there to act as a current limiting resistor for charging the battery.

So this is basically a UPS for your PI.

The battery will charge to (12V_IN - Vfwd D2) Need to ensure 12V_IN is at the correct level to charge your battery and not destroy any connected circuitry.

• If 12V_IN would be charging 12V_BATTERY, it would limit the charging current. Maybe it's intended to be a trickle charger? – Huisman Jun 13 at 20:37
• How does a lead-acid battery get charged from 11.3V? I am skeptical of this explanation. – Elliot Alderson Jun 14 at 1:29
• If there is a delta V current will flow. The battery will get charged to 12V_IN minus the drop... it might not be 100% SOC charged but current will flow until there is no voltage difference. If the battery is big enough (capacity) you may never have enough energy to actually charge and only make heat. – BAO Jun 14 at 12:23

This diagram is incomplete as it is missing bypass capacitors. Typically they would be 100 nF to 10 uF. The 1K resistor limits charge current to just 12 mA max, much less if battery is close to full charge. This would be an unregulated 'trickle' charger.

The diodes are used for reverse polarity protection.

• Why does this 1K resistor draw 12 mA? This 1K resistor is not connected to ground... – Huisman Jun 13 at 20:41
• I think you should edit the first sentence now as well... – Huisman Jun 13 at 20:43