I have also played with one of these hall current sensors, and been similarly disappointed with the precision when measuring low currents. There is always making a shunt with a thick piece of Nichrome Wire, then using an opamp to boost the voltage.
When I get a chance I am going to take another look at it And see if there’s a way to improve it with a better ADC precision. I seem to have run out of Bench Work space again so that might get in the way. I’m already working on an electronic DC load experiment that I don’t want to have to tear back down to make room.
I don't know if it can do the equation, but maybe a 1 in 1 out averaging table might be better. That's how I did my digital manometer on my flowbench, which jitters a lot on the physical side.
I'm lost with your use of pins 2 and 3. How are you connecting these to switch the modes. Or are you connecting a jumper wire to change the levels? I missed in the video where you explained how you were doing this.
looking in the Arduino sketch pin 2 changes between reading DC or AC and pin 3 is used to calibrate the sensor depending if the inputs are set high or low so I’m just using a jumper wire between VCC and ground when I want to change a mode. each time the sketch goes through the main loop it will read the inputs and decide if it’s calibrating or reading AC or reading DC current.
the readings are jumping, because you are using it with only USB, whose voltage are know to jump around 4.8>5 volts and cause noise, there fore your voltage formula is always wrong, SOLUTION: power it with extrnal supply, that way regulator will output nice and smooth DC, meassure it and than put that in formula, its often not accurate 5 but 4.9ish max time.
An air/fuel ratio sensor on an automobile has a current output. Zero current is ideal air to fuel mixture. A positive current is rich and lean mixture is negative current. Would this sensor family measure plus/minus currents of 50 milliamps considering the frequency of swings is very slow.
my experience with this family has been that for lower currents, I don’t find it very precise. I have much better results with the INA219. ua-cam.com/video/FXQoZbvM3Kw/v-deo.html
Sir i keep having the error 'ACS712_30A' was not declared in this scope, I manually installed a zip library of acs712 and used #include . what could be the problem? thanks in advance
@@angry_moose94 I have the same problem as him. Can you try this on your own and see if there is anything wrong with the library? Your help is highly appreciated. I cannot solve this problem as well.
can the current sensor handle a large amount of current? what will happen to the current sensor if there will be an overcurrent (example: short circuit)? And how will it affect the MCU?
This sensor is available in three different options with a maximum current measurement of 5, 20, or 30 A. The load current path is electrically isolated from the rest of the chip similar to an optocoupler so the MCU should be safe within reason. The datasheet says it can tolerate 100 A of overcurrent for up to 100 ms duration. I don’t see any information about what happens for lower over current conditions but I would make sure there’s external overcurrent protection or fusing to protect against that.
I don't have pictures and can't remember now that it's almost been 2 years but I think the transformer belonged to something I still needed so I would have either plugged it into a jack and clipped onto the leads or wrapped wire around the barrel and stuffed wire in the end and taped it to hold. I remember everything was falling off the edge of the table and I couldn't get everything in the shot.
The circuit used is the same from the link in the description for the library as well as what is showing on screen in the video. The capacitor is a 470 nF polyester (also known as trademark name Mylar) type.
Are you sure the resolution of the ADC is sufficient? It looks like your noise could be attributed to the lower 2 bits being inprecise. (Did not do the math though)
It’s possible more resolution would make it even better, I believe it’s 0.185 mV/mA on the sensor so if every step of this ADC is about 4.88 mV then that could be improved upon, but I wanted to see what I could achieve with a cheap Arduino. Adding the filter capacitor seemed to help. I can’t remember if I ordered a 12 bit ADC to play with. Maybe I will revisit.
I can't think of one off hand but generally what I find is I would need a different sensor to handle different ranges, so if one can measure up to 5 amps within just a few volts of output signal, I won't expect it to be able to get precision results on lower currents. I am thinking about looking into a product like uCurrent Gold, or the Current Ranger, which will also give a voltage output signal, but can do various input current ranges accurately.
Bought one of these and the output goes lower than the 2.5v idle when current is detected? (Mine does). Thought it would have added to the output -- guess not. Confirm anyone?
I believe it goes higher or lower than the centerpoint based on if the current direction is positive or negative so you could try reversing the wires on the sensor
@@GadgetReboot I am getting alternating positive and negative values. I'm measuring AC by the way. It's the same when I reverse the polarity. I'm using the USB port as power for my Nano.
It’s strange to get negative readings on ac, trying to think of any little things, was a calibration performed while there is no current flowing? The library could get negative numbers by trying to subtract the wrong offset maybe. And is it a sinusoidal AC with the correct frequency specified for the AC measurement? Is the current reading looking accurate otherwise, just the polarity being weird? And is the actual current that low, around 50 mA, and which version of the sensor are you using? I remember it wasn’t really performing great for me at low current, sometimes my error was even 50 mA, and if using a sensor greater than 5 A, it may be even more jumpy because it has less room to represent the measured current in the output so any noise would more greatly distort the reading.
The general method I have seen for this sensor is to take baseline readings with no current through the sensor and if there is an offset, consider that offset as zero in software and then use the data sheet equations to calculate current while factoring in the offset zero reading.
@@GadgetReboot bro how to save the calibrated settings when i restart the program? when i restart it the values are again uncalibrated, please help me if you can
Hello. Can you help me with this error of 'ACS712_05B' not being declared in the scope"? I keep seeing this error even if I already imported the .zip library files. Hoping for your response. Thank you
I have also played with one of these hall current sensors, and been similarly disappointed with the precision when measuring low currents. There is always making a shunt with a thick piece of Nichrome Wire, then using an opamp to boost the voltage.
When I get a chance I am going to take another look at it And see if there’s a way to improve it with a better ADC precision. I seem to have run out of Bench Work space again so that might get in the way. I’m already working on an electronic DC load experiment that I don’t want to have to tear back down to make room.
Thank you for your research. I just bought some of these boards and this is going to really me out.
I don't know if it can do the equation, but maybe a 1 in 1 out averaging table might be better. That's how I did my digital manometer on my flowbench, which jitters a lot on the physical side.
I'm lost with your use of pins 2 and 3. How are you connecting these to switch the modes. Or are you connecting a jumper wire to change the levels? I missed in the video where you explained how you were doing this.
looking in the Arduino sketch pin 2 changes between reading DC or AC and pin 3 is used to calibrate the sensor depending if the inputs are set high or low so I’m just using a jumper wire between VCC and ground when I want to change a mode. each time the sketch goes through the main loop it will read the inputs and decide if it’s calibrating or reading AC or reading DC current.
the readings are jumping, because you are using it with only USB, whose voltage are know to jump around 4.8>5 volts and cause noise, there fore your voltage formula is always wrong,
SOLUTION: power it with extrnal supply, that way regulator will output nice and smooth DC, meassure it and than put that in formula, its often not accurate 5 but 4.9ish max time.
An air/fuel ratio sensor on an automobile has a current output. Zero current is ideal air to fuel mixture. A positive current is rich and lean mixture is negative current. Would this sensor family measure plus/minus currents of 50 milliamps considering the frequency of swings is very slow.
my experience with this family has been that for lower currents, I don’t find it very precise. I have much better results with the INA219. ua-cam.com/video/FXQoZbvM3Kw/v-deo.html
Sir i keep having the error 'ACS712_30A' was not declared in this scope, I manually installed a zip library of acs712 and used #include . what could be the problem? thanks in advance
you are not using the correct library. Download it from the link he provided.
@@angry_moose94 I have the same problem as him. Can you try this on your own and see if there is anything wrong with the library? Your help is highly appreciated. I cannot solve this problem as well.
can the current sensor handle a large amount of current? what will happen to the current sensor if there will be an overcurrent (example: short circuit)? And how will it affect the MCU?
This sensor is available in three different options with a maximum current measurement of 5, 20, or 30 A.
The load current path is electrically isolated from the rest of the chip similar to an optocoupler so the MCU should be safe within reason.
The datasheet says it can tolerate 100 A of overcurrent for up to 100 ms duration. I don’t see any information about what happens for lower over current conditions but I would make sure there’s external overcurrent protection or fusing to protect against that.
Thanks for this! Do you have pictures of the transformer setup? Did you have to strip the wires?
I don't have pictures and can't remember now that it's almost been 2 years but I think the transformer belonged to something I still needed so I would have either plugged it into a jack and clipped onto the leads or wrapped wire around the barrel and stuffed wire in the end and taped it to hold. I remember everything was falling off the edge of the table and I couldn't get everything in the shot.
@@GadgetReboot thanks!
very clear explaination
Hello, your code works great! But what if I want to use multiple ACS712 current sensor? How can I integrate those into the code?
can you tell me the installation circuit on Arduino and what type of capacitor is used
The circuit used is the same from the link in the description for the library as well as what is showing on screen in the video. The capacitor is a 470 nF polyester (also known as trademark name Mylar) type.
Are you sure the resolution of the ADC is sufficient? It looks like your noise could be attributed to the lower 2 bits being inprecise. (Did not do the math though)
It’s possible more resolution would make it even better, I believe it’s 0.185 mV/mA on the sensor so if every step of this ADC is about 4.88 mV then that could be improved upon, but I wanted to see what I could achieve with a cheap Arduino. Adding the filter capacitor seemed to help. I can’t remember if I ordered a 12 bit ADC to play with. Maybe I will revisit.
these hall effect sensors are so super noisy. try placing them inside an iron can for magnetic shielding, and see what happens.
@@BlondieHappyGuy great job. 👍 keep it up.
can you suggest any good current sensor for precise measurement
I can't think of one off hand but generally what I find is I would need a different sensor to handle different ranges, so if one can measure up to 5 amps within just a few volts of output signal, I won't expect it to be able to get precision results on lower currents. I am thinking about looking into a product like uCurrent Gold, or the Current Ranger, which will also give a voltage output signal, but can do various input current ranges accurately.
Useful video 👍
Thanks allot made you help to accelerate my project a bit thanks! :-)
Bought one of these and the output goes lower than the 2.5v idle when current is detected? (Mine does). Thought it would have added to the output -- guess not. Confirm anyone?
I believe it goes higher or lower than the centerpoint based on if the current direction is positive or negative so you could try reversing the wires on the sensor
@@GadgetReboot Yeah ! Discovered that after posting. The right hand rule, right? -- thanks they should include documentation with these.
Why do I get negative readings on my Arduino Nano? I'm getting values like -0.053
What happens if you reverse the wires to the sensor? It measures current flow in both directions and has a polarity.
@@GadgetReboot I am getting alternating positive and negative values. I'm measuring AC by the way. It's the same when I reverse the polarity. I'm using the USB port as power for my Nano.
It’s strange to get negative readings on ac, trying to think of any little things, was a calibration performed while there is no current flowing? The library could get negative numbers by trying to subtract the wrong offset maybe.
And is it a sinusoidal AC with the correct frequency specified for the AC measurement?
Is the current reading looking accurate otherwise, just the polarity being weird? And is the actual current that low, around 50 mA, and which version of the sensor are you using? I remember it wasn’t really performing great for me at low current, sometimes my error was even 50 mA, and if using a sensor greater than 5 A, it may be even more jumpy because it has less room to represent the measured current in the output so any noise would more greatly distort the reading.
Same, i also get negative readings on my Arduino Uno. The values kinda -0,47 ish
Hey sir how to calibrate the sensor?
The general method I have seen for this sensor is to take baseline readings with no current through the sensor and if there is an offset, consider that offset as zero in software and then use the data sheet equations to calculate current while factoring in the offset zero reading.
@@GadgetReboot bro how to save the calibrated settings when i restart the program? when i restart it the values are again uncalibrated, please help me if you can
Thank you very Much It works good :) ..... The best code :)
Hello. Can you help me with this error of 'ACS712_05B' not being declared in the scope"? I keep seeing this error even if I already imported the .zip library files. Hoping for your response. Thank you