
Universal power supply for MCUs (Arduino, etc.)
Main project requirements and background
-
The device must provide rechargeable battery power for Arduino boards and sensors using Li-ion or Li-pol batteries.
-
Li-ion batteries come in different formats: 18650 cells, mobile-phone batteries with different shapes and power-connector layouts, and batteries of various shapes and thicknesses with attached power wires. The goal is therefore to build a universal device capable of charging all the batteries I have and powering 5V electronics from them.
-
The battery must be rechargeable either via micro-USB or from a 5V solar panel.
-
The battery voltage must be monitored to determine its charge level.
-
The finished device must be housed in a sealed enclosure suitable for outdoor use and capable of withstanding at least light rain.
-
The enclosure must also provide space for a half-size breadboard, an Arduino board, related electronic components, and sensors.
-
The device must be easy to remove from the enclosure for future modifications.
Photos of the finished device and the assembly process





Device diagram


Components used in the project
All components used in the project, except for the case, PCBs, wires, and male pin-header bumpers, are shown in the diagrams and labeled for easy comparison with the description below. Each component designation is shown in brackets (in red).
Case.
Since I do not have a 3D printer, I could not make a custom enclosure for this project. Instead, I bought a suitably sized translucent plastic food-storage box with a tightly locking lid from a home-goods store. The translucent case makes the LEDs visible from outside.
Price 2 USD.
Solar panel ( D1 ).
I had several solar panels of different sizes and power ratings. I chose a small 110x60mm, 5V, 1W panel. The rated maximum is almost impossible to achieve in practice: on a bright sunny spring day, I measured about 150mA. The panel also fit well on the enclosure lid.
The price of this solar panel is 2 USD.
Schottky diode ( D2 )
To prevent reverse current from flowing into the solar panel, a diode should be used. A Schottky diode is particularly suitable because, in this low-voltage circuit, it has a significantly lower forward-voltage drop, typically about 0.3-0.5V, than a conventional diode such as the 1N4007, where the drop is about 0.8-1V. I only had a high-current 1N5825 (40V, 5A), but a simpler 1N5817 (20V, 1A) would also be suitable for this project and has an even lower voltage drop, which is especially useful with a low-voltage solar panel.
Price of 1N5817: 4.5 USD for 50 pieces
Battery Charge Module (BMS) ( M1 ).
I used a TP4056 module with an onboard micro-USB connector. It can charge at up to 1A with a battery voltage of about 4.1-4.2V and includes protection against overcharging and over-discharging the connected Li-ion battery. The module also provides terminals for an alternative input power source, which in this project is the solar panel.
Because I did not plan to use more than one battery, higher charging power or voltage was unnecessary, although charging and voltage-converter modules for higher voltages are also available.
TP4056 module price: 2 USD for 5 pieces
5V step-up / boost module ( M2 ).
This module is required because the battery-charging module outputs the voltage of the connected battery, approximately 3.7-4.2V, while Arduino and other electronics in this project require a stable 5V supply.
I chose a compact and efficient Wavgat step-up module capable of supplying about 1-1.5A.
Price of the used boost module: 1.1 USD
Power connectors ( J1-J3, JP1, JP2 ).
The project uses three 2-pin PCB connectors.
-
- (J1) for connecting batteries with wires or an 18650 battery installed in a battery holder.
-
- (J2) for connecting the solar panel. I chose a connector instead of soldering it directly so the device can be disassembled easily.
-
- (J3) for supplying the 5V output from the boost module to the breadboard.
To connect mobile-phone batteries, I needed the same type of connector used in mobile phones (JP1, JP2). For clarity, the single 4-pin connector is shown as two separate connectors in the diagram. I had three different batteries: one with 3 contacts and two with 4 contacts, and the positions of the positive and negative contacts were also different. I removed a 4-pin connector from an old donor phone, and it could be used with all of these batteries. Similar connectors can also be purchased on AliExpress. The different positions of the power and ground contacts are handled by the switches described below.
PCB connector price: 1 USD for 20pcs
18650 battery case price: 1 USD for 1 piece
Switches ( S1-S4 ).
The project uses 4 3-pin switches for PCB mounting.
Two of them are used to select the battery contacts from the mobile phone: one ( S1 ) for the first pair of contacts (GND), the other ( S2 ) for the second pair (VCC).
The third switch ( S3 ) is used to connect an alternative power supply to the charging module (solar panel)
The fourth switch (S4) turns the 5V boost module on and off. It saves energy by allowing the boost module to remain off when it is not needed, for example, while charging the battery or storing the device.
Switch price: 1 USD for 20 pieces
Voltmeter ( M3 ) and button ( S5 )
Voltmeters of this type are available in two-wire and three-wire versions. A two-wire voltmeter uses the same circuit both for its own power and for voltage measurement; this is the version shown in the diagram. A three-wire module has a separate power input and measurement connection, allowing it to measure voltages outside the module's own supply-voltage range.
The voltmeter has a three-digit display and is available in four colors.
The button (S5) was added to reduce the energy consumed by the voltmeter (M3), allowing it to be switched on only when needed.
Voltmeter price: 2 USD per piece
Button price: 2 USD for 30 pieces
Printed circuit board.
The project uses three PCBs: two 50x70mm boards as vertical side walls and one 70x90mm board as the "floor".
All elements of the device were soldered on "PCB walls".
It is convenient to connect the PCBs to each other using 0.5mm solid-core wire.
5x7 PCB price: 2.5USD for 10pcs
7x9 PCB price: 1.6USD for 5pcs
Breadboard
A half-size breadboard provides space for additional electronic components such as an Arduino board and various sensors. Power and ground are connected to the breadboard rails through wires attached to connector J3.
Half-size breadboard price: 1.5 USD per piece
Bumper connectors
I installed four double male pin headers on one of the side PCBs as bumpers to reduce movement of the device inside the enclosure. This is completely optional.
Bumper connector price: 2 USD for 30 pieces of 40-pin headers
Total component cost
The total cost of the project components, excluding tools and consumables such as flux, solder, and wires, was 13 USD. Excluding the breadboard, the total was 11.5 USD.
You can find all the components mentioned above, together with their links, in this Google document​​
Tools

To work on the project, I used the following tools (see photo above):
-
Heat-resistant elastic mat
-
Vise for PCB repair
-
Multimeter
-
Glue gun (for reinforcing the JP1-JP2 mobile battery connector and securing the solar panel to the case)
-
Wires. The project uses two types of wires: 0.5mm solid-core wire for all connections and for joining the PCBs, and 22 AWG stranded wire for flexible connections to the solar panel and the breadboard.
-
Heat-shrink tubing for insulating wire connections
-
Gas torch (I use it instead of a bulky hot air gun, very convenient)
-
Flux pen
-
Solder wire
-
Soldering iron
-
Soldering iron tip cleaning sponge
-
Soldering iron tip stand
-
Wire cutters
-
Pliers
-
Screwdriver
-
The copper clip for securing the wire while soldering was incredibly handy.
-
Third hand (not shown in the photo). You can do without it, but it is more convenient to use it.