+ Post New Thread
Results 1 to 9 of 9
  1. #1
    Newbie level 3
    Points: 605, Level: 5

    Join Date
    Dec 2013
    Posts
    3
    Helped
    0 / 0
    Points
    605
    Level
    5

    AC current measuring using ACS712 and raspberry pi

    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.

  2. #2
    Advanced Member level 5
    Points: 9,792, Level: 23
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,726
    Helped
    402 / 402
    Points
    9,792
    Level
    23

    Re: AC current measuring using ACS712 and raspberry pi

    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?



    •   AltAdvertisement

        
       

  3. #3
    Newbie level 3
    Points: 605, Level: 5

    Join Date
    Dec 2013
    Posts
    3
    Helped
    0 / 0
    Points
    605
    Level
    5

    Re: AC current measuring using ACS712 and raspberry pi

    Quote Originally Posted by d123 View Post
    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.



  4. #4
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: AC current measuring using ACS712 and raspberry pi

    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?



    •   AltAdvertisement

        
       

  5. #5
    Newbie level 3
    Points: 605, Level: 5

    Join Date
    Dec 2013
    Posts
    3
    Helped
    0 / 0
    Points
    605
    Level
    5

    Re: AC current measuring using ACS712 and raspberry pi

    Click image for larger version. 

Name:	download.png 
Views:	5 
Size:	5.4 KB 
ID:	136332

    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.



  6. #6
    Super Moderator
    Points: 77,782, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,763
    Helped
    3590 / 3590
    Points
    77,782
    Level
    68

    Re: AC current measuring using ACS712 and raspberry pi

    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



  7. #7
    Advanced Member level 5
    Points: 14,954, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,485
    Helped
    805 / 805
    Points
    14,954
    Level
    29

    Re: AC current measuring using ACS712 and raspberry pi

    If you connect an oscilloscope on the ACS712 output, what do you see?
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



    •   AltAdvertisement

        
       

  8. #8
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: AC current measuring using ACS712 and raspberry pi

    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?



  9. #9
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: AC current measuring using ACS712 and raspberry pi

    Quote Originally Posted by Altaero View Post
    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.



--[[ ]]--