Author Topic: ACS712 - Current Sensor Module  (Read 8293 times)

0 Members and 1 Guest are viewing this topic.

Offline TJ232Topic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: 00
  • www.esp8266-projects.org
    • ESP8266 Projects
ACS712 - Current Sensor Module
« on: June 02, 2015, 11:45:45 am »
Hello,

In the process to find better isolated current measurement solution I am exploring the posibility to use the ACS712 Current Sensor Board with the ESP8266. As they are all over the place, so why not.

Main identified problems to solve:

ASC712:
     5 Vdc power supply device
     measure positive and negative 5/20/30Amps, corresponding to the analog output 100mV/A BUT
    "ZERO" point, means no test current through the output voltage is VCC / 2 =5v/2=2.5V !

ESP8266:
    3V only device
    ADC range  max: 0-1V

So far, the solution that I found was to use a difference amplifier:



 
If you know any other way to do it or have any related ideas, please feel free to share :)


For reference: ASC712 Current module meets ESP8266
 
ESP8266 Projects - www.esp8266-projects.org
MPDMv4 Dimmer Board available on Tindie: https://www.tindie.com/stores/next_evo1/
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: ACS712 - Current Sensor Module
« Reply #1 on: June 02, 2015, 12:28:05 pm »
As the other chip is driving its output, why not just a voltage divider, it would protect your device from ever having its range exceeded, and does the job just fine, turns a 0-5V swing into a 0-1V swing,
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4437
  • Country: dk
Re: ACS712 - Current Sensor Module
« Reply #2 on: June 02, 2015, 01:00:40 pm »
just divide the output with 5, and you'll get 0-1V with 0.5V at zero current
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: ACS712 - Current Sensor Module
« Reply #3 on: June 02, 2015, 01:34:11 pm »
If you only need one directional current measurement you can use a dirty trick to increase the resolution.
You wire the ACS712 reversed, so that a positive current reads as a negative.
Then you add a voltage diviver to the output that brings the 2.5V down to 1V.

Now, if current flows it will read as a negative value from the upper limit of your ADC range.

This way you can use the full resolution even if the output voltage is VCC/2 referenced.
A bit dirty but i worked in my application.
 

Offline TJ232Topic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: 00
  • www.esp8266-projects.org
    • ESP8266 Projects
Re: ACS712 - Current Sensor Module
« Reply #4 on: June 03, 2015, 08:41:30 am »
As the other chip is driving its output, why not just a voltage divider, it would protect your device from ever having its range exceeded, and does the job just fine, turns a 0-5V swing into a 0-1V swing,

Nice and elegant idea.
Did you use such a configuration ?
Any drawback?
What's happening to lower gains?



ESP8266 Projects - www.esp8266-projects.org
MPDMv4 Dimmer Board available on Tindie: https://www.tindie.com/stores/next_evo1/
 

Offline TJ232Topic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: 00
  • www.esp8266-projects.org
    • ESP8266 Projects
Re: ACS712 - Current Sensor Module
« Reply #5 on: June 03, 2015, 08:43:33 am »
If you only need one directional current measurement you can use a dirty trick to increase the resolution.
You wire the ACS712 reversed, so that a positive current reads as a negative.
Then you add a voltage diviver to the output that brings the 2.5V down to 1V.

Now, if current flows it will read as a negative value from the upper limit of your ADC range.

This way you can use the full resolution even if the output voltage is VCC/2 referenced.
A bit dirty but i worked in my application.

Believe it or not, I was doing last week the same "dirty" trick and yes, worked OK :)
The only problem is that is a liitle bit to much near the edge.
ESP8266 Projects - www.esp8266-projects.org
MPDMv4 Dimmer Board available on Tindie: https://www.tindie.com/stores/next_evo1/
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: ACS712 - Current Sensor Module
« Reply #6 on: June 03, 2015, 08:51:45 am »
If you don't want bidirectional current sensing, why not use one of the Allegro sensors designed for unidirectional sensing such as the ACS713?
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: ACS712 - Current Sensor Module
« Reply #7 on: June 03, 2015, 09:11:00 am »
If you don't want bidirectional current sensing, why not use one of the Allegro sensors designed for unidirectional sensing such as the ACS713?

Indeed, i can tell you why i dit that.
Because the ACS712 was abundant on Ebay with connectors, board and headers for next to nothing.
The ACS713 would have been a pain in the arse to get and way, way, way more expensive.
 

Offline TJ232Topic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: 00
  • www.esp8266-projects.org
    • ESP8266 Projects
