Difference between revisions of "RPi 5V PSU construction"

From eLinux.org
Jump to: navigation, search
(A 5V power supply for the Raspberry Pi - Construction How To)
m (Add wikilink to power supply hardware comparison page)
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Back to the [[R-Pi Hub|Hub]].
+
[[Category: RaspberryPi]]
[[Category:RaspberryPi]]
+
{{Template:RPi_Hardware}}
 
 
== Mobile battery power supply options ==
 
 
 
A Battery Elminator Circuit (BEC) should be able provide a solid 5V output at upto 3A which will be plenty to handle the load on a normal RPi
 
 
 
Something like http://www.hobbyking.com/hobbyking/store/__15212__HobbyKing_Micro_UBEC_3A_5v.html
 
Connect this BEC to a 3S LiPo 5000mAh batter and you should get 15 hours of run time off one full charge.
 
You could also connect it directly to a 12v car battery for even longer run time.
 
 
 
  
 
== A 5V power supply for the Raspberry Pi - Construction How To ==
 
== A 5V power supply for the Raspberry Pi - Construction How To ==
Line 17: Line 8:
  
  
I have had problems with a cheap 5V/1A adapter from Ebay too (freezing, no LAN, etc.) ... The adapter could not provide enough power. It had 5.0xV unloaded, but with RaspberryPi connected I've measured 4.78V and less - dropping to 4.5V on TP1 and TP2, and that's not good. The voltage drop might be partially caused by the cable, but I've used a branded Nokia cable that looks pretty solid. Anyway, we have to compensate for that too. Also there is some voltage drop on the polyfuse F3, hence don't expect to get >=5.0V on TP1-TP2...<br />
+
I have had problems with a cheap 5V/1A adapter from Ebay too (freezing, no LAN, etc.) ... The adapter could not provide enough power. It had 5.0xV unloaded, but with RaspberryPi connected I've measured 4.78V and less - dropping to 4.5V on TP1 and TP2 <ref>http://elinux.org/R-Pi_Troubleshooting#Troubleshooting_power_problems</ref>, and that's not good. The voltage drop might be partially caused by the cable, but I've used a branded Nokia cable that looks pretty solid. Anyway, we have to compensate for that too. Also there is some voltage drop on the polyfuse F3 (typically 0.1-0.2V, fuse should have about 0.2 Ohms <ref>http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=19033</ref>), hence don't expect to get >=5.0V on TP1-TP2...<br />
 
<gallery>
 
<gallery>
 
File:ebay_cheap_5V_adaptor1.jpg|Cheap PSU
 
File:ebay_cheap_5V_adaptor1.jpg|Cheap PSU
Line 23: Line 14:
 
</gallery>
 
</gallery>
  
So instead of looking for another PSU (or cell phone charger), I decided to make my own PSU with the popular 7805 - 5V/1A regulator.
+
So instead of looking for another PSU (or cell phone charger), I decided to make my own PSU with the popular 7805 - 5V/1A regulator <ref>http://www.learningaboutelectronics.com/Articles/What-is-a-LM7805-voltage-regulator</ref> <ref>http://www.circuitstune.com/2012/09/7805-voltage-regulator-circuit-7805-pinout.html</ref>. ''(There is also a 2A version available - 78'''S'''05)''
  
  
Line 30: Line 21:
 
[[File:PSU_7805_v01.jpg|none]]
 
[[File:PSU_7805_v01.jpg|none]]
  
The resistors R1 and R2 serve as adjustment of the output voltage. The formula is:  ''V out = V fixed + { R2 [ (V fixed/R1) + I standby] }'', where ''V fixed=5V'' and ''I standby=2.5mA'' (for 7805). I calculated for resistors that I had at home, but for best results R1 should be about 470ohm to 1k. Remember that resistors have some tolerance, so results may vary slightly, always measure. Value of C3 is not critical, I recommend 100-470uF. Same for C4, where for every 1A drawn, use 1000uF of capacity (and add some reserve). Don't forget to put C1 and C2 as close as possible to the regulator. And a heatsink for the regulator is necessary too.
+
The resistors R1 and R2 serve as adjustment of the output voltage (~ 5.25V). The formula is:  ''V out = V fixed + { R2 [ (V fixed/R1) + I standby] }'', where ''V fixed=5V'' and ''I standby=2.5mA'' (for 7805). I calculated for resistors that I had at home, but for best results R1 should be about 470ohm to 1k. Remember that resistors have some tolerance, so results may vary slightly, always measure. Value of C3 is not critical, I recommend 100-470uF. Same for C4, where for every 1A drawn, use 1000uF of capacity (and add some reserve). Don't forget to put C1 and C2 as close as possible to the regulator. And a heatsink for the regulator is necessary too.
  
 
''I've used an old 9.5V/1500mA power supply from an printer as the source for this regulator, so no transformer and rectifier etc. was needed in my case. And it works just fine :)''
 
