5

How do you make / connect an Analogue gauge with Arduino?

endolith
  • 28,494
  • 23
  • 117
  • 181
littlebirdceo
  • 4,697
  • 8
  • 41
  • 61
  • Check this link out - pretty good solution. http://www.uchobby.com/index.php/2008/02/12/arduino-analog-gauge/ – JohnC Oct 31 '09 at 18:41

4 Answers4

6

The simplest analog gauge is an ammeter. Connect one end to an analog output pin, the other to the middle pin of a potentiometer, and another pin of the pot to ground. You'll need to tweak the potentiometer to calibrate the range of the output. Make sure that you measure the resistance across the ammeter and don't short out the arduino's output pin. You can use analogWrite() to move the needle.

phooky
  • 1,008
  • 7
  • 12
  • 1
    @littlebirdceo To avoid shorting, could be better to insert a fixed resistor between the lower end of the pot and the ground – clabacchio Feb 03 '12 at 08:26
4

I did this recently with a few gauges I picked up from a friend. I found the best solution was to drive the base of a transistor (BC547, in my case) with PWM from the Arduino. Connect the collector to Vcc (+5, +3.3, etc.), and put a resistor between the positive side of the gauge and the emitter to limit the current to the value that will result in a full swing of the needle (and obviously the negative side of the gauge goes to ground). Then the PWM output of the Arduino will swing the gauge ratiometrically between 0 and 100%.

blalor
  • 2,544
  • 3
  • 22
  • 24
3

Inspired by this question, I wrote the following arduino routine and made the following circuit. Linky... http://www.w1xbs.com/?p=430 This is basically what Blalor said.

alexan_e
  • 11,070
  • 1
  • 28
  • 62
ka1kjz
  • 111
  • 1
  • 2
2

As an alternative to using an ammeter, you can use the cheap automobile instrument stepper motors like the Switec X25.168 or clones from VID and MCR. You can pick up the steppers on eBay for less than $5 each, and drive them directly from the Arduino I/O lines without a controller; without any other components whatsoever. They have enough internal friction to hold their position when the coils are unpowered, which might be useful in some battery-powered systems.

The SwitecX25 driver library is available on github, and the Gaugette blog has spec sheets and more info, including a source for some cheap gauge housings to mount them in.