logo elektroda
logo elektroda
X
logo elektroda

Remote battery voltage monitoring system (ESP8266 and INA219)

dktr  Cool? (+16)
📢 Listen (AI):
DIY electronic device for monitoring battery voltage, built with ESP8266 and INA219, housed in a plastic box.

An acquaintance asked me to assemble "something" that would give him notification when the battery in his very little used car discharges too much.
For a quick thought I came up with ESP8266 + ina219 and a piece of code that would take a measurement, send it to the server and put the system to sleep for a set period of time in order to start the cycle again after waking up. The board is my universal board for the ESP8266 and additionally a module with the INA219 chip which I use to measure voltage.
The whole thing goes to my server where the data is collected, visualised and, if necessary, a notification is sent by a simple SMS through the phone which I have connected to the server and makes for a universal SMS gateway.
The device fit into a box from some small oled display, 2 banana sockets and a 300mA fuse were installed and I prepared wires with crocodiles to plug it straight into the battery. The unit draws about 6 mA when asleep, which can be greatly improved by using another linear stabiliser instead of the 1117 and go down to about 90 μA. When sending a measurement it draws about 200 mA for 300 ms. Quite by the way there is a DS18b20 on the board.

This is where you can look at the measurement results


I forgot to add and have already added. The program code that is in the ESP8266, you can take a look at how the wakeup and sending data to the server is implemented.


Graph showing car battery voltage over time.

About Author
dktr
dktr wrote 878 posts with rating 653 , helped 42 times. Live in city Ostróda. Been with us since 2003 year.

Comments

gulson 20 May 2024 16:54

Thanks for sharing the solution! All in all, if someone has 20 vintage cars it could be an interesting solution to keep an eye on the batteries. One, it's about not driving the battery to sulphation and... [Read more]

xury 20 May 2024 17:00

This can be done on an ADC and a high-impedance divider without the INA219. If it's just a matter of measuring voltage. Although the ESP8266 has an ADC max of 1V. [Read more]

dktr 20 May 2024 17:02

You can, but that ADC in the esp8266 is kind of lame, it gives quite a spread of measurements, I tested. The INA219 is cheap and quite effective. [Read more]

xury 20 May 2024 17:09

Obvious. The thing with ADC already is that it can give scattered results. This is why filtering ala ski jumping scores is used. You take a number of measurements, the extreme ones you discard the middle... [Read more]

khoam 20 May 2024 18:25

Without a proper "de-noise" circuit at the input, the ADC in the ESP8266 isn't very suitable for anything. The choice of the INA219 was, in my opinion, the right one. [Read more]

jarekgol 20 May 2024 18:47

This Ina can measure voltage? [Read more]

dktr 20 May 2024 19:04

Yes, up to 26 volts with pretty good precision. [Read more]

jarekgol 20 May 2024 23:17

https://www.gotronik.pl/ina219-dwukierunkowy-czujnik-pradu-z-szyna-i2c-p-5736.html I'm looking at a board like this, and let's say I can see the current connection, but what about the voltage? Does it... [Read more]

dktr 21 May 2024 00:11

Yes, it measures against digital earth. It can work in both directions, it will then indicate negative current. [Read more]

sq3evp 21 May 2024 09:41

Cool thing, but I wonder if it is better than the ready-made ones that connect after BT? I read the description carefully and I think that the idea more than interesting, I understand that the sleeping... [Read more]

dktr 21 May 2024 10:10

I think there should be no problem, I myself have not yet used mobile networks, mainly wifi, radio 433 or there lora 868. Probably a little increase in power consumption and you have to somehow sensibly... [Read more]

sq3evp 21 May 2024 10:36

Thanks for the info - I will look, look, maybe someone has something similar implemented. Fact - the GSM module also needs to be put to sleep so it doesn't finish off the monitored battery :) . [Read more]

jarekgol 21 May 2024 14:20

@sq3evp after sleep, you may have a long time (and power consumption for communications) to log back on to the network. As you try this, do some research on how long it's even worth turning the modem off... [Read more]

lukiiiii 21 May 2024 15:00

Is it possible to convert this so that measurements are sent to thingspeak instead of the server? And then display on the phone using a widget. [Read more]

dktr 21 May 2024 15:01

It can be done, just rework the URL line [Read more]

PiotrSołtys 21 May 2024 15:58

I was also thinking of doing something similar but with current measurement. You'd have to make a system that works for a long time that wouldn't discharge the battery by itself. And think what to do in... [Read more]

liske1 21 May 2024 18:15

Thank you so much for sharing this project. I currently wanted to do a similar project. [Read more]

mariomario 21 May 2024 20:57

I am also thinking about a similar project but on an ESP32 C3 with Supla ( https://gui-generic-builder.supla.io/ ) uploaded and sending measurements to the free Supla server. The ESP32 C3 has a more powerful... [Read more]

sq3evp 23 May 2024 09:22

I have found the module - confirm, the current measurement module has also appeared to me. Buy and run - wonder if I will succeed :) . [Read more]

%}