diyBMSv4ESP32 icon indicating copy to clipboard operation
diyBMSv4ESP32 copied to clipboard

Juntek shunts

Open slundell opened this issue 3 years ago • 7 comments

Today I installed a diyBMS (esp32) setup in my boat. One controller and 8 battery modules. I already have two Juntek VAT-1050 shunts for measuring currents installed (one on all charge connections and one on all consumption connections). These shunts output their data on RS485 (using a USB connector!) and wireless using an nRF24* clone.

These units are rather cheap (~$30) and are available from all the standard Chinese resellers.

They have some "rules" functionality such as over-current and under-voltage which can trigger a relay. The protocol is largely known.

I was thinking about integrating these shunts in a similar way to the way the diyBMS-shunt is handled. Given that it is a rs485-protocol I was thinking I should re-use much of the code you have written for the diyBMS-shunt. Do you have any pointers?

slundell avatar Jun 28 '21 20:06 slundell

My shunts use rs485 and Modbus protocol.

If you look at the code there are two tasks, one to request some data from the shunt and another which receives it.

After that, the code is just unpacking the reply and putting it into memory of the controller.

stuartpittaway avatar Jun 28 '21 20:06 stuartpittaway

I have decoded the data from the shunt using the existing code, but changing a few registers and conversion factors. I am a bit confused about filling in the shunt-struct. How are currentMonitor.milliamphour_in and currentMonitor.milliamphour_out differentiated? As I understand the shunt will only measure the sum of the charge and discharge and not separate the current paths and measure them separately? If that is the case, when are currentMonitor.milliamphour_in and currentMonitor.milliamphour_out updated, and how?

slundell avatar Jul 12 '21 18:07 slundell

I can measure the current direction and hence calculate a total amo hour counter.

This is obviously only measuring the portion of power in/out of the battery.

stuartpittaway avatar Jul 12 '21 21:07 stuartpittaway

OK, so if current is greater than 0, increment milliamphour_in and if less than 0, increment milliamphour_out? (or vice versa, depending on shunt orientation)

slundell avatar Jul 12 '21 21:07 slundell

Yes, although the ina228 uses charge in columbs, which is then converted into energy and then current

stuartpittaway avatar Jul 12 '21 21:07 stuartpittaway

Hello slundell, did you manage to integrate the juntec? I would also like to integrate the current sensor, maybe you can provide the code.

buddhafragt avatar Aug 06 '21 22:08 buddhafragt

I didn't purchase one in the end, but it does look very similar to the JUNKTEC shunt I've just finished integration with.

stuartpittaway avatar Feb 24 '22 08:02 stuartpittaway