Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Output 0-20mA from an Arduino with ATMega328

  1. Mar 12, 2012 #1
    Hi! I am using a Arduino Duemilanove with ATMEga328 for my project.

    I need an input of 0-20mA into a speed indicator. I know that the Ardunio pins have a current output of 0-40 mA and was wondering if I could use one of the pics to input 0-20mA into the speed indicator. I know that directly connecting the pin will give me 0-5V so I need some external hardware. Right? However, I have no clue how to do this. Can someone please help ? The current has to be variable from 0mA (or close to 0) to 20mA.
  2. jcsd
  3. Mar 12, 2012 #2
    how are current, and voltage related?
    how do series/parallel circuits affect current?
  4. Mar 12, 2012 #3
    This will depend on how accurate you want the output - but a relatively low tech system should work. What is the input impedance of the speed indicator?
    Since it takes a current input it should be pretty low, so possibly just by adding a resistor ( to limit the current ) and if the Speed Indicators input impedance is constant over the range of 1 -20 mA input you should be able to directly output the 0-5V Output to the Indicator.
    Drive 1mA,10mA and 20mA current into the Indicator and measure the voltage needed to back calculate the impedance.
    The sum of the added resistor and Indicator should come to 250 Ohms total. ( I'll bet just using a 270 Ohm Resistor will do the trick out of the box - this will limit the current to below 20mA- if you can compensate the difference in the program.)
  5. Mar 13, 2012 #4
    Thanx!!! :)
  6. Mar 13, 2012 #5


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    More info on you speed indicator would be nice. Is it 0-20ma or 4-20ma?
  7. Mar 13, 2012 #6
    4-20 mA is acceptable - since it is the industry standard.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook