1

Is it safe to measure current like this as long as measured voltage drop don't exceed 5V? I'm asking this because in almost all current sense circuits they used an opamp in their design.

Do I need a resistor between shunt resistor and ADC? Is there any noticeable current flowing to Arduino ADC that can damage it?

schematic

simulate this circuit – Schematic created using CircuitLab

7
  • 2
    Where do you connect the Arduino ground? Oct 17 '19 at 7:57
  • @EdgarBonet common ground. Oct 17 '19 at 8:29
  • 1
    You need to measure at the other side of the sense-resistor. Otherwise you'd always measure 0 Volts. The reason a lot of designs use an opamp, is so they can keep the sense-resistor as low as possible. Higher value sense-resistors will create higher voltage drops, resulting in a lower voltage supplied to the load.
    – Gerben
    Oct 17 '19 at 9:10
  • @Gerben Thanks, corrected the schematic. Oct 17 '19 at 9:30
  • You should show (and connect) power source - to Arduino GND. Normally, scematics are clearer when GND is at the bottom. Oct 17 '19 at 9:42
1

Let's imagine that you expect to have 1A of current going through your circuit. Resistor of 0.1 Ohm will give you a voltage drop of 0.1V. This causes two problems.

Firstly Arduino has a cheap ADC builtin. It's supposed to be easy to use, but not really precise. It has nonlinearities towards lower and higher range. You will get more precise reading when measuring voltages around 2.5V.

Secondly The precision of your measurement is cut by factor of 50. Arduino contains ADC that has resolution of 10 bits. This means that there are only 20 steps between 0V and 0.1V That's not really precise.

Solution? Use an opamp as "differential amplifier". If you multiply the voltage difference by 25 you will get 2.5V on the amplifier output when the resistor has 0.1V of drop on it. This value is much more precise when reading it by analogRead of the Arduino, and even a tiny change in voltage on the resistor will give you 25 times larger change on the amplifier output. This way it's much more precise and accurate.

5
  • I did dig into opamp "realm" and honestly a good opamp for sensing current is expensive, I was thinking to use Arduino and if i needed more accuracy i could use a 12bit ADC or increase the shunt resistor value a bit... but the question is; is it safe to connect shunt resistor directly to Arduino ADC or not. Oct 17 '19 at 8:37
  • 1
    This answer is true but not complete. You can use the internal 1.1V reference voltage for your ADC. So 0.1V would correspond to around 90 steps between it an 0V. So you can get usable but not great results with the built in approach. The diff-Amp is definitively the way to go.
    – Kwasmich
    Oct 17 '19 at 8:41
  • @newbie I recently successfully used LM358 to boost the voltage 20 times for my battery charger feedback. They literally cost 6 cents each with free delivery from China. Just keep output in the "middle" of the voltage (2.5V) Oct 17 '19 at 8:46
  • @FilipFranik it is possible and I even purchased some LMC6482 which is way more superior to LM358 but it can't go all the way down to ground rail 0V, minimum in my case was 9mv (maximum 20mV!) which means it can't measure small voltage drops (5mV for example) on a 0.1 ohm resistor. beside you need four 1% resistors which should match two by two... it gets complicated... I want to measure current simply with Arduino. Oct 17 '19 at 8:52
  • 1
    @newbie The real power of Arduino is that you can use cheap hardware, but compensate for imprecise resistor values and hardware nonlinearities inside the software. If you want to go for precision just build the circuit, connect (expensive) ampmeter to it, and measure what ADC shows for each amperage. Then use linear interpolation algorithm to get precise values between measurements. You will get more precision then you need this way. Oct 17 '19 at 9:01
1

There's a bad current flowing into your Arduino, if ADC voltage exceeds Vcc (5V). This undesired current can be limited by a resistor. But if there's such a high voltage across a shunt resistor, something else is wrong. You rather suffer from a too small voltage for useful measurement.

My first doubt is rather, whether it's safe for the shunt resistor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.