Post Top Ad

Thursday, February 1, 2024

on video Load Sharing || Use Solar Panel safely with TP4056


 Load Sharing || Use Solar Panel safely with TP4056

Hi! Today I will show you why you should not use a solar panel directly with TP4056 Li-Ion battery charger, and how you can use solar panel with TP4056 Li-Ion battery charger.


The problem - I wanted to use a float sensor to measure the level of water in my overhead tank. It has three wires coming out of it. It is basically a single pole double throw switch, which is controlled by the metal ball inside the sensor. The gravity pulls the metal ball up and down depending on the height on which the sensor is floating and its counterweight. So, I wanted to make a circuit with LED to show low water level, buzzer to show high water level, a salvaged Li-Ion cell for power along with a boost converter and TP4056 charger. Originally, I planned to charge the Li-Ion cell with a 6V solar panel, but quickly realized the problem with it. The LED/buzzer will continue to draw current if the connection is not broken which would mean the TP4056 will not realize that the battery is full and continue to feed power to it. This can lead to overcharging of Li-Ion cell and in a worst-case scenario the battery can blow up. To avoid this, we can add a switch to cut off the power when the battery is charging but that would require a manual intervention which in my case was not possible. The solution is to still add a switch, but in this case, it will be an automatic switch and will cut the power to the load whenever the charger is connected and as an awesome bonus, it will feed the load with its own power. Let's see how we can achieve that.

The solution, or rather the switching circuit is called load sharing and contains 3 components, a P-channel MOSFET, a Schottky diode and a pull-down resistor. Let’s understand its working. When charger is not connected, the gate of the MOSFET is pulled low, that means it is in conducting state and that means the load is connected to the output of TP4056 board. On the other hand, when the charger is turned on, the current chooses the lower resistance path to travel and hence the gate is pulled high, which means the MOSFET in not conducting anymore, disconnecting the load from TP4056. The diode is to make sure that current doesn’t flow from the battery to the charger when the MOSFET is conducting. Now that we understand the circuit, let’s move on to the next section.


Choosing the Parts

Choosing the parts is as critical as designing the circuit right. You want to make the circuit as efficient as possible and choose the parts that offer the lowest power losses, especially if the load in your circuit is going to draw higher current. In the load sharing circuit, we can optimize two components to keep the losses to a minimum: the P-Channel MOSFET and the diode. You should choose the P-Channel MOSFET that has the lowest ON resistance. Same goes for the diode, it should have a minimum forward voltage drop. You can easily find the components using mouser website. Just search for what you want, add your requirements in the filter and there you go. It is really handy. I chose IRF4905 which has 20 mOhms of ON resistance and 1N5819 which has forward voltage drop of 0.4 Volts.

I skipped prototyping and gathered the components to solder on a perfboard. I will use male headers to solder the TP4056 first. You can use a breadboard to hold the pins straight while soldering it. After individually soldering all the 6 headers to the board, I somehow managed to put it on the perfboard, as the pins were not aligning with holes on the perfboard. I had to bend some headers. After that, I soldered it in the perfboard. Again, to solder the boost converter I will make use of the male headers but the holes are a bit too big in the boost module. So, I will solder the headers first on the perfboard. The heads generally don’t fit easily in the perfboard, I use a hand drill to enlarge the holes a bit. After soldering the headers, I can now rest the boost converter on top of it and solder it to the headers. I will use male headers to connect everything that is not on the board, like the battery, LEDs and buzzer etc. I avoid using wires wherever possible. If the points are close enough, I use solder itself to make the connections. If it is far, I use leftover terminals from LEDs, diodes, or transistors to make connections. You can bend them at your will and they are very easy to solder. The VIN+ of buck module connects to OUT+ of TP4056, and I connected OUT- of TP4056 to VOUT- of buck converter as VIN- and VOUT- as shorted making the connection length a little. Now before making further connection, let’s first adjust the output of buck converter to 5 Volts. By the way DO NOT CONNECT wires to batteries like I did, it can be very dangerous. I disconnected one of the wires after the battery was not required anymore for safety. I finished the remaining circuit off-camera as it was a pretty normal soldering. I used jumpers when there was no place left in the bottom area. I also had to use one to connect the gate to 5V input. Doing a quick continuity test to make sure everything is connected correctly.


Time to see if the circuit works. We are getting battery voltage and 5 Volts at correct places, so that’s good. I used an LED with a current limiting resistor to check the output. It is glowing that means the MOSFET is conducting. After that I connected a charger. I am using a power bank to imitate the charger. As soon as you connect it, nothing special happens except this blue LED glowing up showing the battery is full. Now I am disconnecting the positive pin of the LED from output leaving its negative pin there. The positive will connect to the gate using an alligator clip to visualize the changes in gate voltage. I connected my battery again and the LED did not light up, meaning gate is pulled low as expected. When you connect a charger though, it lights up that means gate is pulled high and the MOSFET is not conducting. If I connect the LED back to output again, we can see it is glowing taking power from the power bank itself. That means our circuit is working fine.


I added some more female headers for the float sensor and the two loads it will control. Also, I soldered resistor for LED with the header itself so that the LED can be connected directly. I connected the pole of sensor to middle header and throws to either side and one LED. Let’s connect the power. The circuit is working perfectly fine with the sensor as well. I connected an LED to the other throw as well. The resistor for that is wrapped around its leg. Working just fine. Everything said, I plan not to use the solar panel for various reasons, and instead use a 5V adapter to charge it, which only turns on when the water pump turns on. This load sharing circuit would still be required.


Lastly, my plan is to use a buzzer instead of the green LED, but that can be a problem. When the tank is full, the sensor can stay in that position for a long time until the water level reduces, and I don’t want the buzzer to keep buzzing until someone takes a bath. To solve that I connected positive of that throw to 5V input, which only turns on when the water pump is on. That means buzzer will only make noise until the pump is on. Once it is turned off buzzer will also turn off.


 Load Sharing || Use Solar Panel safely with TP4056

Hi! Today I will show you why you should not use a solar panel directly with TP4056 Li-Ion battery charger, and how you can use solar panel with TP4056 Li-Ion battery charger.


The problem - I wanted to use a float sensor to measure the level of water in my overhead tank. It has three wires coming out of it. It is basically a single pole double throw switch, which is controlled by the metal ball inside the sensor. The gravity pulls the metal ball up and down depending on the height on which the sensor is floating and its counterweight. So, I wanted to make a circuit with LED to show low water level, buzzer to show high water level, a salvaged Li-Ion cell for power along with a boost converter and TP4056 charger. Originally, I planned to charge the Li-Ion cell with a 6V solar panel, but quickly realized the problem with it. The LED/buzzer will continue to draw current if the connection is not broken which would mean the TP4056 will not realize that the battery is full and continue to feed power to it. This can lead to overcharging of Li-Ion cell and in a worst-case scenario the battery can blow up. To avoid this, we can add a switch to cut off the power when the battery is charging but that would require a manual intervention which in my case was not possible. The solution is to still add a switch, but in this case, it will be an automatic switch and will cut the power to the load whenever the charger is connected and as an awesome bonus, it will feed the load with its own power. Let's see how we can achieve that.

The solution, or rather the switching circuit is called load sharing and contains 3 components, a P-channel MOSFET, a Schottky diode and a pull-down resistor. Let’s understand its working. When charger is not connected, the gate of the MOSFET is pulled low, that means it is in conducting state and that means the load is connected to the output of TP4056 board. On the other hand, when the charger is turned on, the current chooses the lower resistance path to travel and hence the gate is pulled high, which means the MOSFET in not conducting anymore, disconnecting the load from TP4056. The diode is to make sure that current doesn’t flow from the battery to the charger when the MOSFET is conducting. Now that we understand the circuit, let’s move on to the next section.


Choosing the Parts

Choosing the parts is as critical as designing the circuit right. You want to make the circuit as efficient as possible and choose the parts that offer the lowest power losses, especially if the load in your circuit is going to draw higher current. In the load sharing circuit, we can optimize two components to keep the losses to a minimum: the P-Channel MOSFET and the diode. You should choose the P-Channel MOSFET that has the lowest ON resistance. Same goes for the diode, it should have a minimum forward voltage drop. You can easily find the components using mouser website. Just search for what you want, add your requirements in the filter and there you go. It is really handy. I chose IRF4905 which has 20 mOhms of ON resistance and 1N5819 which has forward voltage drop of 0.4 Volts.

I skipped prototyping and gathered the components to solder on a perfboard. I will use male headers to solder the TP4056 first. You can use a breadboard to hold the pins straight while soldering it. After individually soldering all the 6 headers to the board, I somehow managed to put it on the perfboard, as the pins were not aligning with holes on the perfboard. I had to bend some headers. After that, I soldered it in the perfboard. Again, to solder the boost converter I will make use of the male headers but the holes are a bit too big in the boost module. So, I will solder the headers first on the perfboard. The heads generally don’t fit easily in the perfboard, I use a hand drill to enlarge the holes a bit. After soldering the headers, I can now rest the boost converter on top of it and solder it to the headers. I will use male headers to connect everything that is not on the board, like the battery, LEDs and buzzer etc. I avoid using wires wherever possible. If the points are close enough, I use solder itself to make the connections. If it is far, I use leftover terminals from LEDs, diodes, or transistors to make connections. You can bend them at your will and they are very easy to solder. The VIN+ of buck module connects to OUT+ of TP4056, and I connected OUT- of TP4056 to VOUT- of buck converter as VIN- and VOUT- as shorted making the connection length a little. Now before making further connection, let’s first adjust the output of buck converter to 5 Volts. By the way DO NOT CONNECT wires to batteries like I did, it can be very dangerous. I disconnected one of the wires after the battery was not required anymore for safety. I finished the remaining circuit off-camera as it was a pretty normal soldering. I used jumpers when there was no place left in the bottom area. I also had to use one to connect the gate to 5V input. Doing a quick continuity test to make sure everything is connected correctly.


Time to see if the circuit works. We are getting battery voltage and 5 Volts at correct places, so that’s good. I used an LED with a current limiting resistor to check the output. It is glowing that means the MOSFET is conducting. After that I connected a charger. I am using a power bank to imitate the charger. As soon as you connect it, nothing special happens except this blue LED glowing up showing the battery is full. Now I am disconnecting the positive pin of the LED from output leaving its negative pin there. The positive will connect to the gate using an alligator clip to visualize the changes in gate voltage. I connected my battery again and the LED did not light up, meaning gate is pulled low as expected. When you connect a charger though, it lights up that means gate is pulled high and the MOSFET is not conducting. If I connect the LED back to output again, we can see it is glowing taking power from the power bank itself. That means our circuit is working fine.


I added some more female headers for the float sensor and the two loads it will control. Also, I soldered resistor for LED with the header itself so that the LED can be connected directly. I connected the pole of sensor to middle header and throws to either side and one LED. Let’s connect the power. The circuit is working perfectly fine with the sensor as well. I connected an LED to the other throw as well. The resistor for that is wrapped around its leg. Working just fine. Everything said, I plan not to use the solar panel for various reasons, and instead use a 5V adapter to charge it, which only turns on when the water pump turns on. This load sharing circuit would still be required.


Lastly, my plan is to use a buzzer instead of the green LED, but that can be a problem. When the tank is full, the sensor can stay in that position for a long time until the water level reduces, and I don’t want the buzzer to keep buzzing until someone takes a bath. To solve that I connected positive of that throw to 5V input, which only turns on when the water pump is on. That means buzzer will only make noise until the pump is on. Once it is turned off buzzer will also turn off.

No comments:

Post a Comment

Post Top Ad

Pages