Allegro ACS 712 Current Sensor
Moderator: Benj
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Allegro ACS 712 Current Sensor
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.
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
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.
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
Last edited by JohnCrow on Sun Dec 18, 2011 2:49 pm, edited 2 times in total.
1 in 10 people understand binary, the other one doesn't !
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi John. That's an interesting project!
I am going to have a play with some hall effect sensors myself.
Thanks for sharing
Martin
I am going to have a play with some hall effect sensors myself.
Thanks for sharing
Martin
Martin
-
- Posts: 95
- Joined: Sat Jun 11, 2011 4:12 am
- Has thanked: 87 times
- Been thanked: 31 times
- Contact:
Re: Allegro ACS 712 Current Sensor
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.
Have a great day Buddy!
Werner
Have a great day Buddy!
Werner
Werner
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"
STUDENT OF: Martin - Professor of Flowcode, John, Jan, Fotios and Nicolas "Spanish Dude"
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: Allegro ACS 712 Current Sensor
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.
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.
1 in 10 people understand binary, the other one doesn't !
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
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.
I Use FC 5.4
Best regard
Jorgen.
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.
I Use FC 5.4
Best regard
Jorgen.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Jorgan/John,
Where you bought that from? Can you please post the link? I am looking for something can handle up to 100A.
Where you bought that from? Can you please post the link? I am looking for something can handle up to 100A.
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Enamul!
Ebay I bougth this: http://viewitem.eim.ebay.dk/New-design- ... 3917998008
Best regard
Jorgen
Ebay I bougth this: http://viewitem.eim.ebay.dk/New-design- ... 3917998008
Best regard
Jorgen
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Allegro ACS 712 Current Sensor
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.
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.
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hello
I believe the following change will make the meter range to 20A..
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
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Enamul!
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
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
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Jorgan,
You are welcome. Yes, that also amaze me. These are cool sensors hope that also remain cool while sensing as hall sensor
You are welcome. Yes, that also amaze me. These are cool sensors hope that also remain cool while sensing as hall sensor
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Enamul!
Perfect, it works with ACS 20A Thank´s. And thank´s to John for nice project.
Best regard
Jorgen.
Perfect, it works with ACS 20A Thank´s. And thank´s to John for nice project.
Best regard
Jorgen.
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Jorgen
Glad you found it useful
Glad you found it useful
1 in 10 people understand binary, the other one doesn't !
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
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.
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.
- Attachments
-
- ACS712_VoltAmp_Watt_God.fcf
- (26.63 KiB) Downloaded 447 times
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
- Contact:
Re: Allegro ACS 712 Current Sensor
That was something I'd thought of doing myself.
I'll have a look at you program when I get chance
I'll have a look at you program when I get chance
1 in 10 people understand binary, the other one doesn't !
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi!
Sorry a little correction..
When displayedd Watt below 10W it did not delete one digit.
Jorgen..
Sorry a little correction..
When displayedd Watt below 10W it did not delete one digit.
Jorgen..
- Attachments
-
- ACS712_VoltAmp_Watt_God.fcf
- (27.33 KiB) Downloaded 451 times
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi!
Here is another model as a single component ACS758. up to 50 A with large terminals. if any are interested.
http://docs-europe.electrocomponents.co ... d885f6.pdf
But how we fit it to John´s project, I don´t know.
Best regard
Jorgen
Here is another model as a single component ACS758. up to 50 A with large terminals. if any are interested.
http://docs-europe.electrocomponents.co ... d885f6.pdf
But how we fit it to John´s project, I don´t know.
Best regard
Jorgen
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Allegro ACS 712 Current Sensor
Hi Jorgan,
Thanks. I have seen that. I will order 100A version of that. I will post when I can finish.
Thanks. I have seen that. I will order 100A version of that. I will post when I can finish.