Current sensor for Arduino

KeithWalker

Joined Jul 10, 2017
3,607
I am a professional electronic measurement specialist. I can't make valid suggestions without enough information.
We still have no idea what your "UUT" is so we have no idea how any of the different measurement techniques would affect its operation.
 

KeithWalker

Joined Jul 10, 2017
3,607
I have searched the Arduino specs but I can't find any information on the accuracy or linearity but it is probably far better than what is needed in your case to give 0.5% accuracy. An Arduino A/D with a 5V reference gives a reading of 1024 for a 5VDC input. The software can re-scale that to 1000 to keep things simple. That gives a resolution of 5mV per digit.
A maximum input of 2V will give a reading of 400 with a resolution of 0.5%.
A series measurement resistor with a value of 1 KOhms, for a current of 0 - 2 mA will give a reading of 0 - 400 which is equivalent to 0 - 2V with a resolution of 0.5%.
If your DUT can tolerate a series measurement resistor of 1K in the power supply, then you can make the measurement directly using the Arduino without any amplification.
 

Thread Starter

ChipCircuit

Joined May 1, 2023
74
I have searched the Arduino specs but I can't find any information on the accuracy or linearity but it is probably far better than what is needed in your case to give 0.5% accuracy. An Arduino A/D with a 5V reference gives a reading of 1024 for a 5VDC input. The software can re-scale that to 1000 to keep things simple. That gives a resolution of 5mV per digit.
A maximum input of 2V will give a reading of 400 with a resolution of 0.5%.
A series measurement resistor with a value of 1 KOhms, for a current of 0 - 2 mA will give a reading of 0 - 400 which is equivalent to 0 - 2V with a resolution of 0.5%.
If your DUT can tolerate a series measurement resistor of 1K in the power supply, then you can make the measurement directly using the Arduino without any amplification.
Much appreciated your help.
The UUT is an oscillator board, operating with supply voltage 5VDC to 12VDC and typical current consumption is 10mA Max.
 

Reloadron

Joined Jan 15, 2015
7,891
An Arduino A/D with a 5V reference gives a reading of 1024 for a 5VDC input.
Not that it matters much but using an Arduino UNO Rev 3 for example and a 5.0 volt A/D reference the resolution will be 4.88 mV per bit. With any 10 bit ADC you will not see 1024 as a count. While 10 bits (2 ^ 10) is 1024 you will not see anything above 1023 since 0000 through 1023 is in fact 1024 counts.

Next there are some slick ADC chips available for use with an Arduino which could be used in lieu of an operational amplifier. One such chip is the ADS1115 which is actually a 16 bit ADC but since one bit is used for sign it's actually a 15 bit ADC and it has programmable gain as well as allowing either 4 single ended or 2 differential inputs. The PGA offers input ranges from±256mV to ±6.144V, allowing precise large-and small-signal measurements. using ads.setGain(GAIN_SIXTEEN); +/- 0.256V 1 bit = 0.125mV (125 uV). The output is I2C so it is capable of being used with about any Arduino. A complete module board can be had for under $5.00 USD. The differential inputs make for nice low level voltage measurements. A simple Google of "ads1115 Arduino" will bring up a dozen hits including code samples. The I2C interface is great to work with. While max speed is only about 800 samples / sec. it is fast enough for measuring current using a shunt. Considering cost I would start with trying an ADS1115.

Ron
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,891
Then you can use a 500 Ohm measurement series resistor. 10 mA will give a count of 200 with 0.5% resolution.
500 ohms @ 10 mA will result in a 5 volt drop across the shunt. That is 5 volts the load will never see. Shunt resistors are typically less than 1.0 Ohm. If I apply 12 volts to my load and place a 500 Ohm shunt in my current path with my load drawing 10 mA my load will only see 12volts - 5volts = 7 volts. That what we want?

Ron
 

KeithWalker

Joined Jul 10, 2017
3,607
500 ohms @ 10 mA will result in a 5 volt drop across the shunt. That is 5 volts the load will never see. Shunt resistors are typically less than 1.0 Ohm. If I apply 12 volts to my load and place a 500 Ohm shunt in my current path with my load drawing 10 mA my load will only see 12volts - 5volts = 7 volts. That what we want?

Ron
My mistake. I meant 200 Ohms, not 500.
I know that series measurement resistors are usually 1 Ohm or less, but they can be much higher if there is sufficient supply voltage, and in this case, there may be. There will probably a need for extra capacitive decoupling across the UUT in this case.
The TS did not state what the actual voltage is across the UUT. He just mentioned that his supply is 5 - 12V. That is why I asked for more information.
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,891
Long as you can meet any compliance voltage then by all means a shunt can be a larger resistance. We just need to know that everything we take from Peter we can't give to Paul. :)

Another trick used with an Arduino other than an external ADC reference is the internal reference. Normally by default an Arduino ADC is the Vcc you are powering it with. However an Arduino UNO Rev 3 for example allows use of a 1.1 Volt internal Vref. You just call it out in your code during Setup. That gets you from 4.88 mV per step change down to 1.1 / 1024 = 1.074 mV per step or quantization level.

There is likely a dozen ways to get where the thread starter wants to go. :)

Ron
 

Reloadron

Joined Jan 15, 2015
7,891
That should work for you. Long as you are good with the price. Nice feature with transducers like this is the output normally 4 ~ 20 mA or like this unit 0.0 to 5.0 VDC proportional to 0 to 10 mA. Let that feed your uC (Arduino) and make a divider and have the uC measure your voltage. Long as you are good with the cost.

Ron
 
Top