Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AC current measuring using ACS712 and raspberry pi

Status
Not open for further replies.

dipumon

Newbie level 3
Joined
Dec 21, 2013
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
32
Hello,

I am trying to measure ac current flowing through an ac motor using hall effect current sensor ACS712 with maximum current rating of 5A.

The sensor is interfaced to the raspberry pi through an ADC in series with the motor.

The problem I am facing is everytime I get 2.5V from the output pin(Vo) of the sensor. The value never changes even when I connect the sensor or switch it on/off.

The digital reading from the ADC is also shown as 510-514.

I tried replacing the IC, but got the same result.

Can anyone guide me in measuring the AC current using ACS712 or suggest any other sensor for the same.
 

Hi,

Have a re-read of the datasheet specs, page 4: "Zero Current Output Voltage" This is the Allegro Micro datasheet.

Without any further information I would guess your supply voltage is 5V? Or with the motor on do you get a constant 2.5V at the sensor output pin?

"The value never changes even when I connect the sensor or switch it on/off." - Could you elaborate a little, please? Switch what on or off (the sensor has no "enable" pin...)? Connect the sensor to what? Are you reading the 2.5V on the ADC output/input or on the ACS output pin?

Have you seen Application 4 on page 12? Maybe it can help.

Personal interest in this subject (I want to learn how to connect an ADC to a Pi-style device sooner or later) - Where did you get the code from for the project, if it isn't private/your own work, thanks?
 

Hi,

Have a re-read of the datasheet specs, page 4: "Zero Current Output Voltage" This is the Allegro Micro datasheet.

Without any further information I would guess your supply voltage is 5V? Or with the motor on do you get a constant 2.5V at the sensor output pin?

"The value never changes even when I connect the sensor or switch it on/off." - Could you elaborate a little, please? Switch what on or off (the sensor has no "enable" pin...)? Connect the sensor to what? Are you reading the 2.5V on the ADC output/input or on the ACS output pin?

Have you seen Application 4 on page 12? Maybe it can help.

Personal interest in this subject (I want to learn how to connect an ADC to a Pi-style device sooner or later) - Where did you get the code from for the project, if it isn't private/your own work, thanks?

The value of 2.5 V is obtained at the output pin of the sensor.

As per the datasheet, 2.5 V is obtained when there is no current passing through the sensor. So I suppose the sensor is not getting current even when the motor is on.

I have connected the sensor in series with the load with the phase directly connected to the load and the neutral connected through the terminals of the sensor.

The value obtained after ADC conversion is equal to 512 which is equivalent of 2.5 V.
 

And what approximate current is supposed to flow through the sensor? I used this sensor for DC current measurements, but also tested it with 50 Hz and it was OK. At 5A it would have range from about 1.6 to 3.4V. Can you show the connection of your ACS712?
 

download.png

I have connected the motor to the sensor as shown in the above diagram. I also connected an 40w luminescent bulb to the sensor, it also showed 2.5V at the output.

The motor is 1.5W-2.5W with voltage rating of 230V.
 

Hi,

Now in the picture there is a DC voltage source. Before you said it is AC.

I wonder if you are aware that:
If you measure AC current, that the output signal is AC, but with 2.5V DC offset. --> A DC voltmeter will show 2.5V independent of load current.

Now you say it is a module... Is it made for AC measurement? Or does it contain a low pass filter that suppresses AC?

Maybe your ADC input is low pass filtered... or your software includes a low pass filter...

We don´t know.

****
Your motor maybe is 1.5W. In worst case this means just 6.5mA RMS
The 5A type ACS has an output ratio of 185mV/A
with the 6.5mA input the output will be 1mV RMS (with 2.5V DC offset)
--> so the 510 ... 514 reading of post#1 may be correct.

****
Please try to give complete and detailed informations.
Try to explain as detailed as possible what you did:
(Example: We don´t know what 40V bulb you used. AC 230V? 12V DC like shown in the picture?)
We don´t know what you expect.

Klaus
 

If you connect an oscilloscope on the ACS712 output, what do you see?
 

ADC resolution is 10 bit, thus giving us ~5mV for LSB. 510-514 codes means that the input range is 20 mV. Considering sensitivity of the ASC712, p-p current is 11 mA. Or 7.8 mA rms, what is similar to 6.5 mA that was stated before. Everything is correct.
The solution might be to use amplifier to span useful signal to 0-5 V range.
But for that current range, this sensor is not the best solution because the total output error near 0 A is rather big. Why not to use precise current-sensing resistor?
 

ADC resolution is 10 bit, thus giving us ~5mV for LSB. 510-514 codes means that the input range is 20 mV. Considering sensitivity of the ASC712, p-p current is 11 mA. Or 7.8 mA rms, what is similar to 6.5 mA that was stated before. Everything is correct.

Shame on me for these calculations (I lost one 0). But nevertheless, 1 LSB from ADC is about 27 mA of current through the sensor. Considering the rms current of 6.5 mA we barely get 2 values, plus errors. 510-514 ADC values are still correct.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top