Posts: 223
Joined: Fri May 31, 2013 11:29 am

DIY 12 V i2c controlled power supply

Sun Oct 27, 2013 8:56 am

If anybody is interested here is my power supply project


The basic circuit is similar to that published in MagPi October 2012. I added a PIC microcontroller to the circuit to help in powering down or powering up of the Raspberry Pi. The microcontroller has its own 3.0 V regulator so it is operational when the Raspberry Pi is powered down. The current consumption for the PIC with the power supply in off state is less than 1 mA.

The microcontroller allows reading of the battery voltage. At the Raspberry Pi a daemon called 'pipicpowerd' is reading the battery voltage every five minutes. The result is written to the log file /var/log/pipicpowerd.log. If the battery voltage is too low the PIC is programmed to power down after about 100 seconds. If the file '/var/lib/pipicpowerd/wakeup' exists it is read (for example "8:00") and is used to calculate the power supply wake up time. This value is then programmed to the PIC to wake up the system at later time. After the PIC has been programmed the 'shutdown -h now' command is executed at the Raspberry Pi.

The shut down and power down can also be initiated by long press on the red button. The red LED is turned on at the power supply. If the button is pressed again shut down and power down is initiated.

There is a PDF-file that can be printed with a laser printer (or copied with a copy machine) to produce a printed circuit board with the toner transfer method. The polyfuse on the schematics is not yet placed on the PCB.

User avatar
Posts: 29
Joined: Sun Jan 20, 2013 1:02 pm
Location: korea

Re: DIY 12 V i2c controlled power supply

Tue Oct 29, 2013 2:19 am

hi ~ , i'm raspberrypi korea user.

i have dc 12V 5A adapter.
I'm not used it that make PCB.
and i have used it.

this photo :

it's write post : http://www.rasplay.org/?p=6536

Posts: 223
Joined: Fri May 31, 2013 11:29 am

Re: DIY 12 V i2c controlled power supply

Tue Oct 29, 2013 7:09 pm

I have a similar cigarette lighter USB adapter for the 5 V. I have not tried to open it see what is inside. It might be possible to modify it to add a microcontroller inside to switch the power on/off.

The main motivation for this project is the battery usage. When the Raspberry Pi is in halt mode after 'shutdown -h now' a current of about 70 mA continues to flow from the 12 V battery. If the battery has a nominal capacity of 7 Ah for example, the battery will run empty in about 100 hours or in four days. With my DIY power supply it is possible to reduce this current to below 1 mA and the same battery will last about 7000 hours or 290 days without recharge. This kind of economy is important for example in solar powered applications.

The circuit can be constructed on a stripboard too. The material cost for the DIY printed circuit board is about EUR 2 - much less than the cheap prototypes offered by some PCB manufacturers. This does not take into account the initial investment to the tools like drilling machine. From time it takes one rainy Sunday or two evenings after work. There are some photos on this page


Return to “Other projects”