best way to make a digital ammeter with arduino


i am looking at building a digital ammeter that will read a max of 10A and will read milli amps to 3 decimal places

any help with the circuit and code would be very gratefull

You might try using a hall-effect sensor as a decoupling device since the arduino can't handle anything close to amps. The hall effect chip will put out a voltage that you can detect using the analog in and then calibrate to figure out what the current is.

One way to use them to measure current is to measure the voltage drop across a known resistor in series with the circuit under test. Pick a resistor that will drop 5V at 10A. I think you are saying you want to measure 10A in microamps (thousandth of a milliamp). That's a 10,000,000 microamp range or eight decimal places. That will require a 24-bit D/A converter.

I think as this is a rather strange question, that perhaps you should explain why you have a requirement to measure current with an accuracy of 1 micro amp, over a 10A range.

This sort of accuracy is not normally required by most domestic or commercial systems. It sounds more like something that would be required for some sort of research establishment e.g. CERN.

There is not enough info, after all we don't know if multiple ranges are involved, i.e., he doesn't need 10 A and .001 milliamps at the same time.

I wonder if the OP will actually reply. It sounds like one of the normal ridiculous questions, often posted by companies who have taken on work they have no experience in.

Arduino Library for M9803R Mastech Multimeter data logging

Let Arduino Yun Measure/Datalog DCV/ACV/DCA/ACA/R/CAP/Freq/Temperature

Auto Range is the key.


I need to add the ammeter into a test rig for my car alarm. I want to see what the drain is in milliamps when it is armed which should be around 16 milliamps and what it is when it is disarmed around 25 milliamps.

But if i operate the central locking it can go up to about 7 amps.

Thats why i need it to read from 10 amps to 1 milliamp



So you don't need it to actually read the current when the alarm takes 7Amps

You just need something that can read up to 50mA, that has over current protection.

Also, i cant see why you require resolution to milli Amps to 3 decimal places, e.g. 16.179mA.

Is this some form of tamper detection, or are you just trying to measure the current so you can reduce it ?

i need it to be very accurate at low range but at high range can been accurate to 100 milliamps.

at the min i keep using my multimeter but it only shows 0.00 amps and i need 0.000 amps

You could build a dual range meter. Thats what most commercial multimeters do, they "auto range"

Old analog meters (I still have one as they are handy for some things), normally have a rotary switch to select the range. e.g mine has 4 ranges starting at 0.05mA and going up to 250mA (full scale)

You could use an analog mux chip to do the autorange switching for you.

I think however the main problem is that to measure to measure the lower range up to (for example) 50mA , the Arduino ADC has 10 bit resolution, (1024 discrete values), you'd only measure to an accuracy of

50mA / 1024 = approx 50 uA, and you want 50 times this accuracy, so you'd need something like a 16Bit ADC, i.e you'd need to use an external ADC.

The other issue is that the Arduino ADC measures over a range of 0 to 5V, so you'd need to convert a 50mA current to 5V

To do this with a resistor wont work, as by ohms law v = i * r

r = v / i

r = 5/ 0.05

r = 100

But obviously you cant put a 100 ohm resistor in series with the load.

Normally the values used for ballast resistor are fractions of an ohm e.g perhaps 0.01 ohm or less

otherwise when you draw 10A the power dissipated in the resistor is massive and also the voltage drop is unacceptable

So assuming you get a 0.01 ohm resistor, which would drop 0.1V when loaded with 10 A

then your 50mA would only produce v= 0.05 x 0.01 = 500uV

i.e 500 micro volts.

You'd need to amplify that signal to 5V, i.e you'd need an amplifier with a gain of 10,000

Now although you can do this, using an OpAmp, the problem is that the whole system becomes very very sensitive to noise, and cars produce a lot of electrical noise.

Also, getting the OpAmp to be linear over the whole range is going to be challenging.


You have not explained why you want to do this in the first place.

Why do you need to measure the current all the time in both the standyby and energizing states.

Why not just stick a multimeter in line with the circuit when its in standby and measure the current, then switch the meter to a high range, e.g. 10A and measure that current.

at the min i keep using my multimeter but it only shows 0.00 amps and i need 0.000 amps

Not sure what part an arduino would play in your project considering the type of precision equipment that probably will be needed and the $$$ involved.

at the min i keep using my multimeter but it only shows 0.00 amps and i need 0.000 amps

Sounds like you need a better meter. Even if you build a circuit to measure such small currents, how are you going to calibrate it if your meter doesn't go that low?

Step 1: get a better meter
Step 2: build a circuit to measure small currents
Step 3: calibrate your circuit by comparing it to your meter readings
Step 4: use your circuit to measure the currents

Of course, by the time you complete step 1, you might be done since your better meter will take the measurements you need?

Another option, since you just need to increase your meter's sensitivity by a factor of ten, is to use a pair of precision resistors in parallel, such that the current going through the smaller resistance is 10 times the current going through the bigger resistance. Put your ammeter in series with the larger resistor (smaller current) then multiply the reading by the current divider's actual ratio. Current Divider Circuits

I started building a Ammeter which is connected to a dashboard running inside my machine.
It works well.
See: Building a Connected Ammeter with Arduino

Unlike your case, I wanted measure uA values. So, then I had to deal with some issues.