False calculation of the BMS data

I take it you don't have access to an oscilloscope. Do you have a spare Arduino? You could read an analog input pin and display it on Tools->Serial Plotter. It would be good to look at the waveforms on the RX pin.

I can try if I could organize the oscilloscope. The second suggestion, I can try that. What you want me to do is to read the RX pin of the Arduino connected to the BMS by either oscilloscope or a spare Arduino? Please correct me if I misunderstood you.

bilal40:
I can try if I could organize the oscilloscope. The second suggestion, I can try that. What you want me to do is to read the RX pin of the Arduino connected to the BMS by either oscilloscope or a spare Arduino? Please correct me if I misunderstood you.

Yes. Make sure that the serial waveform is switching cleanly between 0V and 5V and that all of the transitions are at nice, neat time intervals (the bit time). If there is any noise in the received signal it would explain why occasional characters are being dropped.

So, I connected the oscilloscope to the RX and GND pins of the Arduino and that's what I could see. I am attaching the picture. I am sorry, I don't have much experience with oscilloscope, therefore, I don't know what I did is correct or not.

And after disconnecting the Inverter, this is what the osci shows. And after several transmissions, I see that there are no missing bytes.

Looks like the Inverter is generating some nasty noise on your serial line. That could be why you are missing some characters.

The display seems to be saying that the time between divisions on the scope is 25 microseconds. Looks like two pulses every 75 microseconds (3 divisions). That's 37.5 microseconds between pulses or 26.666 kHz. How that noise gets through the opto-isolators I don't know.

That's right. I am attaching a picture which is showing the way I have used the power sources. To the opto of BMS, I have a 220VAC to 5VDC converter. For the opto of inverter, I have used another 220VAC to 5VDC converter. For Arduino itself, I have 220VAC to 12VDC (I require this 12VDC somewhere else), then from 12VDC to 5VDC through an IC. I used the opto for inverter, so that I should not disturb Arduino and BMS, yet I am facing the problem. I am also attaching the serial plotter, where I read the RX pin of the Arduino and plotted it.

As a test, I disconnected the 220VAC to 5VDC converter of inverter from the circuit breaker and connected to another wall plug. Then there were no missing bytes but I was seeing that sometimes the calculated voltage and current values were wrong. The current values should be positive and around 4 to 5 Amps. I am giving the data below.

Received bytes: AA 03 1A 00 00 42 4D 3B 64 BF 8F 0F 5C 0F 6B 00 EF 00 E9 00 00 00 00 1C F8 04 37 01 8C 85 64 
Received CRC: 0x6485
Calculated CRC: 0x6485

State of Charge: 70.72 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: -1.12 A

Battery Temperature: 23.30 °C

BMS Temperature: 39.60 °C

Outside Temperature: 23.90 °C

Boiler Temperature Sensor 1: 22.65 °C


Received bytes: AA 3 1A 48 B4 42 4D 0 0 0 0 F 60 F 71 0 EE 0 E9 0 0 0 0 BB E9 4 37 1 65 E7 90 
Received CRC: 0x90E7
Calculated CRC: 0x90E7

State of Charge: 70.76 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: 0.00 A

Battery Temperature: 23.30 °C

BMS Temperature: 35.70 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 22.74 °C


Received bytes: AA 3 1A 3B 64 42 4D 0 0 0 0 F 5F F 70 0 EE 0 E9 0 0 0 0 BB D2 4 37 1 4B 2E 21 
Received CRC: 0x212E
Calculated CRC: 0x212E

State of Charge: 70.76 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: 0.00 A

Battery Temperature: 23.30 °C

BMS Temperature: 33.10 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 23.00 °C


Received bytes: AA 3 1A 34 39 42 4D 0 0 0 0 F 5E F 70 0 EE 0 E9 0 0 0 0 BB BC 4 37 1 37 1A 4F 
Received CRC: 0x4F1A
Calculated CRC: 0x4F1A

State of Charge: 70.76 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: 0.00 A

Battery Temperature: 23.30 °C

BMS Temperature: 31.10 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 22.74 °C


