Arduino UNO I2C library for P9025AC Receiver
At end of Datasheet of IDTP9025A there are indicated registers to receive directly, with a microprocessor, all informations about Vrect (volts received from coil), IOut(current required from load), Coil frequency etc…So I decided to write a library for Arduino UNO so I can see on a Philips PCD8544 (old Nokia lcd) all information about wireless charging.
This is just a test… this project can be realize
Wireless power receiver (IDTP9025AC) communicate with an lcd Philips PCD8544 and Arduino UNO.
IDTP9025AC GND —> Arduino UNO GND;
IDTP9025AC SDA –> Arduino UNO A4;
IDTP9025AC SCL –> Arduino UNO A5;
IDTP9025AC I2CR –>IDTP9025AC OUT (As suggested by datasheet);
IDTP9025AC OUT –> +5V of load (in this case i connected a micro-usb connector);
IDTP9025AC GND –> load Ground;
PCD8544 VCC –> Arduino UNO 3.3V
PCD8544 GND –> Arduino UNO GND;
PCD8544 3…8 –> Arduino UNO 7…2 respectively (As suggested from PCF8544 Github library (I used https://github.com/carlosefr/pcd8544)
In the P9025AC datasheet is wrote that I2C pins must not float (Pull-UP with OUT pin or Pull-down to ground with R3=0 if not used)… so for use I2C line I have cut off R3 and connected I2CR pin with OUT pin.
To wrote my Arduino library I used Notepad++ program to compile .cpp and .h file and the last version of Arduino IDE (1.8) for .ino sketch.
When the system enters the power transfer mode,the P9025AC’s regulation circuit then regulates the voltage of the 7V rectifier, by sending the Control Error Packets instruction to the transmitter. The LDO output is activated and the power is supplied to the load, after that VRECT reaches 7V.
To read value of Vrect (12bit) with my library I use arduino Wire command to read 16bit of register 0x40 and 0x41 and put result into uint16_t val…
<
static uint16_t readRegister(uint8_t i2cAddress, uint8_t reg1, uint8_t reg2) {
Wire.beginTransmission(i2cAddress);
i2cwrite(reg1);
Wire.endTransmission(0);
Wire.requestFrom(i2cAddress, (uint8_t)1);
uint8_t lsb = i2cread();
Wire.beginTransmission(i2cAddress);
i2cwrite(reg2);
Wire.endTransmission(0);
Wire.requestFrom(i2cAddress, (uint8_t)1);
uint8_t msb = i2cread();
uint16_t val = (lsb <<8 | msb);
return val;
}
>
After that I remove 4 bit from “val” to get my 12 bit of Vref…
<
int16_t P9025A::getVrectVoltage()
{
uint16_t res = readRegister(m_i2cAddress, P9025A_VRECT_VOLTAGE_REG0, P9025A_VRECT_VOLTAGE_REG1) >>4;//Shift out bit 3:0 of Reg41
return res;
}
>
So with library helps, arduino’s sketch is very slim and easy to understand…
<
lcd.setCursor(0, 3);
Vrect = pwr.getVrectVoltage();
lcd.print(“Vrect: “);lcd.print(Vrect*5*(1.8/4096));lcd.print(” V “);
>
With this system I can read also 12 bit of current that load requires from receiver and also 10bit value of Coil frequency.
Arduino complete library posted on Github (https://github.com/Contel87/P9025AC)