''I've used an old 9.5V/1500mA power supply from an printer as the source for this regulator, so no transformer and rectifier etc. was needed in my case. And it works just fine :)''
Line 40: Line 31:
 
[[File:PSU_7805_v02.jpg|none]]
 
[[File:PSU_7805_v02.jpg|none]]
  
Starting from left, we have a transformer (protected by a fuse - F1) supplying about 7-12V AC at 2A (use what you have at home or what is cheaper to buy). Next is a rectifier (or 4 diodes / >1A) with caps (C7-C10, for filtering). Now we should have approx. <AC voltage> x 1.41 - so if we have a 9V transformer, it will be about 12.69V. The 7805 needs at least 2V (depending on type/manufacturer) more on the input than on the output (I prefer using a little more, >3V to be sure) for stable regulation, and it can be up to 35V (but a big difference between input and output voltage means "a lot work" for the regulator and a lot heating). In this case, 8-9V DC measured after the rectifier would be optimal. Main filtering is ensured by C4 (use at least 1000uF for each 1A drawn), another filtering after the regulator is C3 (100-470uF). C1-C6 serve the 7805 for stable function and HF filtering. R1 and R2 adjust the voltage to 5.25V, as described before. D1 and D2 are for protection. A transil is used for over-voltage (peaks) protection on the output, a 5V8 type should be fine (5.8V reverse standoff voltage and approx. 6.2V breakdown voltage) - use P6KE6.8A or BZW06-5V8. For operation signaling (device on) a LED coupled with R3 is used. You may use another fuse on the output - F2.
+
Starting from left, we have a transformer (protected by a fuse - F1) supplying about 7-12V AC at 2A (use what you have at home or what is cheaper to buy). Next is a rectifier (or 4 diodes / >1A) with caps (C7-C10, for filtering). Now we should have approx. <AC voltage> x 1.41 - so if we have a 9V transformer, it will be about 12.69V. The 7805 needs at least 2V<ref>http://en.wikipedia.org/wiki/78xx</ref> (depending on type/manufacturer) more on the input than on the output (I prefer using a little more, >=3V to be sure) for stable regulation, and it can be up to 35V (but a big difference between input and output voltage means "a lot work" for the regulator and a lot heating). In this case, 8-9V DC measured after the rectifier would be optimal. Main filtering is ensured by C4 (use at least 1000uF for each 1A drawn), another filtering after the regulator is C3 (100-470uF). C1-C6 serve the 7805 for stable function and HF filtering. R1 and R2 adjust the voltage to 5.25V, as described before. D1 and D2 are for protection. A transil is used for over-voltage (peaks) protection on the output, a 5V8 type should be fine (5.8V reverse standoff voltage and approx. 6.2V breakdown voltage) - use P6KE6.8A or BZW06-5V8. For operation signaling (device on) a LED coupled with R3 is used. You may use another fuse on the output - F2.
  
 
This is a rather fancy circuit, you may simplify it if you like - by leaving out C7-C10, C5, C6, D1, D2, LED and R3, F2 (and the transil, if you don't want any protection). Or leave just some of them. Your choice ;)
 
This is a rather fancy circuit, you may simplify it if you like - by leaving out C7-C10, C5, C6, D1, D2, LED and R3, F2 (and the transil, if you don't want any protection). Or leave just some of them. Your choice ;)
Line 58: Line 49:
 
[http://www.rason.org/Projects/regulator/regulator.htm The Adjustable Voltage Regulator],<br />
 
[http://www.rason.org/Projects/regulator/regulator.htm The Adjustable Voltage Regulator],<br />
 
[http://www.circuitstoday.com/variable-power-supply-using-7805 Variable power supply using 7805],<br />
 
[http://www.circuitstoday.com/variable-power-supply-using-7805 Variable power supply using 7805],<br />
 +
[http://www.electronicshub.org/understanding-7805-ic-voltage-regulator/ Understanding 7805 IC Voltage Regulator Circuit], <br/>
 
or [http://www.google.com/search?q=7805+regulator google more]
 
or [http://www.google.com/search?q=7805+regulator google more]
  
 
=== The testing prototype ===
 
=== The testing prototype ===
This is my testing prototype of this PSU, based on the first schematic. It's made of "what was found in the drawer". I've used an old 7805 regulator in TO3 package, C3 was taken from some broken mainboard, C4 is left out (it's not necessary, because the circuit is powered by a stable power supply from some old printer). The PSU provides stable 5.25V and i have 4.82V on TP1-TP2. My RaspberryPi works OK now :)<br />
+
This is my testing prototype of this PSU, based on the first schematic. It's made of "what was found in the drawer". I've used an old 7805 regulator in TO3 package <ref>http://en.wikipedia.org/wiki/TO-3</ref>, C3 was taken from some broken mainboard, C4 is left out (it's not necessary, because the circuit is powered by a stable power supply from some old printer). The PSU provides stable 5.25V and i have 4.82V on TP1-TP2. My RaspberryPi works OK now :)<br />
 
<gallery>
 
<gallery>
 
File:RPi_5V_PSU_proto1_Pinoccio.jpg|5V PSU prototype
 
File:RPi_5V_PSU_proto1_Pinoccio.jpg|5V PSU prototype
Line 68: Line 60:
 
File:RPi_5V_PSU_proto4_Pinoccio.jpg|5V PSU prototype
 
File:RPi_5V_PSU_proto4_Pinoccio.jpg|5V PSU prototype
 
</gallery>
 
</gallery>
I will make another PSU (for permanent operation) later - new 7805 in TO-220 package, appropriate heatsink, 1k resistor for R1 and a small pot for R2, new "fresh" caps and a transil, usb connector on PCB ... and I'll put it in some case.
+
I will make another PSU (for permanent operation) later - new 7805 in TO-220 package <ref>http://en.wikipedia.org/wiki/TO-220</ref>, appropriate heatsink, 1k resistor for R1 and a small pot for R2, new "fresh" caps and a transil, usb connector on PCB ... and I'll put it in some case.
  
  
 
~#Pinoccio
 
~#Pinoccio
  
----
+
 
Back to the [[R-Pi Hub|Hub]].
+
== Other PSU options ==
 +
 
 +
Simple switched PSU ''(with LM2576)'': [http://www.themagpi.com The MagPi - Issue 6] - page 8+9,<br />
 +
And more info on LM2576 <ref>http://www.ti.com/product/lm2576</ref> : [http://www.hobby-hour.com/electronics/lm2576-step-down-switching-regulator.php link], [http://wiringschematic.net/lm2576-switching-regulator/ link], [http://www.siongboon.com/projects/2005-08-07_lm2576_dc-dc_converter/ link]
 +
 
 +
You might want to try one of the easily available cheap LM2596 modules - [http://www.ebay.com/sch/i.html?_sacat=0&_from=R40&_nkw=lm2596+module search on ebay]
 +
 
 +
Similar to MagPi 6 switched mode power supply but for radioamateurs who usually have 12 V DC power already available [https://github.com/oh7bf/RaspiPwr12V RaspiPwr12V]. This is a DIY project with a printable mask to etch the PCB at home. The power supply is controlled from the Raspberry Pi with slow 10 - 20 kHz I2C bus. On the PSU board a small microcontroller PIC 12F675 takes care of communication with the RPi and switching the power on or off for the RPi.
 +
 
 +
Pi Power from Geppetto Electronics is a 6-15 volt switching supply (with a 2.1mm barrel connector input jack) that mounts on the GPIO header. [http://www.geppettoelectronics.com/2014/07/pi-power-schematic.html link] [https://www.tindie.com/products/nsayer/pi-power/ store]
 +
 
 +
== Mobile battery power supply options ==
 +
 
 +
A Battery Elminator Circuit (BEC) should be able provide a solid 5V output at upto 3A which will be plenty to handle the load on a normal RPi
 +
 
 +
Something like http://www.hobbyking.com/hobbyking/store/__15212__HobbyKing_Micro_UBEC_3A_5v.html
 +
Connect this BEC to a 3S LiPo 5000mAh batter and you should get 15 hours of run time off one full charge.
 +
You could also connect it directly to a 12v car battery for even longer run time.
 +
 
 +
[http://www.conrad.com/ce/en/product/207496/Modelcraft-BEC-Power-supply This one] is also proven to work.
 +
 
 +
 
 +
== Over-voltage protection ==
 +
Here is a nice upgrade for your PSU - a over-voltage protection circuit ''(see [http://blog.3b2.sk/igi/post/Tipy-a-triky-011-Prepatova-ochrana-Voltage-protect-Tips-tricks.aspx original post] in Slovak language)''. It can protect your device (RPi) from unwanted damage by high voltage from a faulty/malfunctioning PSU. In such case, it will short-circuit and burn its fuse immediately.
 +
 
 +
[[File:5v_overvoltage_protection.jpg|none]]
 +
 
 +
Steps:
 +
* choose appropriate fuse (according to expected load): 1-1.5A (fast type)
 +
* first don't put the fuse in its holder - you have to initially adjust the circuit, so use a piece of wire (or you can use a lower-current fuse too if you don't mind spending/burning it during the adjustment process)
 +
* set the 2k2 pot (trimmer) to its max. value
 +
* connect protection circuit to a power supply (if available a stabilized lab-PSU is preferred), set to 5.25V output (max. for USB; or exact 5V if you want) and 1-1.5A current limit
 +
* now slowly turn the 2k2 pot until the PSU's current-limiter goes on (or the fuse burns - if you chose that option)
 +
* well done, disconnect, now replace wire with your fuse and you're good to go
 +
 
 +
== See Also ==
 +
* [[Comparison of power supply & management hardware]]
 +
 
 +
== References ==
 +
<references/>
 +
 
 +
 
 +
{{Template:Raspberry Pi}}

Latest revision as of 00:20, 8 January 2016


RaspPi.png Back to the Hub


Hardware & Peripherals:

Hardware - detailed information about the Raspberry Pi boards.

Hardware History - guide to the Raspberry Pi models.

Low-level Peripherals - using the GPIO and other connectors.

Expansion Boards - GPIO plug-in boards providing additional functionality.

Screens - attaching a screen to the Raspberry Pi.

Cases - lots of nice cases to protect the Raspberry Pi.

Other Peripherals - all sorts of peripherals used with the Raspberry Pi.

A 5V power supply for the Raspberry Pi - Construction How To

Due to various problems with the power supply for the RaspberryPi, a home made PSU might be a solution for some of you. You will need some experience with construction of electronic circuits, appropriate tools and a multimeter.


I have had problems with a cheap 5V/1A adapter from Ebay too (freezing, no LAN, etc.) ... The adapter could not provide enough power. It had 5.0xV unloaded, but with RaspberryPi connected I've measured 4.78V and less - dropping to 4.5V on TP1 and TP2 [1], and that's not good. The voltage drop might be partially caused by the cable, but I've used a branded Nokia cable that looks pretty solid. Anyway, we have to compensate for that too. Also there is some voltage drop on the polyfuse F3 (typically 0.1-0.2V, fuse should have about 0.2 Ohms [2]), hence don't expect to get >=5.0V on TP1-TP2...

So instead of looking for another PSU (or cell phone charger), I decided to make my own PSU with the popular 7805 - 5V/1A regulator [3] [4]. (There is also a 2A version available - 78S05)


The basic idea is shown on this schematic:

PSU 7805 v01.jpg

The resistors R1 and R2 serve as adjustment of the output voltage (~ 5.25V). The formula is: V out = V fixed + { R2 [ (V fixed/R1) + I standby] }, where V fixed=5V and I standby=2.5mA (for 7805). I calculated for resistors that I had at home, but for best results R1 should be about 470ohm to 1k. Remember that resistors have some tolerance, so results may vary slightly, always measure. Value of C3 is not critical, I recommend 100-470uF. Same for C4, where for every 1A drawn, use 1000uF of capacity (and add some reserve). Don't forget to put C1 and C2 as close as possible to the regulator. And a heatsink for the regulator is necessary too.

I've used an old 9.5V/1500mA power supply from an printer as the source for this regulator, so no transformer and rectifier etc. was needed in my case. And it works just fine :)


Here is a schematic of a complete PSU including all components:
(a suggestion, with better filtering and protection)

PSU 7805 v02.jpg

Starting from left, we have a transformer (protected by a fuse - F1) supplying about 7-12V AC at 2A (use what you have at home or what is cheaper to buy). Next is a rectifier (or 4 diodes / >1A) with caps (C7-C10, for filtering). Now we should have approx. <AC voltage> x 1.41 - so if we have a 9V transformer, it will be about 12.69V. The 7805 needs at least 2V[5] (depending on type/manufacturer) more on the input than on the output (I prefer using a little more, >=3V to be sure) for stable regulation, and it can be up to 35V (but a big difference between input and output voltage means "a lot work" for the regulator and a lot heating). In this case, 8-9V DC measured after the rectifier would be optimal. Main filtering is ensured by C4 (use at least 1000uF for each 1A drawn), another filtering after the regulator is C3 (100-470uF). C1-C6 serve the 7805 for stable function and HF filtering. R1 and R2 adjust the voltage to 5.25V, as described before. D1 and D2 are for protection. A transil is used for over-voltage (peaks) protection on the output, a 5V8 type should be fine (5.8V reverse standoff voltage and approx. 6.2V breakdown voltage) - use P6KE6.8A or BZW06-5V8. For operation signaling (device on) a LED coupled with R3 is used. You may use another fuse on the output - F2.

This is a rather fancy circuit, you may simplify it if you like - by leaving out C7-C10, C5, C6, D1, D2, LED and R3, F2 (and the transil, if you don't want any protection). Or leave just some of them. Your choice ;)


Also if you prefer to fine-tune the output voltage, you may replace R2 with a small pot (trimmer) as shown here:

PSU 7805 v03.jpg

With this values (R1=1k, R2=100) adjustment from 5V to approx. 5.75V is possible.


Resources on 7805

For more info about the 7805 regulator, google the datasheet and see the following resources.

Resource links:
The Adjustable Voltage Regulator,
Variable power supply using 7805,
Understanding 7805 IC Voltage Regulator Circuit,
or google more

The testing prototype

This is my testing prototype of this PSU, based on the first schematic. It's made of "what was found in the drawer". I've used an old 7805 regulator in TO3 package [6], C3 was taken from some broken mainboard, C4 is left out (it's not necessary, because the circuit is powered by a stable power supply from some old printer). The PSU provides stable 5.25V and i have 4.82V on TP1-TP2. My RaspberryPi works OK now :)

I will make another PSU (for permanent operation) later - new 7805 in TO-220 package [7], appropriate heatsink, 1k resistor for R1 and a small pot for R2, new "fresh" caps and a transil, usb connector on PCB ... and I'll put it in some case.


~#Pinoccio


Other PSU options

Simple switched PSU (with LM2576): The MagPi - Issue 6 - page 8+9,
And more info on LM2576 [8] : link, link, link

You might want to try one of the easily available cheap LM2596 modules - search on ebay

Similar to MagPi 6 switched mode power supply but for radioamateurs who usually have 12 V DC power already available RaspiPwr12V. This is a DIY project with a printable mask to etch the PCB at home. The power supply is controlled from the Raspberry Pi with slow 10 - 20 kHz I2C bus. On the PSU board a small microcontroller PIC 12F675 takes care of communication with the RPi and switching the power on or off for the RPi.

Pi Power from Geppetto Electronics is a 6-15 volt switching supply (with a 2.1mm barrel connector input jack) that mounts on the GPIO header. link store

Mobile battery power supply options

A Battery Elminator Circuit (BEC) should be able provide a solid 5V output at upto 3A which will be plenty to handle the load on a normal RPi

Something like http://www.hobbyking.com/hobbyking/store/__15212__HobbyKing_Micro_UBEC_3A_5v.html Connect this BEC to a 3S LiPo 5000mAh batter and you should get 15 hours of run time off one full charge. You could also connect it directly to a 12v car battery for even longer run time.

This one is also proven to work.


Over-voltage protection

Here is a nice upgrade for your PSU - a over-voltage protection circuit (see original post in Slovak language). It can protect your device (RPi) from unwanted damage by high voltage from a faulty/malfunctioning PSU. In such case, it will short-circuit and burn its fuse immediately.

5v overvoltage protection.jpg

Steps:

  • choose appropriate fuse (according to expected load): 1-1.5A (fast type)
  • first don't put the fuse in its holder - you have to initially adjust the circuit, so use a piece of wire (or you can use a lower-current fuse too if you don't mind spending/burning it during the adjustment process)
  • set the 2k2 pot (trimmer) to its max. value
  • connect protection circuit to a power supply (if available a stabilized lab-PSU is preferred), set to 5.25V output (max. for USB; or exact 5V if you want) and 1-1.5A current limit
  • now slowly turn the 2k2 pot until the PSU's current-limiter goes on (or the fuse burns - if you chose that option)
  • well done, disconnect, now replace wire with your fuse and you're good to go

See Also

References