This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DIY Battery Monitor - ESP32 based
#11
(2023-03-08, 11:38 PM)Techstyle Wrote: you could use the INA219 on the low side, you just wouldn't get the battery voltage.  I believe that INA226 can grab the voltage as well as getting low side current sensing but do not have experience with it

https://www.ti.com/lit/ds/symlink/ina226...252FINA226

I just put up a second video on the subject showing the NMEA2000 integration, and getting into more details about the board preparation and assy.

https://youtu.be/MREGixRx_No

Thanks for the TI link, Jason. I actualy found it earlier and tried to muddle my way through it. In the end, considering the scary- low current capacity of this admirable project, I've decided to literally go in a different direction - using my relative beefy 300A shunt on the low side Wink


I'll be modifiying a Peacefair PZEM-017 to accept the ESP8266 D1 mini which I had originally ordered for this project. In addition, I'll be adding DS18B20s to measure battery temperature. All of this will be processed by SignalK.

[Image: Schaltung4.png]

The following very detailed articles provide the necessary direction:

https://open-boat-projects.org/en/wifi-batteriemonitor/
https://open-boat-projects.org/en/wifi-b...tegrieren/
Reply
#12
The shunt is just a calibrated wire really, you can go with whatever you want to.  In fact the ones I bought would have been a little more difficult to implement because their holes are too small to go over a battery terminal so I decided to get a different one and bought 300A ones from Aliexpress at $7.20 each:

https://www.aliexpress.us/item/3256804780517351.html

They should arrive in a couple of weeks.  The main reason was that they could easily be implemented in the boat.  In my setup, I don't believe 150A would have been a problem, even when cranking, as that would be 450A for 3 batteries.  I will monitor the current while cranking and may buy a smaller one later.

Is your plan to use one for all the low side or one for each battery?

One thing that concerns me about the Specs of the link you sent was the accuracy, it reads "0.01V", which is 10mV or 40A.  It must be wrong?
Reply
#13
(2023-03-12, 02:55 PM)Techstyle Wrote: ...I decided to get a different one and bought 300A ones from Aliexpress...  Is your plan to use one for all the low side or one for each battery?...

Hey, that's my Chinese shunt!
Even at 300A I'm a bit concerned. As mentioned earlier, this concern is driven by the shunts used by Victron et al. However those have probably been sized very conservatively for monster power-boats with all the accoutrements of a modern-day condo. My 30' sailboat, mostly running a few led lights and old B&G instruments along with the Rpi, hardly competes. Nevertheless, I'll throw an ammeter around the main lead during cranking to see just what's being drawn.

If I have enough capacity, I'll monitor the entire system from the low side.
Reply
#14
(2023-03-12, 05:09 PM)HeviiSailor Wrote:
(2023-03-12, 02:55 PM)Techstyle Wrote: ...I decided to get a different one and bought 300A ones from Aliexpress...  Is your plan to use one for all the low side or one for each battery?...

Hey, that's my Chinese shunt!
Even at 300A I'm a bit concerned. As mentioned earlier, this concern is driven by the shunts used by Victron et al. However those have probably been sized very conservatively for monster power-boats with all the accoutrements of a modern-day condo. My 30' sailboat, mostly running a few led lights and old B&G instruments along with the Rpi, hardly competes. Nevertheless, I'll throw an ammeter around the main lead during cranking to see just what's being drawn.

If I have enough capacity, I'll monitor the entire system from the low side.

I read somewhere that a Cracking Yanmar 3GM30 is a maximum of 460A - that seems a lot.  That would be split across 3 shunts for me, so the original shunt would have been about a 75mV drop, the new one would be about 37.5mV.   Either one I think would be fine, but when I am in a long distance race and using 5A, for gauges, instruments and nav lights, the drop would be 1.25mV for the 300 and 2.5mV for the 150 and I just hope there is enough resolution.  like you said, there is some testing coming up and if the current draw is much lower, I could always cut off one of the 3 resistors from the shunt!!
Reply
#15
Here's one that I did a few years ago. It's been my main battery display on the boat for a few years now. It has an eink display and communicates with OpenPlotter using SignalK

https://github.com/andyrbarrow/EinkBatteryDisplay

Oh, and it also monitors my water tanks.
Reply
#16
THis looks interesting. Can you point to any good tutorials on how to use Visual Studio for beginners- I'm at loss at how to import libraries needed and how to flash the final product to chip?
Reply
#17
Here's one from Microsoft.
https://learn.microsoft.com/en-us/azure/...nd-palette
Reply
#18
Thanks, I think I got a hang of it. I was only missing Python, Git and Platformio, so... One question tough: coming from Arduino world, you don't seem to declare which pin is the 1wire and what are the INA219. Does it detect those automatically?
Reply
#19
1-wire pin is declared in the first line of code - pin 25 in my case, which is digital 2:

Code:
/// 1-Wire Temp Sensors - Exhaust Temp Sensors ///

  DallasTemperatureSensors* dts = new DallasTemperatureSensors(25); //digital 2

// Oil temp (fasten to oil P sensor) - /propulsion/engine/oilTemperature
  auto* oil_temp =
      new OneWireTemperature(dts, 1000, "/Oil Temperature/oneWire");

  oil_temp->connect_to(new Linear(1.0, 0.0, "/Oil Temperature/linear"))
      ->connect_to(
          new SKOutputFloat("propulsion.engine.oilTemperature",
                             "/Oil Temperature/sk_path"));

as for the INA219, that is a I2C device and therefore is called for in:

Code:
Wire.begin(21,22);                // join i2c bus (address optional for master)

there is default pins for this so you may be able to omit the pin numbers
Reply
#20
(2023-06-07, 10:48 PM)Techstyle Wrote: 1-wire pin is declared in the first line of code - pin 25 in my case, which is digital 2:

Code:
/// 1-Wire Temp Sensors - Exhaust Temp Sensors ///

  DallasTemperatureSensors* dts = new DallasTemperatureSensors(25); //digital 2

// Oil temp (fasten to oil P sensor) - /propulsion/engine/oilTemperature
  auto* oil_temp =
      new OneWireTemperature(dts, 1000, "/Oil Temperature/oneWire");

  oil_temp->connect_to(new Linear(1.0, 0.0, "/Oil Temperature/linear"))
      ->connect_to(
          new SKOutputFloat("propulsion.engine.oilTemperature",
                             "/Oil Temperature/sk_path"));

as for the INA219, that is a I2C device and therefore is called for in:

Code:
Wire.begin(21,22);                // join i2c bus (address optional for master)

there is default pins for this so you may be able to omit the pin numbers

thanks, got it. it is just set differetly than arduino boards. this visual studio does look a much more versatile tool. I got it working, sorta, until I apparently fried my board. Let's see what tomorrow brings. Hopefully a new board.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)