1 #+TITLE: Battery charger and dual power supply unit
2 #+AUTHOR: Svjatoslav Agejenko
5 * (document settings) :noexport:
6 ** use dark style for TWBS-HTML exporter
7 #+HTML_HEAD: <link href="https://bootswatch.com/3/darkly/bootstrap.min.css" rel="stylesheet">
8 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
9 #+HTML_HEAD: <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
10 #+HTML_HEAD: <style type="text/css">
11 #+HTML_HEAD: footer {background-color: #111 !important;}
12 #+HTML_HEAD: pre {background-color: #111; color: #ccc;}
16 + DISCLAIMER: I DO ELECTRONICS AND 3D DESIGN SOLELY AS A HOBBY. THERE
17 COULD BE ERRORS THAT CAN RESULT IN ALL KINDS OF DAMAGE. USE THESE
18 DESIGNS AT YOUR OWN RISK.
20 + This design is released under Creative Commons Zero (CC0) license.
24 - Homepage: https://svjatoslav.eu
25 - Email: [[mailto://svjatoslav@svjatoslav.eu][svjatoslav@svjatoslav.eu]]
30 - [[../../index.html][Other physical projects in this repository]]
31 - [[https://www.svjatoslav.eu/projects/][Other projects hosted at svjatoslav.eu]]
34 I needed dual voltage power supply for my lab that runs on mains
35 electricity (wall power) and slowly charges (use-changing) attached
36 12V Lead-Acid battery. Lead-acid battery in turn provides high current
37 when needed as well as power in portable situations or when mains
38 electricity is not available.
42 Power supply provides about 13 Volts and 5 Volts simultaneously.
44 *!!!WARNING!!!* [[../alternative%20USB%20layout/][Alternative and incompatible USB wiring/layout]] is
47 *Normal USB devices and cables should not be plugged in! It would
48 damage device/cable and likely power supply.*
50 I found USB-A connectors to be easily available, cheap, reliable and
51 functional, so I re-purposed connector for my own needs but I'm using
52 totally incompatible electrical wiring.
54 [[file:../alternative%20USB%20layout/schematic.png]]
56 As seen, it has dual voltage output. Additionally one wire is
57 dedicated to data transmission and can be used with [[https://en.wikipedia.org/wiki/1-Wire][1-Wire]] protocol
59 1-Wire data router/hub is really simple. Power supply simply passively
60 links all data wires together.
62 Power supply uses 3D printed body with lots of holes, for fanless
65 [[file:body%20and%20covers/body,%201.png]]
67 Various modules are realized on top of prototype PCBs that slide into
68 dedicated rails within the body.
70 [[file:body%20and%20covers/body,%202.png]]
74 [[file:make,%202.png]]
76 When cover is closed, it blocks PCB movement:
78 [[file:body%20and%20covers/cover.png]]
80 There is still some empty space inside, so why not add dummy cover on
81 top that can be replaced later with add-on functionality/expansion
84 [[file:body%20and%20covers/cover%20cover.png]]
87 + [[file:body%20and%20covers/body.stl][Body STL file]]
88 + [[file:body%20and%20covers/cover.stl][Big cover STL file]]
89 + [[file:body%20and%20covers/cover%20cover.stl][Small dummy cover on top, STL file]]
90 + [[file:body%20and%20covers/body%20and%20covers.FCStd][Body and covers FreeCAD project]]
92 * Transformer and AC to DC converter
94 This is where high voltage from mains electricity enters the system.
97 [[file:transformer%20and%20AC%20DC%20converter%20board/schematic.png]]
99 For safety I kept high voltage section as minimal as possible. That
100 is, wall plug runs straight into transformer. Also I used [[https://www.amazon.de/gp/product/B07VGQKM3G/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1][UV hardening
101 glue]] for extra safety and isolation on PCB.
103 Power on/off switch operates on already reduced voltage of about 30
104 volts. Power switch is located on [[id:c9a69490-f920-4a31-b32e-b101bfc3d01b][indicator panel]].
106 [[file:transformer%20and%20AC%20DC%20converter%20board/make,%201.png]]
108 DC current of about 30 volts is then routed to [[id:65d68227-4bf2-4c4f-b4d3-c390bc6a9c34][Main board]].
110 [[file:transformer%20and%20AC%20DC%20converter%20board/make,%202.png]]
112 [[https://www.amazon.de/gp/product/B07RLQH5TR/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1][Single sided prototype PCB is used]].
116 :ID: 65d68227-4bf2-4c4f-b4d3-c390bc6a9c34
119 This is logically main board because it appears to be central hub that
120 connects all components. It also houses 2 [[https://www.amazon.de/gp/product/B072MQYJ93/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1][adjustable DC-DC Step Down
121 voltage converters]].
123 [[file:main%20board/main%20board,%201.png]]
125 High-level schematic of entire device:
126 [[file:main%20board/schematic.png]]
128 As seen from schematic, ~30 volts DC from transformer board is routed
129 into first step-down converter that reduces it to about 15V. Reduced
130 voltage is then directed to [[id:afc22d23-9bc4-421c-9cac-e0ce34bd36bc][Current limiter circuit]]. Current limiter
131 loses about 2 volts. Now we have current and voltage limited power at
132 about 13 volts. This power is used to charge connected 12V Lead-Acid
133 battery. Also the same power is routed to [[id:e33940bd-652f-4ec0-b53b-1c03e16941c8][connector terminal]] to be
134 consumed by connected devices.
136 As seen from this schematic, device is not meant to provide high
137 current for long periods of time. Instead it gets comparatively
138 limited current to charge the battery and feed devices with low
139 current requirements. Occasional current spikes are backed up by
140 battery that stays in use-changing mode.
142 Also about 13V output voltage is approximate and depends on connected
143 battery charge level.
145 Second Step-Down converter reduces voltage even further to quite
146 precisely 5V DC. This resulting voltage is also routed to [[id:e33940bd-652f-4ec0-b53b-1c03e16941c8][connector
149 Both 13V and 5V lines are also routed to [[id:c9a69490-f920-4a31-b32e-b101bfc3d01b][indicator panel]] for
152 There is single on/off switch. In off position, it disconnects battery
153 and transformer from the system effectively powering everything down.
155 On schematic above, some wires are annotated with numbers from 1
156 to 13. This corresponds to output pins on the board.
158 [[file:main%20board/main%20board,%202.png]]
161 :ID: afc22d23-9bc4-421c-9cac-e0ce34bd36bc
165 [[file:current%20limiter/schematic.png]]
167 Simple LM317 based current limiter is used. I used 4.7 ohm
168 resistor. It provides about 265 milliamps of current. See [[http://www.reuk.co.uk/wordpress/electric-circuit/lm317-current-calculator/][calculator]].
170 [[file:current%20limiter/current%20limiter,%201.png]]
172 Thermal paste below and UV hardening glue on top is used to attach
173 LM317 to the heatsink. There is also jumper-like solution on top
174 right. This is handy to attach multimeter tap to verify/monitor
175 current during initial device calibration.
177 If attached battery is really empty, significant voltage drop can
178 occur in LM317. Heatsink is needed to dissipate that power.
180 [[file:current%20limiter/current%20limiter,%202.png]]
182 Note: resistor gets hot too.
186 :ID: c9a69490-f920-4a31-b32e-b101bfc3d01b
189 [[file:indicator%20panel/indicator%20panel,%201.png]]
191 Basically 2 digital DC voltmeters and main on/off switch.
193 [[file:indicator%20panel/indicator%20panel,%202.png]]
197 [[file:indicator%20panel/indicator%20panel.png]]
199 + [[file:indicator%20panel/indicator%20panel.stl][STL file]]
200 + [[file:indicator%20panel/indicator%20panel.FCStd][FreeCAD project]]
204 :ID: e33940bd-652f-4ec0-b53b-1c03e16941c8
208 [[file:connector%20terminal/schematic.png]]
210 As seen above, most of the USB connectors are used to deliver dual
211 power output and 1-wire data connectivity, except one on the bottom
212 right. This is used to attach 12V battery. Some capacitors are thrown
213 in as well to stabilize against smaller current spikes.
215 Electrically schematic is realized using smaller prototype PCBs.
217 [[file:connector%20terminal/make,%201.png]]
220 Those PCBs are wired to central small PCB that acts as a hub:
222 [[file:connector%20terminal/make,%202.png]]
224 PCBs are held together by being sandwiched between front panel:
226 [[file:connector%20terminal/front%20panel.png]]
228 and smaller back-end plate:
230 [[file:connector%20terminal/back%20panel.png]]
234 [[file:connector%20terminal/make,%203.png]]
238 + [[file:connector%20terminal/front%20panel.stl][front panel STL]]
239 + [[file:connector%20terminal/back%20panel.stl][back panel STL]]
240 + [[file:connector%20terminal/connector%20terminal.FCStd][FreeCAD project]]
244 Since device uses adjustable step-down modules, these need to be
245 calibrated to provide correct output voltage. It is important that
246 battery receives proper charging voltage otherwise either no charging
247 occurs or battery starts gassing out and gets destroyed.
249 See here for more details: https://www.powerstream.com/SLA.htm