OpenMarine
how to log and graph battery (cell) voltage over time? - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: How do I...? (https://forum.openmarine.net/forumdisplay.php?fid=3)
+--- Thread: how to log and graph battery (cell) voltage over time? (/showthread.php?tid=3194)

Pages: 1 2


how to log and graph battery (cell) voltage over time? - noel - 2021-01-09

I have 4 LiFePO4 cells wired in series to provide my 12v housebank.

What I want to do is to log the individual cell voltages (and overall battery voltage) and then display them as a graph of voltage against time.

Previously I used a celllog 8s with USB output to the LogView software, but my celllog died and they are now out of production. What was nice with that is it stored the data locally, and then I just exported it to my laptop to view when I wanted it. 

The first page on this thread https://forum.openmarine.net/showthread.php?tid=716 there is a graph of exactly what I want to do, but having read right through the thread I still cannot figure out exactly what I need to do.

Can anyone provide me with a step by step instruction of what I need to buy and do to get my cell voltages into a nice graph? I am sure I am not the only one who would appreciate this!

I am runing OpenPlotter 2 with OpenCPN on a raspberry pi 3

Thanks in advance.

Noel


RE: how to log and graph battery (cell) voltage over time? - affinite - 2021-01-09

(2021-01-09, 05:15 AM)noel Wrote: I have 4 LiFePO4 cells wired in series to provide my 12v housebank.

What I want to do is to log the individual cell voltages (and overall battery voltage) and then display them as a graph of voltage against time.

Previously I used a celllog 8s with USB output to the LogView software, but my celllog died and they are now out of production. What was nice with that is it stored the data locally, and then I just exported it to my laptop to view when I wanted it. 

The first page on this thread https://forum.openmarine.net/showthread.php?tid=716 there is a graph of exactly what I want to do, but having read right through the thread I still cannot figure out exactly what I need to do.

Can anyone provide me with a step by step instruction of what I need to buy and do to get my cell voltages into a nice graph? I am sure I am not the only one who would appreciate this!

I am runing OpenPlotter 2 with OpenCPN on a raspberry pi 3

Thanks in advance.

Noel

Noel
There are several ways to do this but I chose to avoid a direct (physical) connection to my Pi/OpenPlotter
I use a combination of a NodeMCU ESP8266 microcontroller running firmware called ESPEasy and an Analogue to Digital converter called an ADS1115.
The ADS1115 is what measures the battery voltage. (In my case 3 separate battery banks)
The ADS1115 sends the digital voltage reading to the ESP8266 and then to the Raspberry Pi over WiFi (so no direct connection to the Pi) which puts the values into SignalK.
The Pi is on my boat in Greece and data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home in the UK where the battery measurements are stored in an InfluxDB database. A Grafana graph (see attached example) plots the data.

If you search this forum and Google these items you should be able to piece it together as I did but I am working on presentable "How I did it" write-up which I'll share when done.

PaddyB's posts on the sbuject were very useful for me and also take a look at Ole Saastad's project site here https://sites.google.com/site/olewsaa/yacht-server-with-raspberry
Ive shamelessly copied some of his ideas also.

Instead of using an ESP8266 you could connect the ADS1115 directly to the RPi and let OpenPlotter grab the data for you but, as I said, that's not the route I chose.
Best of luck


RE: how to log and graph battery (cell) voltage over time? - noel - 2021-01-10

Thanks for your pointers. Your 'How I did it' would be most useful.

I get the general idea of the hardware bits, but it is the fine details that I can'ts seem to work out, e.g 'data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home' - where and how do you program or define those intervals? Stuff like that.

I am sure there is all sorts of fine tuning and cool stuff I could do, but unfortunately it would take me a lot of time to learn all this to be able to tweak what others have done. I have already spent too many hours searching the forums on this. Hence my wish for a step by step 'recipe' that I can just blindly copy. So, if you are willing to do your 'how I did it' that would be fantastic. No rush - with COVID I am currently a long way away from my boat.

Noel


RE: how to log and graph battery (cell) voltage over time? - affinite - 2021-01-10

(2021-01-10, 07:30 AM)noel Wrote: Thanks for your pointers. Your 'How I did it' would be most useful.

I get the general idea of the hardware bits, but it is the fine details that I can'ts seem to work out, e.g 'data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home' - where and how do you program or define those intervals? Stuff like that.

I am sure there is all sorts of fine tuning and cool stuff I could do, but unfortunately it would take me a lot of time to learn all this to be able to tweak what others have done. I have already spent too many hours searching the forums on this. Hence my wish for a step by step 'recipe' that I can just blindly copy. So, if you are willing to do your 'how I did it' that would be fantastic. No rush - with COVID I am currently a long way away from my boat.

Noel

I too have some time on my hands so I'll get to it.
In the meantime if you wanted to follow the same route as me take a look at the wiki for the firmware I'm using on the ESP8266 Microcontroller and also Google and get familiar with Node-Red 
I'll be back


RE: how to log and graph battery (cell) voltage over time? - Tuomas_S - 2021-05-09

(2019-04-02, 06:46 PM)PaddyB Wrote: The Pi is on my boat in Greece and data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home in the UK where the battery measurements are stored in an InfluxDB database. A Grafana graph (see attached example) plots the data.

I'm interested in this- how did you do the telemetry part?


MQTT - affinite - 2021-05-09

(2021-05-09, 09:08 PM)Tuomas_S Wrote:
(2019-04-02, 06:46 PM)PaddyB Wrote: The Pi is on my boat in Greece and data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home in the UK where the battery measurements are stored in an InfluxDB database. A Grafana graph (see attached example) plots the data.

I'm interested in this- how did you do the  telemetry part?

On the boat there is an ADS1115 to measure voltages which is connected directly to a NodeMCU/ESP8266 running ESPEASY
ESPEASY sends data (1 reading per second) over the boat network as UDP to my Node-Red Dashboard / SignalK on the Openplotter RPi
In addition, the ESP8266 also publishes the data (1 reading every 10 minutes) over the Internet using MQTT to the Hive public MQTT broker.
I have a Home RPi which subscribes to my Topic on the Hive MQTT broker and pulls the data sent from the boat into another (Home) SignalK server
I run the SK InfluxDB plugin to record the incomming data and plot it using Grafana

When the boat is laid up over winter I can turn the Openplotter RPi off and leave the ESP8266 sending only the 10 minute MQTT messages.
It worked well last winter - I havent been to my boat since last September but I can tell you that the house battery is at 12.7v right now.   Wink


Hope this helps


RE: MQTT - baltika_no_9 - 2021-05-12

(2021-05-09, 10:24 PM)affinite Wrote:
(2021-05-09, 09:08 PM)Tuomas_S Wrote:
(2019-04-02, 06:46 PM)PaddyB Wrote: The Pi is on my boat in Greece and data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home in the UK where the battery measurements are stored in an InfluxDB database. A Grafana graph (see attached example) plots the data.

I'm interested in this- how did you do the  telemetry part?

On the boat there is an ADS1115 to measure voltages which is connected directly to a NodeMCU/ESP8266 running ESPEASY
ESPEASY sends data (1 reading per second) over the boat network as UDP to my Node-Red Dashboard / SignalK on the Openplotter RPi
In addition, the ESP8266 also publishes the data (1 reading every 10 minutes) over the Internet using MQTT to the Hive public MQTT broker.
I have a Home RPi which subscribes to my Topic on the Hive MQTT broker and pulls the data sent from the boat into another (Home) SignalK server
I run the SK InfluxDB plugin to record the incomming data and plot it using Grafana

When the boat is laid up over winter I can turn the Openplotter RPi off and leave the ESP8266 sending only the 10 minute MQTT messages.
It worked well last winter - I havent been to my boat since last September but I can tell you that the house battery is at 12.7v right now.   Wink


Hope this helps

Please forgive me if I'm being obtuse but I'm not clear on how the process is working. The EPS8266 has a single WiFi capability if I understand it correctly. The frequent (1 second) updates require the ESP8266 to be associated with your on-board WiFi network but the less frequent MQTT messages require it to be connected to a public WiFi thus giving Internet connectivity or is that Internet link achieved by some other method?

Thanks



RE: MQTT - affinite - 2021-05-13

[attachment=1476 Wrote:baltika_no_9 pid='19430' dateline='1620849942']
(2021-05-09, 10:24 PM)affinite Wrote:
(2021-05-09, 09:08 PM)Tuomas_S Wrote:
(2019-04-02, 06:46 PM)PaddyB Wrote: The Pi is on my boat in Greece and data is updated every second but, in addition, the data is sent every 10 minutes over the internet to my home in the UK where the battery measurements are stored in an InfluxDB database. A Grafana graph (see attached example) plots the data.

I'm interested in this- how did you do the  telemetry part?

On the boat there is an ADS1115 to measure voltages which is connected directly to a NodeMCU/ESP8266 running ESPEASY
ESPEASY sends data (1 reading per second) over the boat network as UDP to my Node-Red Dashboard / SignalK on the Openplotter RPi
In addition, the ESP8266 also publishes the data (1 reading every 10 minutes) over the Internet using MQTT to the Hive public MQTT broker.
I have a Home RPi which subscribes to my Topic on the Hive MQTT broker and pulls the data sent from the boat into another (Home) SignalK server
I run the SK InfluxDB plugin to record the incomming data and plot it using Grafana

When the boat is laid up over winter I can turn the Openplotter RPi off and leave the ESP8266 sending only the 10 minute MQTT messages.
It worked well last winter - I havent been to my boat since last September but I can tell you that the house battery is at 12.7v right now.   Wink


Hope this helps

Please forgive me if I'm being obtuse but I'm not clear on how the process is working. The EPS8266 has a single WiFi capability if I understand it correctly. The frequent (1 second) updates require the ESP8266 to be associated with your on-board WiFi network but the less frequent MQTT messages require it to be connected to a public WiFi thus giving Internet connectivity or is that Internet link achieved by some other method?

Thanks

Hi
The attached diagram shows the layout of my boat network and the ESPEASY Wiki may help explain a bit better than I can here

My ESP8266's have one WiFi connection to my LTE Router but the ESPEASY firmware allows you to specify up to 3 "Controllers"
When on the water, my first Controller is configured to send and receive UDP packets to my OpenPlotter RPi every second. 
This is sent over the local WiFi network with no Internet connection required
The second Controller is my MQTT controller and is used to send data over the Internet 

Within the ESPEASY firmware there is a "Rules Engine". 
The rules engine allows me to run some simple code which tells ESPEASY to read the battery voltage sensors (ADS1115) every 10 minutes and Publish the data to the MQTT controller. 
This DOES require an Internet connection so, when in the yard, my LTE router is permanently connected to the Internet but only used to send this small "burst" of data every 10 minutes so LTE modem data usage is very small

(When in the yard, the UDP controller is switched off)


RE: how to log and graph battery (cell) voltage over time? - baltika_no_9 - 2021-05-14

Thanks for your reply.

I can't seem to see the "attached diagram"?


RE: how to log and graph battery (cell) voltage over time? - affinite - 2021-05-14

(2021-05-14, 11:15 AM)baltika_no_9 Wrote: Thanks for your reply.

I can't seem to see the "attached diagram"?

Sorry, its now added.
I also have a more comprehensive "build notes" document which I'm trying to update and make presentable.
I'll add that when done.