Is there any way to make this circuit better?

We're using an INA219 and an ESP32 to measure the relation between the battery's voltage to its state of charge. The circuit must be closed ony when the ESP32 is turned on, so that it is measuring current, voltage and time correctly, therefore we've designed it with 2 relay modules as shown in the image. Is there any way to make this simpler or more efficient?


The website for the relay: https://components101.com/switches/5v-dual-channel-relay-module-pinout-features-applications-working-datasheet

Why does the voltage and current monitoring circuit only need to be active when the ESP32 is on ?

Because we’re using the ESP to process the information from the INA (they’re connected via SCL and SDA). If the battery starts draining before the the ESP is turned on, we’ll be losing data

You can start by adding pull-up resistors to the SCL (Serial Clock Line) and SDA (Serial Data Line) for better I2C communication.

Using a MOSFET is much simpler than a level converter when driving two relays in series. You can use a P-Channel MOSFET in the battery line, which can eliminate the need for the relays altogether. The function of the two relays can often be consolidated into one, streamlining your design.

Important Note: A level converter is not a relay driver and can fail when used incorrectly. The relay is an inductive device that produces a kickback voltage higher than what the level shifter can tolerate, potentially damaging the level converter.

Hopefully, this helps!

I dont understand.

You can only read, and process data, from the INA219 when the ESP32 is powered and able to read it.

If the 'battery starts draining' then so be it, the INA219 is not able to record or log data unless its read by the ESP32.

It's also a safety measure, if for any reason the ESP32 stops recording data (or if I want it to, e.g. it gets too hot) , we want the battery to stop as soon as possible. Since I'm doing this for more than just one battery, I'd like for the circuit to have less human interference as possible

  • You need to rethink the relay control.

Sorry for the misunderstanding, we are using 5v dual channel relay module that is linked after the image, the relay in the schematic don’t represent what’s really happening. We’ll change for better clarification.

  • Use similar wiring as seen in post #7.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.