Go Down

Topic: Need help with analog input for AttoPilot voltage & current sensor (Read 2 times) previous topic - next topic


I'm using this AttoPilot current & voltage sensor:


The sensor has three pins - one is ground, one is voltage, and one is current.  I have the voltage & current pins each going into the arduino on analog ports 0 and 1.  I am setting AnalogReference to internal, so I am sensing @ 1.1v.  The voltage value is coming in -perfectly-.  I am running off a 13.8v AC-DC converter, and it gives me the same results as my multimeter - about 14v.  I have used an automotive fuse tester to test current running through the circuit, and it is saying there is 1.4A running through the sensor.  The sensor should scale 89.4A to 3.3v, so the sensor's current line should be ~52mv.  My multimeter is reading 55mV when I test right from the sensor, but when I test it after about 8 inches of wire it reads about 52mv.  The arduino is sensing a value of about 30, or about 32mv.

Any ideas how I can get the arduino to match up with the readings of my multimeter at the source?  I need to be able to run this sensor about 10 feet away from the arduino, so I picked up a shielded stereo audio cable - will that work or am I going to need something else?

Thanks for any info you can provide!!



You can use that cable.

I wonder how your current is going.
The wires come from the AC-DC converter, and go to the sensor breakout board. From there on they go to the circuit ?

If you use the same AC-DC converter for your Arduino, there could be a ground current through the GND lines to the sensor. That current would influence the reading.
It is even possible that if you connect an computer, there is a current from the +5V to the computer, stealing current from the Arduino.

It would work if everything is seperated. If the load is for example a motor, and the Arduino has its own power supply.


I guess I didn't give much background on the overall setup of what I'm doing... so let me explain :)

I am making a CarPC - it will eventually be running off of batteries in my car, and goes through a DC-DC power supply (called an M4-ATX, it's an automotive PC power supply).  On the bench right now I am using a 15 amp AC-DC power supply plugged into the AttoPilot voltage & current sensor, which is then plugged into the M4-ATX power supply, which powers the computer.  The computer is an Intel Core i5 box, and the arduino is plugged into one of its USB ports.  The 3 pins from the AttoPilot are run directly into the arduino A0, A1, and GND pins.

I suspect that near the PC it is quite a noisy (electrically) environment, and that may be causing some of the issue.  I'm also using regular male-male jumpers and not a shielded cable.

Originally I was having just a hell of a time getting anything useful from the setup, but the issue was that I was using the arduino plugged into my main PC to read the sensors, and the grounds were different (as you said), and it was causing the readings to be all over the place.


If you have doubts about electric noise, you could use the average of a few analogRead(). For example 3 to 20 samples.

If you use USB power, the Arduino gets something between 4.5 and 4.9V. So you should better use the internal voltage reference of the Arduino of 1.1V. I think you use that already, am I right ?

I still think that a ground wire problem could exist.
The current might influence the measurement.
The ground current can also flow via the USB bus, via the Arduino, over the ground wire to the AttoPilot.

So there is still a ground wire problem.
You could make a single ground point, or remove the ground wire from the sensor to the Arduino, or use a electrical seperated current sensing.
That's why those hall-sensors are so easy, they are isolated from the current.
But in a car, there is so much magnetic noise, they would not be reliable.


Yes, I'm already using the 1.1v internal reference.  The current and voltages I am dealing with are significantly less than the 50 volts and 90 amps that the sensor puts out at 3.3v, so scaling down to 1.1v lets me get much finer resolution.

I'll definitely check to see if there is any voltage difference between the ground pin on the sensor and the ground pin on the arduino.  If there is, that definitely means something bad will happen. :)

If that is indeed the case, I'll see if I can just not plug in the ground wire and see what happens, or I will try and narrow down where the ground fault is.  I would expect the incoming ground, M4-ATX ground, PC ground and USB ground to all be connected, but maybe not.

Go Up