Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:59 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Caravan Monitor

     Page 1 of 2    
Author Message
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 986
Posted: 08:54am 28 Jul 2025
Copy link to clipboard 
Print this post

I am considering writing some Pi Pico software to run a 7 inch monitor for our caravan. I was wondering if any shedders could help me with two areas, firstly has anyone had any experience with interfacing the level senders from the water tanks and secondly can I calculate the capacity of the lithium battery set from the terminal voltage ?

Thank you
OA47
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5089
Posted: 09:04am 28 Jul 2025
Copy link to clipboard 
Print this post

Lithium charge graphs are plenty on the internet.

What water level sensor ? Acoustic? Potmeter? Resistive (metal contacts)..

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 09:28am 28 Jul 2025
Copy link to clipboard 
Print this post

There are all sorts of level sensors (digital, analogue and hybrid), you need to be much more specific. Most will probably be for 12V systems so there will be some sort of hardware needed to interface to a Pico.

Calculating lithium battery remaining capacity is an art, not a science. :) The capacity varies with battery temperature and with the load. As the load gets greater and as the temperature falls the remaining capacity falls. You can probably get a rough guide from the terminal voltage but that's all. I wouldn't put a lot of trust in it. I think EVs measure the charge and discharge current to and from the battery and calculate the capacity that way.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 986
Posted: 10:20am 28 Jul 2025
Copy link to clipboard 
Print this post

  Quote   I think EVs measure the charge and discharge current to and from the battery and calculate the capacity that way.


I plan to measure current in and out of the batteries by looking at the voltage across a shunt, if so how would you know of the current state at any time other than relying on memory ?

OA47
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 11:46am 28 Jul 2025
Copy link to clipboard 
Print this post

  OA47 said  I plan to measure current in and out of the batteries by looking at the voltage across a shunt, if so how would you know of the current state at any time other than relying on memory ?


Because LiFePO4 batteries have a very flat discharge "curve" (unlike lead acid), it's not considered satisfactory to estimate state of charge based on terminal voltage. You have to measure usage (and thus, must somehow "remember" what has been used).

The PZEM-017 module does a good job, and sends out RS485 data which can be read with a PicoMite or ESP-32.

There's an example here using Annex RDS Basic and an ESP32-C3 Supermini.

~
Edited 2025-07-28 21:52 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 343
Posted: 08:27pm 28 Jul 2025
Copy link to clipboard 
Print this post

Hi All

You didn't mention if your battery is made up of individual cells or it is
a fully sealed 12v battery with no access to cell voltages.

When calculating usage, most monitors ignore currents below a certain threshold.
Also the internal losses of the cells are not known or recorded.
So, if you store your van for a few days, these small currents add up.

With my camper setup, I don't measure current with my Rpi at all.
I use only Voltage to estimate battery capacity.
Also reset to 100% whenever all cells reach 3.5.

I do have a Renogy monitor connected to a shunt, but due to the low currents not measured,
it is nearly always wrong.It also consumes power 24/7 unless I open the main breaker.
Also, whenever I use the MIcrowave the large currents drop the voltage (depending on the age of the battery),
but will recover within seconds,so that confuses the capacity estimation.

Have learned over the years not to be so pedantic about getting below 50%.
All the information I have gathered on that, indicates that the battery will outlive you anyway, just avoid the 10% mark and don't go above 3.65v per cell.

I have a blue flashing beacon mounted, so I can see it in my rear vision mirror.
Whenever any kind of alarm condition is detected, it draws my attention.

But, most of this information is superfluous if you have a fully sealed 12v battery.
Regards
Hervey Bay Qld.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 11:17pm 28 Jul 2025
Copy link to clipboard 
Print this post

  Dinosaur said  Have learned over the years not to be so pedantic about getting below 50%.


I think that only applies to lead acid. He did say "lithium", but whether LiFePO4 or other isn't clear.

With LiFePO4, usage between 10% and 90% is often cited, but many assert that they have no problem going from 100% to 0 daily.

https://www.youtube.com/@WillProwse in particular urges users to squeeze out every watt they need.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 986
Posted: 11:26pm 28 Jul 2025
Copy link to clipboard 
Print this post

Here are the only specifications I can find for the batteries:

Kings 12V 120Ah Deep Cycle Lithium LiFePO4 Battery

Chemistry LiFePO4
Rated Capacity 120Ah
Rated Energy 1536Wh
Nominal Voltage 12.8V
Recommended Charging Voltage 14.6V
Rated Float Charge Voltage 14.2V
Low Voltage Cut-off 10V
Max Continous Discharge Current 120A
Max Pulse Discharge Current (5 Seconds) 360A
Max Recommended Charge Current 60A
Max Charging Current 120A
BMS Protections
Over Charge Voltage, Over Discharge Voltage, Over Charge Current, Over Discharge Current, Short Circuit, Over Temperature, Under Temperature
Operating Temperature - Charging 0 to 50°C
Operating Temperature - Discharging -20 to 60°C
Life Cycles >2000
Cell Construction Prismatic
Case Material ABS
Terminals M8 Threaded
Hardware Included 2 X M8 Bolts, 2 x Flat Washers, 2 x Spring Washers
Included Wiring N/A
Allowed Batteries Connected in Series Bank (Same Batch) 4
Allowed Batteries Connected in Parallel (Same Batch) 2