Received bytes: AA 3 1A 8C 4A 42 4D A5 E3 3E 9B F 63 F 79 0 EE 0 E9 0 0 0 0 3E 42 4 38 1 4D C0 A5 
Received CRC: 0xA5C0
Calculated CRC: 0xA5C0

State of Charge: 70.79 %

Battery Pack Voltage: 51.38 V

Battery Pack Current: 0.30 A

Battery Temperature: 23.30 °C

BMS Temperature: 33.30 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 23.09 °C


Received bytes: AA 3 1A E2 4E 42 4D B4 39 3F E8 F 67 F 80 0 EE 0 E9 0 0 0 0 4 A3 4 39 1 5F AF 54 
Received CRC: 0x54AF
Calculated CRC: 0x54AF

State of Charge: 70.85 %

Battery Pack Voltage: 51.38 V

Battery Pack Current: 1.82 A

Battery Temperature: 23.30 °C

BMS Temperature: 35.10 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 23.00 °C


Received bytes: AA 3 1A 3B 64 42 4D 18 93 BE 84 F 60 F 6F 0 EE 0 E9 0 0 0 0 B9 D6 4 39 1 6E CD C5 
Received CRC: 0xC5CD
Calculated CRC: 0xC5CD

State of Charge: 70.89 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: -0.26 A

Battery Temperature: 23.30 °C

BMS Temperature: 36.60 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 22.83 °C


Received bytes: AA 3 1A 4C CD 42 4D 0 0 0 0 F 61 F 71 0 EE 0 EA 0 0 0 0 1E 90 4 3A 1 6F 9F 19 
Received CRC: 0x199F
Calculated CRC: 0x199F

State of Charge: 70.92 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: 0.00 A

Battery Temperature: 23.40 °C

BMS Temperature: 36.70 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 22.83 °C


Received bytes: AA 3 1A 3F 7D 42 4D 78 D5 BE 69 F 5F F 70 0 EF 0 EA 0 0 0 0 9D CD 4 3A 1 71 F5 34 
Received CRC: 0x34F5
Calculated CRC: 0x34F5

State of Charge: 70.95 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: -0.23 A

Battery Temperature: 23.40 °C

BMS Temperature: 36.90 °C

Outside Temperature: 23.90 °C

Boiler Temperature Sensor 1: 23.00 °C


Received bytes: AA 3 1A 53 F8 42 4D CA C1 BF 1 F 61 F 72 0 EF 0 EA 0 0 0 0 48 2D 4 3B 1 75 34 B5 
Received CRC: 0xB534
Calculated CRC: 0xB534

State of Charge: 70.99 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: -0.51 A

Battery Temperature: 23.40 °C

BMS Temperature: 37.30 °C

Outside Temperature: 23.90 °C

Boiler Temperature Sensor 1: 23.09 °C


Received bytes: AA 3 1A 6A 7F 42 4D D9 17 BE CE F 63 F 73 0 EF 0 EA 0 0 0 0 2D B7 4 3C 1 7B 2C 4B 
Received CRC: 0x4B2C
Calculated CRC: 0x4B2C

State of Charge: 71.05 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: -0.40 A

Battery Temperature: 23.40 °C

BMS Temperature: 37.90 °C

Outside Temperature: 23.90 °C

Boiler Temperature Sensor 1: 23.09 °C


Received bytes: AA 3 1A 52 F2 42 4D CC CD BE 8C F 61 F 71 0 EE 0 E9 0 0 0 0 B2 D4 4 3C 1 77 2B 7C 
Received CRC: 0x7C2B
Calculated CRC: 0x7C2B

State of Charge: 71.09 %

Battery Pack Voltage: 51.25 V

Battery Pack Current: -0.27 A

Battery Temperature: 23.30 °C

BMS Temperature: 37.50 °C

Outside Temperature: 23.80 °C

Boiler Temperature Sensor 1: 22.83 °C

bilal40:
Then there were no missing bytes but I was seeing that sometimes the calculated voltage and current values were wrong. The current values should be positive and around 4 to 5 Amps. I am giving the data below.

The CRC's all seem to match so the data you are receiving matches what the BMS is sending. If the data is 'wrong' then the fault is either in the BMS or in your interpretation of the data.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.