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
#26
(2023-06-09, 02:15 PM)Tuomas_S Wrote:
(2023-06-09, 01:59 PM)Techstyle Wrote:
(2023-06-09, 01:22 PM)Tuomas_S Wrote: can confirm, the + sensor cable is only wire in the battery side of shunt. There is a resistor between the terminals but that's it.

I switched the cables other way round to test, but only thing changed was the amperage polarity.

It sounds to me like you have it on the Negative side of the battery?

This is a high-side device, your shunt should be connected to the Positive side of the battery, with Vin+ connected to the Battery side and Vin- connected to the load side (the side that goes to the panel.  nothing else should be connected to the battery side of the shunt, all cables (chargers and consumers) should be connected to the load side of the shunt.

Also, ensure you have removed the onboard shunt resistor from the INA219 board?

Everything is wired as per your schema on github, and the onboard resistor has been yanked out. And it is definitively on the + side of things. Other end of shunt goes to battery, other end goes to boat electrical system.

Looks like you have it hooked up right, and you said have current correct, so if you back calculate the Voltage drop across the Shunt (V=IR), do you get the 0.9V?  if so you may be looking at "busvoltage" vs "loadvoltage" (the names were not consistent with what I said earlier), here are the definitions:

"ina219_A.getBusVoltage_V()"  this equals the voltage available downstream, your Vin-
"ina219_A.getShuntVoltage_mV() / 1000" this equals the drop across the shunt
in my code I call:
Code:
float read_A_loadvoltage_callback() { return (ina219_A.getBusVoltage_V() + (ina219_A.getShuntVoltage_mV() / 1000));}
which adds the drop across the shunt to the downstream voltage to get the Battery voltage:
Code:
ina219_A_loadvoltage->connect_to(new SKOutputFloat("electrical.batteries.A.voltage"));
if you are using the code as is it should be good, but you could uncomment some of the following that I set up for debugging.

Code:
  ina219_B_current->connect_to(new SKOutputFloat("electrical.batteries.B.current"));

  ina219_B_loadvoltage->connect_to(new SKOutputFloat("electrical.batteries.B.voltage"));

  //ina219_B_shuntvoltage->connect_to(new SKOutputFloat("electrical.batteries.B.shuntv"));

  //ina219_B_busvoltage->connect_to(new SKOutputFloat("electrical.batteries.B.vin-v"));

  ina219_B_power->connect_to(new SKOutputFloat("electrical.batteries.B.power"));

  ina219_B_loadvoltage->connect_to(new SoCBInterpreter("/Battery B/Voltage/curve"))
      ->connect_to(new SKOutputFloat("electrical.batteries.B.capacity.stateOfCharge", "/Battery B State of Charge/sk_path"));

hope this helps!!
Reply


Messages In This Thread
DIY Battery Monitor - ESP32 based - by Techstyle - 2023-02-22, 07:26 PM
RE: DIY Battery Monitor - ESP32 based - by we9v - 2023-02-28, 05:16 PM
RE: DIY Battery Monitor - ESP32 based - by Techstyle - 2023-06-09, 03:22 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)