Hello,
I want to measure the current of a fuel cell prototype with aid of the ACS764.
For that purpose, a PCB board was designed to measure current and temperature (See attachments for schematics and layout).
The SW is running in ARDUINO UNO
The reason why I am asking your help is because I always receive the same value no matter if there is flowing current or not.
After many rounds of trouble shooting I can be sure that:
• a current is flowing through the sensor
• there are no short circuits
• the I2C-address of the ACS764 is correct (I am using this small SW test: http://playground.arduino.cc/Main/I2cScanner )
Taking the figure “Typical Application Diagram” of the Data sheet as reference, I have two small deviations, and those are:
• Vcc is 5 Volts
• I have a pull down 10KΩ resistor at pin 14 “FREEZE”
I have two type of responses.
The first one is a fixed value of 3 or 1. I got this answer when I run this Software
#include <Wire.h> // load I2C-Library
void setup() {
Wire.begin(); // I2C-Bus "activate"
Serial.begin(9600); // Enable the serial communication for debugging purposes
/*
Wire.beginTransmission(B1100000);
Wire.write(byte(0x02)); //set average points as 1
Wire.write(byte(0x00));
Wire.write(byte(0x01));
Wire.write(byte(0x01));
Wire.endTransmission();
Wire.beginTransmission(B1100000);
Wire.write(byte(0x04)); //set gain as 2
Wire.write(byte(0x00));
Wire.write(byte(0x00));
Wire.write(byte(0x02));
Wire.endTransmission();
Wire.beginTransmission(B1100000);
Wire.write(byte(0x06)); //set overcurrent as 63% of CSR
Wire.write(byte(0x00));
Wire.write(byte(0x00));
Wire.write(byte(0x03));
Wire.endTransmission();
*/
}
void loop()
{
int aux=0;
// helpbyte
Wire.beginTransmission(B1100000); //start communication with slave #60
Wire.write(byte(0x00)); //send command 0x00. MAY BE HERE IS MY MISTAKE BUT I REALLY TRIED EVERYTHING ELSE
Wire.endTransmission();
Wire.requestFrom(B1100000, 3); // expecting 3 Byte from slave #60
delay(10); //waiting
while(Wire.available()) // Until some bytes are in bus. P.S. Slave may send less than requested
{
aux = Wire.read(); // overwrite the value and just keep the last significant byte
}
Serial.print("00: ");
Serial.println(aux); // print the value
delay(3000);
}
The second type of answer is an “Echo” of the last parameter that was set up, in this case 255. I got this answer when I run a software like this
#include <Wire.h> // load I2C-Library
void setup() {
Wire.begin(); // I2C-Bus "activate"
Serial.begin(9600); // Enable the serial communication for debugging purposes
Wire.beginTransmission(B1100000);
Wire.write(byte(0x02)); //set average points as 255
Wire.write(byte(0x00));
Wire.write(byte(0x01));
Wire.write(byte(0xFF));
Wire.endTransmission();
/*
Wire.beginTransmission(B1100000);
Wire.write(byte(0x04)); //set gain as 2
Wire.write(byte(0x00));
Wire.write(byte(0x00));
Wire.write(byte(0x02));
Wire.endTransmission();
Wire.beginTransmission(B1100000);
Wire.write(byte(0x06)); //set overcurrent as 63% of CSR
Wire.write(byte(0x00));
Wire.write(byte(0x00));
Wire.write(byte(0x03));
Wire.endTransmission();
Wire.endTransmission(); //set parameters
Wire.beginTransmission(B1100000);
Wire.write(GAIN_RANGE, 4);
Wire.endTransmission();
Wire.beginTransmission(B1100000);
Wire.write(FAULT_LEVEL, 4);
Wire.endTransmission();
Wire.beginTransmission(B1100000);
Wire.write(0x00);
Wire.endTransmission();
*/
}
void loop()
{
int aux=0;
// helpbyte
Wire.beginTransmission(B1100000); //start communication with slave #60
Wire.write(byte(0x00)); //send command 0x00. MAY BE HERE IS MY MISTAKE BUT I REALLY TRIED EVERYTHING ELSE
Wire.endTransmission();
Wire.requestFrom(B1100000, 3); // expecting 3 Byte from slave #60
delay(10); //waiting
while(Wire.available()) // Until some bytes are in bus. P.S. Slave may send less than requested
{
aux = Wire.read(); // overwrite the value and just keep the last significant byte
}
Serial.print("00: ");
Serial.println(aux); // print the value
delay(3000);
}
What I am looking for is a test Software for the ACS764. May be my problem is the software. I really dont care if you provide me a C-function or library afterwards i can re-write this function into a “Arduino”-function or library.
Thank you very much in advance for your attention and do not hesitate to contact me if you need more details about my application.
Regards
Juan Gutierrez
Schematic_Sensor_v1.pdf (22.9 KB)
Sensor_v1.pdf (789 KB)