Current Monitor/Shunt

I’ve updated the shunt code this morning - please update the ATTINY1614 again using the latest release. Silly bug crept in which could be the problem you are seeing.

Release 2023-01-25-12-26

Just updated both boards and unfortunately it’s the same issue. Any idea what is trying to tell me?

Ok, this is what should happen!

  1. On power up of the current monitor - green LED flashes 5 times at 50ms interval. If the configuration of the settings has not yet occurred, then red and green flash 4 times at 200ms interval.
  2. Approx. every 2 seconds the red LED should flash, indicating it is talking to the INA228 chip
  3. The green LED should flash when the controller successfully communicates with the ATTINY

So in normal operation, the RED LED should flash every 2 seconds, and the GREEN about every 4 seconds.

If you are only seeing red flashes - its the communication with the controller than needs looking at. RS485 chip on ether the controller or the current shunt and/or the cabling between them both.

I have a few spares of the rs485 chip, the controller does work no problem with the peacefair shunt.

When I first power up the diy shunt the red light blinks a couple times, then the green blinks 5 or 6 times quickly. After that then the quick blinking of the red light starts as shown in the video. Without the ina228 installed the same bootup sequence happens and then the red light blinks slowly with longer flashes. So maybe the problem is with the adm chip?

Possibly - check for bad solder joints on that chip.

Use a multimeter on pins 1 and 2 of the ADM2483, you should have 5V when powered up.

Also check you have connected battery positive to both pins 3 and 4 of the screw terminal block (J4).

The RS485 connection from the controller to the shunt is wired “straight” - most left pin joins to most left pin and so on. All 4 connections need to be made.

I’ll check at the adm2483 that’s the only chip 9ve not checked continuity to. I’ll update when I get a chance to do that. I have connected to both 3 and 4. I’m currently not using battery but a 12 volt power supply since it’s easier to turn the board over when it’s not connected but I’ll check that too. Thanks stuart

The ADM2483 is usually indestructible (famous last words!).

If you get the regular RED LED flash - then the INA chip and the ATTINY are working as expected.

Just communication with the controller to sort out. Running from a 12V power supply is fine - that’s what I do during testing.

Ya I decided to use the power supply since I have a difficult time seeing well enough to solder the ina and the ln5009 and since they’re so hard to get blowing them up is not really acceptable. My testing battery bank is a 48v lithium ion.

Once I check the chips what’s the best way to attempt trouble shooting the comms? It must be on the shunt side since controller works with pzm shunt. Have already checked continuity on the rs485 wiring

If you already have the PZEM current sensor working, then the controller should be good.

After that - its just soldering issues on the ADM chip on the current monitor.

Alright. Thanks for your help and I’ll update in an hour or two when I have a chance

That was it! The adm2483 needed re soldered. Well more accurately one needed resoldered, one needed replaced but both shunt boards are working now. That is to say they talk to the controller and it populates on the interface. For like 2 days I’ve been soldering and resoldering the ina228 because I assumed that’s the one I’ve been having problems with, and at first I did when I soldered it a couple weeks ago, but communication is working great!

Hopefully my troubles will help someone else. Thanks for the help Stuart and great job on the BMS!
Does the controller put shunt information out to MQTT? I don’t see it in the messages. If so maybe I need to enable something? If not perhaps we could get it that way in the future so it can be displayed in grafana.
Thanks again!

Great glad it’s working!

I’d have to check on the shunt values over MQTT, but I thought they were there.

I do have a question about shunt voltage also. The reported shunt voltage right now is 53.76v the actual battery bank voltage is 53.4. Voltage reported by modules is 53.36v (close to my meter which can only display 3 total digits) Is there a way to calculate the shunt voltage calibration number?

There isn’t any calibration on the INA chip for voltage.

Check the cables have good connections, perhaps run a dedicated negative cable to the shunt PCB.

The voltage won’t match the modules 100%, but it should be the most accurate voltage.

Do you know how well calibrated your multimeter is?

Looks like it’s a bit off. I have 2 an Extech that reads 53.7 and a Fluke 324 that reads 54.1 Shunt reads 54.17 so looks like the Extech isn’t well calibrated any longer. Unfortunately the Fluke doesn’t read to mV’s

Might be worth re-calibrating the modules using the fluke as well (or a good known voltage source).

Ya I’ll have to do that. Might see if I can just recalibrate the other meter since it gives me mv and I’d like to be as accurate as possible

According to the code the current monitor should be broadcast on /modbus_A but when subscribing to that there’s no data being sent. I’m not good enough with understanding code to know if there’s something wrong. Maybe something to do with the valid data stuff?

The MQTT fields will be “modbus_A90_voltage” as an example - this will be prefixed with whatever you have entered into the MQTT integration page - default is “emon/diybms” so would actually output an MQTT topic of “emon/diybms/modbus_A90_voltage”