Page 1 of 1

Allegro ACS 712 Current Sensor

Posted: Sun Dec 18, 2011 2:00 pm
by JohnCrow
Introduction.

The Allegro ACS 712 is a hall effect current transducer, which in the case of the version being used here can measure up to a maximum current of 5A.

The device used is the PPBOB-08882 supplied by Proto-Pic as a Break Out Board (BOB)

Equipment Needed.

EB-006 Multi-Programmer
EB-005 LCD Display
EB-016 Protoboard
16F877A Microcontroller

ACS712 Current Sensor

Digital Multimeter
Various Test Leads

Also a 1nF and a 0.1uF Capacitors are needed.

Calculations.

The ACS712 output has a very linear operation.

The min & max outputs are as follows

@ 0A output = 2.5V dc
@ 5A output = 4.5 dc
These are read by the ADC input on the PIC Microcontroller.

This gives a span of 2V
i.e for every volt output from the ACS712 = 2.5A input

Slope = FScale/Span
Slope = 5/2
Slope = 2.5

Offset = 2.5 * 2.5 = 6.25

Current = (Slope * Fscale) - Offset
Current = (2.5 * 4.5) - 6.25
Current = 5A

In practice it was found the displayed current value was half the true value.
This was compensated for my multiplying the final value by 2.

Error Detection.

The flowchart will detect if the ACS output goes

Below 2.5 V – Under Range
Above 4.5 V – Over Range.

In these cases the display clears and a warning is displayed.



Current Testing.

The test current was generated by a 6V battery pack and a 2.2R high power resistor.

This was connected in series to the ACS712 through a digital multimeter.

The theoretical current should have been 2.7A, according to ohms law, but the loading pulled the battery voltage down to about 3.3 V.

This gives a current of 1.5A, which is the approximate value that was displayed.
System Setup
System Setup
Setup.JPG (111.18 KiB) Viewed 18371 times
Sensor Close Up
Sensor Close Up
Sensor.JPG (80.48 KiB) Viewed 18371 times
Accuracy Check
Accuracy Check
Accuracy.JPG (130.63 KiB) Viewed 18371 times
I think it would be fairly easy to modify this project to function as a multirange power meter.
Reading voltage using a 2nd ADC input and a potental divider chain for voltage scaling.

Other versions of the sensor are available that read upto 30A full scale.
Otherwise a current transformer could be used to step down to match this sensor.

Flowcode file below

Re: Allegro ACS 712 Current Sensor

Posted: Sun Dec 18, 2011 2:02 pm
by JohnCrow
ACS712 - Current Transducer V2.fcf
Current Sensor
(15.5 KiB) Downloaded 753 times

Re: Allegro ACS 712 Current Sensor

Posted: Sun Dec 18, 2011 6:40 pm
by medelec35
Hi John. That's an interesting project!
I am going to have a play with some hall effect sensors myself.
Thanks for sharing :)

Martin

Re: Allegro ACS 712 Current Sensor

Posted: Sun Dec 18, 2011 11:00 pm
by Werner
Great project John, Thanks for sharing it! I was able to order a small ACS712 BOB from Sparkfun USA 10.00. I am putting this one on my todo list. :D
Have a great day Buddy!
Werner

Re: Allegro ACS 712 Current Sensor

Posted: Mon Apr 09, 2012 11:16 am
by JohnCrow
I have now made the ACS712 module into a working circuit.

Connections from the SIL header are right to left

Vcc
Gnd
N/C
Output - To Microcontroller
Small ceramic capacitor is 1nF
The Green screw terminal block is the current connection.
ACS712.JPG
ACS712.JPG (106.83 KiB) Viewed 18012 times

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 2:30 pm
by jgu1
Hi John!

I bought a pair of ASC 712th But it is 20 amps. version. I've tried to look in your very fine project and see if I could figure out how to change your calculations so that it can be used for this. But I'm not a Master. Will you help with where I need to modify the software to use it to 20A model. Or if it´s possible to readout lest 15A I measured it provides 100mV per Amp. :D

I Use FC 5.4

Best regard

Jorgen.

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 2:44 pm
by Enamul
Hi Jorgan/John,

Where you bought that from? Can you please post the link? I am looking for something can handle up to 100A.

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 2:51 pm
by jgu1
Hi Enamul!

Ebay I bougth this: http://viewitem.eim.ebay.dk/New-design- ... 3917998008
Best regard


Jorgen

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 2:52 pm
by Enamul
Thanks a lot. I will order one right now.
Edit: I have ordered one which can handle 30A and I have seen couple in Farnell which can handle 100A. I am very interested to look now John's code. Thanks John for posting nice sensor idea.

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 4:01 pm
by Enamul
Hello
I believe the following change will make the meter range to 20A..

Code: Select all

// Setup Variables
// Adjust to trim readings
Current_FS = 10
Span = 2
Offset_Reference = 2.5

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 7:03 pm
by jgu1
Hi Enamul! :D

Thank´s for update to 20A I will test it tonigth. Hope you also get succes with the sensor. I´ts amazing they can handle all these Amp´s

Regard

Jorgen

Re: Allegro ACS 712 Current Sensor

Posted: Thu Dec 06, 2012 11:02 pm
by Enamul
Hi Jorgan,

You are welcome. Yes, that also amaze me. These are cool sensors hope that also remain cool while sensing as hall sensor :lol:

Re: Allegro ACS 712 Current Sensor

Posted: Fri Dec 07, 2012 8:15 am
by jgu1
Hi Enamul!

Perfect, it works with ACS 20A :D Thank´s. And thank´s to John for nice project.

Best regard

Jorgen.

Re: Allegro ACS 712 Current Sensor

Posted: Fri Dec 07, 2012 10:04 am
by JohnCrow
Hi Jorgen

Glad you found it useful

Re: Allegro ACS 712 Current Sensor

Posted: Fri Dec 07, 2012 12:00 pm
by jgu1
Hi John!

Well I can use it, and it's a very good project. I have taken the liberty to change in your program and add a voltmeter and calculate watts.
But don´t laugh when you look at it and I will not exclude that there are errors, but it works, except Watts does not appear as floating, dosn´t matter.

Made in FC 5.4

Jorgen.

Re: Allegro ACS 712 Current Sensor

Posted: Fri Dec 07, 2012 12:18 pm
by JohnCrow
That was something I'd thought of doing myself.
I'll have a look at you program when I get chance

Re: Allegro ACS 712 Current Sensor

Posted: Fri Dec 07, 2012 3:29 pm
by jgu1
Hi!

Sorry a little correction.. :oops:

When displayedd Watt below 10W it did not delete one digit.

Jorgen..

Re: Allegro ACS 712 Current Sensor

Posted: Tue Dec 11, 2012 8:57 pm
by jgu1
Hi!

Here is another model as a single component ACS758. up to 50 A with large terminals. if any are interested. :D

http://docs-europe.electrocomponents.co ... d885f6.pdf

But how we fit it to John´s project, I don´t know.

Best regard

Jorgen

Re: Allegro ACS 712 Current Sensor

Posted: Tue Dec 11, 2012 9:03 pm
by Enamul
Hi Jorgan,

Thanks. I have seen that. I will order 100A version of that. I will post when I can finish.