Trouble readout ACS712ELC-05B (current sensor)

Hi Guys!
I am kind of stuck. I have a Mega with a connceted relay-bench (8 relays). Also conntected are six sensors ACS712ELC-05B. The sensor is mounted correctly the powersupply for a laserdiode with a max-current of 4.5A.

(Powersupply +) -> (Sensor) -> (Relay) -> (Diode +)
(Powersupply GRD) -> (Diode GRD)
I know, that the sensor should also be installed on the GRD-Line in the first way. Tried that, no difference, same readings. Following the sensors documentation in can be installed either POS- or GRD-line.

Everything works fine, except that i just get basic readings trom the sensor. When switching relais on (max power on diodes) and off (diodes work fine), there is no or just minor difference in the readings.

The sensor are mounted quite close to each other - like 2mm board next to board. The relais-bench is about 5cm parallel to the row of sensors.

Did i mount these components to close to each other or what can cause the issue? Components are all brandnew.
Kind regards,
Andy

could you upload a schematic of circuit used?
if you use a multimeter to measure the current what readings do you get?

running the following code on a UNO

double Vout = 0;
double Current = 0;

void setup() {
  Serial.begin(115200);
}

void loop() {

  for (int i = 0; i < 10000; i++) {
    Vout = (Vout + (5 / 1023.0 * analogRead(A0))); //for calculating the average of read values for
  } //making measurement more stable.
  Vout = Vout / 10000; //dividing average for getting averaged voltage value

  Current = (Vout - 2.48) / 0.185 * 1000;

  Serial.print("Voltage = ");
  Serial.print(Vout, 2);
  Serial.print(" V");
  Serial.print("\t Current = ");
  Serial.print(Current, 2);
  Serial.print(" mA");
  Serial.print(" Supply Voltage = ");
  Serial.println(5 / 1023.0 * analogRead(A1), 2);
}

ACS712 tests meter and serial monitor output

meter       UNO
V    mA    mA     V
0     0     7     0
.59   12    18    0.57
1.55  40    48    1.51
2.56  64    74    2.52
3.57  92    103   3.51
4.76  120   129   4.38
6.98  184   197
10.2  275   290
15.9  417   430

Here is the schematics. I have six lines for Diodes as the one shown using A0-A5 for readings. The code i use is different from that you showed, but mine is the one provided in the manual that came with the sensor. My readings give me a (more or less) constant value of 2500mV. The Amp-value ranges about 0,15-0,25A (with no load!).

I used my multimeter to check outgoing voltage of the board. There i had a reading of 5V and no changes in the sensordata displayed on serial monitor.

Here is the code provided by seller:

****** Code Begin******
/*
Measuring Current Using ACS712
*/
const int analogIn = A0;
int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module
int RawValue= 0;
int ACSoffset = 2500;
double Voltage = 0;
double Amps = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
RawValue = analogRead(analogIn);
Voltage = (RawValue / 1024.0) * 5000; // Gets you mV
Amps = ((Voltage - ACSoffset) / mVperAmp);
IDUINO for maker’s life
www.openplatform.cc
Serial.print("Raw Value = " ); // shows pre-scaled value
Serial.print(RawValue);
Serial.print("\t mV = "); // shows the voltage measured
Serial.print(Voltage,3); // the '3' after voltage allows you to
display 3 digits after decimal point
Serial.print("\t Amps = "); // shows the voltage measured
Serial.println(Amps,3); // the '3' after voltage allows you to display
3 digits after decimal point
delay(2500);
}
****** Code End******

This is my sensor: My sensor

have you checked that the relay is operating?
also measured the current thru the ACS712 with a multimeter?
if so what are the readings?

Yes, all the relays work perfect as the diodes are also working when power is provided by the board.
As the power is passing the sensors with no loss i am confused about the readouts.
My only guess is, that may be the position next to each other or to the relays causes the issue…

Here‘s an image of my work:

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