As an overview of what I am trying to achieve. I want to create a circuit that will trickle charge 8 x NiCd batteries (2200mAH) so that in the event of an “occasional” power loss my 5v circuit is provided power for around 12 hours (duration tested @ 16 hours on fully charged batteries). If the voltage of the NiCd batteries becomes too low to support the circuit then the power to the ESP32 is cut via the MOSFET. When the AC power is restored the batteries start to recharge and at a suitable voltage the power to the ESP32 is also restored. The ESP32 also monitors the NiCd batteries for Temperature and Voltage only for reporting purposes at the moment.

I testing everything on the breadboard with the exception of the Battery Monitoring (LM35’s and Voltage Divider), everything seemed to work perfectly. Power to the ESP32 was cut when the battery fell to 8.81 volts, then after applying the AC powerpack back to the circuit the battery would recover to 8.95 volts and switch the ESP32 back on which would boot correctly and control my device again. Everything seemed good :) - Refer to Picture 1.

Picture 1

However, adding monitoring to the NiCd batteries (LM35 and Voltage Divider) gave me some strange results when the battery hit the low voltage condition and the Q1 MOSFET turned off. While I did not hang around before removing power I believe D1, R8, and D3 started to get very hot. At this stage I’m not sure if the ESP32 was damaged also.

I think the issue is regarding the grounding of the battery monitoring components? What I think I need to do is take the grounding from the Drain side of the MOSFET so that when the battery is in a low voltage condition the battery monitoring is also disconnected. – Refer to Picture 2

Picture 2

Does anyone see any issues or could offer me any advice?

Note: I do intend to review the type of charging that I am doing, maybe using one of the dedicated IC’s (i.e. MAX713) but for now I would like to get the basics working. I assume currently this circuit would take several weeks to recharge the batteries…

As an update this has worked perfectly (referencing the MOSFET to drive the GND feed) for a number of weeks now in bench testing with figure 2. When the battery voltage drops the ESP32 (a 32bit micro-controller similar to arduino) switches off and on battery recovery it switches back on. I have played around with the hysteresis values though in figure 2 and the Anode side of D3 now connects to the Anode side of D1 (diagram error).

The next step is to have the ESP32 monitor the level of the batteries and switch on and off the charging current as necessary just to save trickle charging all the time - why not since I have spare GPIO ports and the code is simple.

I need to ask another question though because I really am stuck now trying to use 3.3v logic to break the charge feed into the battery while allowing it still to power the circuit.

I have simplified the circuit below in the hope someone can tell me what I should really be doing with Q1 and Q2 before I subject anymore transistors to the magic smoke.

Thanks in advance

[Basic Circuit3


migrated from arduino.stackexchange.com Jun 17 '18 at 10:39

This question came from our site for developers of open-source hardware and software that is compatible with Arduino.

  • \$\begingroup\$ is the LM2596 a module of some sort? look at the way you are switching it "off" - you are not removing the DC in, but breaking the ground return. What exactly is in that circuit block? is it possible that when you break the ground, you are conducting forwards through that block into the load, as pin 2 goes high? \$\endgroup\$ – dmb Jun 17 '18 at 10:46
  • \$\begingroup\$ Yes, its a adjustable buck regulator. Like this ebay.co.uk/itm/…. And yes it does carry forward the grounding from pin 2 to pin 4. This is the reason that I am trying to create two grounds, one from the AC Powerpack and another for the final circuit. I'm not sure if this is a good way though. \$\endgroup\$ – Kev Jun 17 '18 at 10:50
  • \$\begingroup\$ impossible to say for sure without a schematic, but I think you need to switch the DC in on the high side, with a P-chan FET or even a relay. You can test it - connect a resistive load, and then just manually break the connection, check the output with a DVM. \$\endgroup\$ – dmb Jun 17 '18 at 10:54
  • \$\begingroup\$ Yes, to honest I'd thought of that too. I didn't have a P-chan here so I was trying to be clever when things went wrong. However, even if I break the high side would I still have issues with the battery sensors? i.e. the sensors would have current flow into the ESP32 and the ESP32 would still be grounded... \$\endgroup\$ – Kev Jun 17 '18 at 10:57
  • \$\begingroup\$ I don't know what the ESP32 is or how you have connected it or what the IO pins can tolerate but the amount of current coming out of the sensor pins is not likely to be so much. Start at the beginning, and do one step at a time : make sure you are actually switching power off properly when you should be. You already said that the diode and resistors got hot - that suggests a forward path through the LM module when you break the low side. Anyway that is noty a great way to do things - breaking the ground return on the input side will have odd results unless the module is meant to work that way. \$\endgroup\$ – dmb Jun 17 '18 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.