I am new to Arduino, I am connecting the BB2590 battery with the Arduino Mega using the SMBus by I2C communication but when I upload the program it says "No I2C devices found"
Wiring: I am simply connecting 2 wires with the battery's SMBus, SDA wire to SDA Pin & SCL wire to SCL pin on SMBus.
Here is my code:
#include <Wire.h>
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication at 9600 baud rate
while (!Serial); // Wait for Serial Monitor to open
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
int nDevices;
Serial.println("Scanning for I2C devices...");
nDevices = 0;
for (address = 1; address < 127; address++) {
// Try to start communication with the device at this address
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0) {
Serial.print("I2C device found at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.print(address, HEX);
Serial.println(" !");
nDevices++;
} else if (error == 4) {
Serial.print("Unknown error at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.println(address, HEX);
}
}
if (nDevices == 0) {
Serial.println("No I2C devices found\n");
} else {
Serial.println("Done scanning\n");
}
delay(5000); // Wait 5 seconds before next scan
}
Hi @hassan5596. Your post was temporarily hidden due to a false positive from the forum's automated spam filter. The post was restored after a review by a human moderator so it is now visible again. I apologize for the inconvenience.
I believe this part of your request has now been provided via the datasheet download links:
These were in the previously hidden post so you might have missed them.
Thanks for those links. Unfortunately, they do not explain how to use the 6-pin connector, which we would need in order to check how you have connected the battery to the Arduino. Please post a link to a document with those details, when you post your schematic.
Adding pull-up resistors would certainly be worth trying.
See this post for further documentation.
Even if documentation is interesting it lacks ( at first sight ) two things
what is the reference level for this i2c communication ( is the negative pole or the positive pole )? Doing it wrong means frying a $500 battery
are pullup resistors included ( I bet no but... )
As I understand there are 2 packs of 12V batteries inside and two separated i2c circuits.
How are thes 12V packs connected? Are completely separated or have a common connection or what?