Re: ACS712 - Current Sensor Module
« Reply #8 on: June 03, 2015, 09:59:40 am »
If you don't want bidirectional current sensing, why not use one of the Allegro sensors designed for unidirectional sensing such as the ACS713?

Indeed, i can tell you why i dit that.
Because the ACS712 was abundant on Ebay with connectors, board and headers for next to nothing.
The ACS713 would have been a pain in the arse to get and way, way, way more expensive.

Same here, the idea was to use the dirt-cheap ACS712 Modules available everywhere. To buy chip only it's more expensive and out of scope.
 
 
ESP8266 Projects - www.esp8266-projects.org
MPDMv4 Dimmer Board available on Tindie: https://www.tindie.com/stores/next_evo1/
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26911
  • Country: nl
    • NCT Developments
Re: ACS712 - Current Sensor Module
« Reply #9 on: June 03, 2015, 11:01:41 am »
Just use the difference amplifier setup with one leg tied to VCC/2.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline TJ232Topic starter

  • Frequent Contributor
  • **
  • Posts: 331
  • Country: 00
  • www.esp8266-projects.org
    • ESP8266 Projects
Re: ACS712 - Current Sensor Module
« Reply #10 on: June 06, 2015, 10:10:31 am »

 Part 2 of the story : programming  the ACS712 Current reading function.

Question for any of you using frequently the ASC712 sensor: it is all the time so noisy or is just mine ?
Using the Voltage Level Shifter and DC op amp module with a big number of reading gives decent result but in case of direct voltage divier the noise level is very high.

 
ESP8266 Projects - www.esp8266-projects.org
MPDMv4 Dimmer Board available on Tindie: https://www.tindie.com/stores/next_evo1/
 

Offline PeterFW

  • Frequent Contributor
  • **
  • Posts: 577
  • Country: de
    • Stuff that goes boom
Re: ACS712 - Current Sensor Module
« Reply #11 on: June 06, 2015, 11:53:02 am »
Question for any of you using frequently the ASC712 sensor: it is all the time so noisy or is just mine ?

The ones i had were too, they have decent noise floor.
You can increase the filter capacitance to get that down at the cost of bandwidth.
There is page in the datasheet about that.

With a 0,1µF capacitor i got it down to about 2 bits with the 10 bit ADC i used.
 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: ACS712 - Current Sensor Module
« Reply #12 on: July 18, 2015, 05:41:35 pm »
I used two ACS712's and I noticed that having a clean powersupply makes a difference. When testing it the power came from the USB port, after that  I put it on a simple linear 5 volt supply it got a lot better. Second thing I noticed is that placing it near other equipment can make the 0 level shift. In my application I made a calibration routine in software so it can be adjusted by one push button on the back of the PSU (in this case).   
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: ACS712 - Current Sensor Module
« Reply #13 on: July 19, 2015, 12:03:28 pm »
Quote
If you know any other way to do it or have any related ideas
Is your shunt resistor connected to GND? If you want an isolation then most likely it is floating - you can use a "differential" setup with 5 resistors. The example below gives a differential gain=1, the common mode can be as high as +-300V and the voltages on op-amp inputs are still within +-3V range.
Indices as on your 4-resistor chart:
R1=R3=99k
R2=100k
R4=1k,
the fifth is R5=1k which connects inverting input to GND.

Uout=1*(V2-V1)
CMRR=inf, but resistor matching is critical.
« Last Edit: July 19, 2015, 03:41:18 pm by Brutte »
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: ACS712 - Current Sensor Module
« Reply #14 on: July 20, 2015, 07:38:55 am »
I'd think the price difference between ACS712 and 713 is gone when you have to add additional circuitry.
 

Offline Chris C

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
Re: ACS712 - Current Sensor Module
« Reply #15 on: July 24, 2015, 05:37:49 pm »
Two potential noise sources I don't see mentioned:

1) The ACS712 output buffer sources 3mA *max*.  When connected to a voltage divider, you're requiring it to source additional current.  Make sure the values of the divider are not so low that you're stressing the output buffer.  (But not so high that it exceeds the maximum recommended input impedance of your ADC, or you'll get errors from the sample-and-hold capacitor failing to charge properly.)

2) Those Ebay ACS712 modules are so cheap, I wonder whether they contain legitimate ACS712's, rather than a clone or factory rejects.  I have a Ebay module, and a ACS712 straight from Allegro (free sample).  I've been meaning to compare the two but haven't gotten around to it yet.  The last clone-vs-real comparison I did (on the nRF24L01+) showed the clone was very poor at rejecting power supply noise.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf