i have a 36v 12.5ah battery with BMS. now i try from arduino to read BMS information so
i connect GND to C- , RX-TX TX-RX
Here is Document information:
Document (292.8 KB)
#include <SoftwareSerial.h>
SoftwareSerial BMS_serial(2, 3); // RX, TX (connect TX of Arduino to RX of the device and vice versa)
void setup() {
Serial.begin(9600); // USB Serial communication
BMS_serial.begin(9600); // SoftwareSerial communication
}
void loop() {
Serial.println("SEND 1");
byte hexData[] = { 0x3A, 0x16, 0x02, 0x00, 0x18, 0x00, 0x0D, 0x0A };
for (int i = 0; i < sizeof(hexData); i++) {
BMS_serial.write(hexData[i]);
}
while (BMS_serial.available()) {
char receivedChar = BMS_serial.read();
Serial.print(receivedChar);
}
delay(3000);
Serial.println("SEND 2");
byte hexDataDD[] = { 0x3A, 0x16, 0x04, 0x00, 0x1A, 0x00, 0x0D, 0x0A };
for (int i = 0; i < sizeof(hexDataDD); i++) {
BMS_serial.write(hexDataDD[i]);
}
while (BMS_serial.available()) {
char receivedChar = BMS_serial.read();
Serial.print(receivedChar);
}
delay(3000);
}