Dimension (LxWxH) ±5mm 331 x 172 x 220mm
Weight ±1kg 12.2kg
Warranty 3 Years
SKU AKEP-BATLITH120_01
Manuals and Documentation NA

I have a 30 amp MPPT solar charger.
30A AC-DC-DC CHARGER
2400W INVERTER

OA47
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 12:42am 29 Jul 2025
Copy link to clipboard 
Print this post

Not a caravan but 12V solar with AC backup.

I use a combination of current in-out and voltage to estimate state of charge. It took a while to determine the charging efficiency.
I am using an INA3221 3 channel current IC module. There is some interference between channels and might have been better with 3 single channel modules instead.



Jim
VK7JH
MMedit
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 07:55am 29 Jul 2025
Copy link to clipboard 
Print this post

That's a pretty neat battery. At least you don't have to worry about over discharge protection as it'll shut down by itself at 10V. :)

Your problem is to decide how low you will let the terminal voltage drop under load, because if that drops below 10V for 5s the battery might disconnect. I'd suggest that 11V at the terminals might be the minimum for reliability if you haven't got very heavy loads.

Note that I said "under load". The terminal voltage off load at that point will still be about 12V. It's difficult to give a capacity reading for any type of secondary cell because they all have internal resistance.

You need to draw enough current to get the terminal voltage to fall enough to measure it. If you say a 0.1AH load, that would be 6A for 1 second. You could do this every, say, 5 or 10mins (by using a MOSFET to connect a 2R power resistor across the battery) to update the battery voltage reading. It would be far more accurate than simply measuring the terminal voltage continuously, although it would use some battery capacity obviously.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 01:18pm 29 Jul 2025
Copy link to clipboard 
Print this post

Neat graph, Jim. What are the characteristics of your battery? What makes up the near-continuous 1.8A (or so) base load (purple-ish dots) which cause the level discharge between 4:15pm and 8:30pm and again between midnight and 9am?

What solar panels are you using?

I bought several of the INA3221 modules, but have actually been using the INA226.

Can you post your code for the INA3221? Also for the graphing--very nice.

(Always happy to be trying to stand on the shoulders of giants.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 986
Posted: 11:15pm 29 Jul 2025
Copy link to clipboard 
Print this post

This is what I believe the water tank senders look like. I have not removed one from the tank yet but the connector end looks the same.




Does anyone know how these work?

OA47
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2640
Posted: 12:30am 30 Jul 2025
Copy link to clipboard 
Print this post

Most likely a resistor divider chain between V+ and ⏚ with the top tap connected to the output. The bottom screwhead connected to ⏚ and the other screwheads to taps on the divider chain. The water bridges the submerged taps to ⏚.

Should be easy to check with a multimeter.

Read it with AIN.
Edited 2025-07-30 10:34 by phil99
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:20am 30 Jul 2025
Copy link to clipboard 
Print this post

If the sensor is as pictured, it is 5 wires and will need 4 inputs to read.
This depicts a number of probes:



I don't know what impedance the probes will be but I expect high and might need conditioning before the 'mite can read reliably.
My guess is simple exposed stainless probes relying on water continuity.
I remember my caravan sensors were unreliable at best.

Jim
VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:47am 30 Jul 2025
Copy link to clipboard 
Print this post

  lizby said  Neat graph, Jim. What are the characteristics of your battery?

Battery is 2 x 105Ah AGM
200W 12V panel.
Most of the load is a radio repeater base station. Also 2 RPi for radio internet linking and weather station.
Add a couple of 'mites hanging of the RPi and a network AP to talk to the car charger.
The charts are produced by a js library chart.js It is too big to host on a picomite (300k) so I run my data web server on a RPi5.

This contains the INA functions:
RTV_bat_mon_F4.zip

Jim
VK7JH
MMedit
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:19pm 30 Jul 2025
Copy link to clipboard 
Print this post

Thanks, Jim. Great stuff as usual.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 12:31pm 30 Jul 2025
Copy link to clipboard 
Print this post

This reminds me of disco4now's project (Battery Monitor) disco4now's project 10 years ago. Perhaps some inspiration?
Regards
Michael
causality ≠ correlation ≠ coincidence
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 01:05pm 30 Jul 2025
Copy link to clipboard 
Print this post

  twofingers said  This reminds me of disco4now's project (Battery Monitor) disco4now's project 10 years ago. Perhaps some inspiration?
Regards
Michael


i believe the below is the link to disco4now's project topic on forum:
https://www.thebackshed.com/forum/ViewTopic.php?TID=7666


cheers,
rob   :-)
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1593
Posted: 02:03pm 30 Jul 2025
Copy link to clipboard 
Print this post

@Rob,
Yes! Thanks!
Regards
Michael
causality ≠ correlation ≠ coincidence
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 08:56pm 30 Jul 2025
Copy link to clipboard 
Print this post

TBS member Panky had a few threads about his Caravan Monitor, THIS  is one of them.  Maybe some help.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025