Increasing voltage maximum value from 10 mv to 5v

Since Arduino usually does not have specific ports for measuring currents,a dc current can be indirectly measured by a Arduino’s ADC channel by converting the current into voltage by placeing a resistance in series with the current path and measure the voltage drop across it. My current range is from 0A to 10A , I have chosen 0,02ohm as a shunt resistance so my voltage will be in the range of 0 to 10mV.However, I need to increase this range to a maximum 5V to be measured by the microcontroller How can I do that or is there any other easier way?

If you use the internal reference you already gain resolution.

But yeay, you can amplify the signal. But 10mV to 1V is a factor 100. You already have to deal with things like noise, drift etc... So there is kind of a default circuit for it (Google op amp non-inverting) but which op amp to use... There are thousands... Al with different specs and prices.

It might be easier to just buy a current sense module.
Google "Arduino ACS712 hall current sensor".

This high-side resistive sensor does voltage and current with 12-bit resolution.

Add your own external shunt for increased current capability.
Leo..

But this Arduino ACS712 hall current sensor is up to 3.2 Amps and my range is 10 Amps

ACS712 boards come in different currents. 10A, 20A, 30A.
The Adafruit INA219 is standard +/- 3.2Amp.
As said, adding and external shunt increases the measuring range to whatever you want.
A 0.1ohm shunt is on the board (R100).
Add another 0.1ohm to the screw terminal, and the range is +/- 6.2Amp.
Add your 0.02ohm shunt, and the range is +/- 19.2Amp
Leo..

Okay , I have found both on ebay and it needs from 12 to 37 days to be delivered since I am living in Germany.
I cant wait that long..... :frowning:

Yeay, all of a sudden we got time restrictions...

If you can't wait that long you can order the ACS712 or INA219 chip at Farnell or TME or whatever. Probably for double the piece but he, you want it quick :wink: It's cheap or quick, choose one :wink:

Then you also need a board and external components.

10A 10mV STROM-SHUNT (germany)

Oh yeah , I have order the module for triple the price :smiley: it is okay as long as I will get it tomorrow.
I have another problem of choosing the resistance for my voltage divider
The input voltage range is 60V and the output should be 5V, I choose R1=11kohms, R2=1kohms.
and for both resistance the tolerance is 1%, 0.6 W ,and the temperature coefficient is 50 PPm
Will be my measurement accurate as I need accurate voltage measurement for my arduino input.
Please help me to decide :confused:

dOZf7.png

khoulod892:
I have another problem of choosing the resistance for my voltage divider
The input voltage range is 60V and the output should be 5V, I choose R1=11kohms, R2=1kohms.

Those low values can be dangerous for the Arduino.
When the Arduino is off, and you have 60volt on the divider, 4.5mA could be flowing into the analogue pin.

You could use 10k: 110k.
And a 100n cap from input to ground.

I would probably use 1.8k:100k, a 100n cap from input to ground, and the stable internal 1.1volt Aref.
Leo..

okay , What about the tolerance ,wattage and the temperature coefficient how can I choose this values

Just standard 1% 1/4watt metal film resistors. Tolerance is not important.
Aref won't be exactly 1.1volt (every board is different), so you have to calibrate with your code anyway.

So you understand that 1k8:100k brings 60volt down to ~1.06volt. Not to 5volt.
In your code you have to call the 1.1volt Aref.
file:///C:/Program%20Files%20%28x86%29/Arduino/reference/arduino.cc/en/Reference/AnalogReference.html
Leo..

Wawa, can you explain? In my opinion it does not matter if the Arduino is on or off... Voltage divider is voltage divider....

But, yeah, I would use a higher value as well to reduced the load. But then again 12k @ 60V is just 5mA.

Tolerance is in percentage. So it does not matter if you make a voltage divider with 11k : 1k or 110k : 10k. Difference in percentage is the same.

Because of the lower current in the resistors with higher values the power dissepation is less. With 110k and 10k it is 30mW in both resistors combined. So every resistor is just fine.

En temperature coefficient, uhm, you make the design, you make the rules. We have no idea what you want and what you can tolerate. So yeay, define that and make calculations. But probably every resistor will be fine as long as you don't try to send a rocket to the moon... Because hé, the ADC is only 10-bit...

I will use 10K and 110K with 100nF for the time being

And I am using Arduino Uno , I think the reference voltage is 5 V or ????

why I should add 100nF by the way

To make it more stable.

And have you read the link? Probably not because there it says you can change the reference :wink:

Stable readings.
The 100n cap gives the A/D a more "solid" source to sample from.
Call it a decoupling cap if you wish.

Yes, the Uno has a stable ~1.1volt Aref.
You just have to add analogReference(INTERNAL); in your setup.
Read the Aref link.
Leo..

@septillon

septillion:
Wawa, can you explain? In my opinion it does not matter if the Arduino is on or off... Voltage divider is voltage divider....

Simple example without accurate calculations:
Take a 10k:10k divider to measure a 9volt battery.
4.5volt on the tap = <5volt, so no current into the analogue pin.

Turn the Arduino off.
Analogue pin (resistor tap) is 0volt, but battery is still there.
Current is now 9volt/10k = 0.9mA into the pin, trying to phantom power the Arduino.

septillion:
But then again 12k @ 60V is just 5mA.

<=1mA is said (not in the datasheet) to be safe...

septillion:
Tolerance is in percentage. So it does not matter if you make a voltage divider with 11k : 1k or 110k : 10k.

Tolerance of the 1.1volt Aref is 10%, so you have to calibrate (with your code) anyway.
Just pick the resistor ratio so that almost the whole range of the A/D is used.
Leo..

You're right the 60V can phantom the Arduino. But a powered down Arduino does not pull the Vcc line to GND. It's just floating. But yeay, because of the rest that's connected to the Arduino it's not a good idea to phantom power the Arduino trough the analog pin :slight_smile:

When the Arduino is off, and you have 60volt on the divider, 4.5mA could be flowing into the analogue pin.

This is pure nonsense that could only come from someone with very little electronics experience.
I don't believe the arduino analog pin is going to have 4.5 mA flowing into it power on or off.
Put an ameter in series with your battery and connect ONLY the analog pin to the voltage divider output and the ground to the battery ground and measure the current drawn by nothing but the analog pin.

Vo = Vi * R2/(R1+R2)
Let Vi = 60V
Let R2 (from Ground to analog input pin) = 1k
Let R1 (from 60V to analog input pin) = 12k

Vo = Vi * R2/(R1+R2)
= 60V *1000/(12000+1000) = 60V * 0.07692 = 4.6153~ 4.6 V (on analog input pin)

I = Vi/Rtotal = 60V /1000 ohms = 0.06 A (60 mA through voltage divider)
Let Ranalog input pin = 100 Mohms
Ianalog input pin = Vanalog input pin /Ranalog input pin
= 4.6 V/100 Mohms
= 0.000000046 A ~ 46nA

First of all , the analog input is a high impedance input with about 100 Mohm input resistance.
Second, if you read the ATmega328 datasheet, the graph shows the ADC input current is about 170uA. (or is it nA ?)
As long as the input voltage does not exceed the maximum for the ADC reference configured, there is NO problem. Current is the result of a load. How much current is going to flow when you calculate the divider with 100 Mohm resistor as the load for the divider ?

OP,
If you can get this in your country, it has 16 bit resolution and programmable gain.