BQ IC and Arduino Code

Hello,
I am Babu, I am doing my project on Arduino along with the BQ25887 IC for battery charging of 2S li-ion battery. Can anyone send me some example code for controlling the BQ IC's along with the arduino.

Welcome! That sounds like an interesting project. What have you accomplished so far? Post your preliminary schematic, not a frizzy thing showing all connections. Include links to technical information on all the hardware devices. Also post your code as you have it. We are more than willing to help you but I will not do the project for you.

1 Like

Google is your friend: arduino - Issues reading from an I2C device - Electrical Engineering Stack Exchange
And the example code:

#include <Wire.h>

#define ADDR  0x6A

void setup() {
  Serial.begin(9600);  // start serial for output
  Wire.begin();
}

void loop() {
  Wire.beginTransmission(ADDR);
  Wire.write(0x0D);
  Wire.endTransmission();
  Wire.requestFrom(ADDR, 1);    // request 1 byte from slave

  while (Wire.available()) { // slave may send less than requested
    char c = Wire.read(); // receive a byte as character
    Serial.println(c);         // print the character
  }

  delay(500);
}
1 Like

So far I have created a evaluation board on my own for the BQ25887 IC, my doubt is regarding how to interface the Arduino with BQ25887 IC and I would like to know how to interface these kind of IC using coding, like any example code file so that I can learn and create on my own

Thanks for this example code, do you have created any library for this IC BQ25887 or have you used this IC earlier

No, I gust googled it. Since this is an i2c device, it would be pretty straight forward to take an existing library for an i2c device and change it for this IC.

1 Like

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