Go Down

### Topic: Powering a battery test meter as part of a prop - best way? (Read 865 times)previous topic - next topic

#### arduinokov

##### Dec 28, 2012, 10:31 pmLast Edit: Dec 28, 2012, 10:51 pm by arduinokov Reason: 1
Hello,

I am new here.   I am building a toy prop for my daughter. Part of it is an old battery tester meter (9V). I am controlling the needle with an Arduino and the code below. The video shows what the code is achieving. Is there an easier way to do this (and to use the full 9V of the batter I am using for power)? I want the needle to go all the way to the top and to be controllable as I want to sync it with 5 LEDs that are lighting up sequentially.

Code: [Select]
`/* Moving a battery test needleThe circuit: * Battery test leads attached to digital pin 9 and ground. */int ledPin = 9;    // + battery test lead connected to digital pin 9void setup()  {  // nothing happens in setup}void loop()  {  // move needle up from min to max in increments of 5 points:  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {    // sets the value (range from 0 to 255):    analogWrite(ledPin, fadeValue);            // wait for 30 milliseconds to see the needle effect        delay(30);                              }  // move needle down from max to min in increments of 5 points:  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) {    // sets the value (range from 0 to 255):    analogWrite(ledPin, fadeValue);            // wait for 30 milliseconds to see the needle effect        delay(30);                              }}`

#### Nick Gammon

#1
##### Dec 29, 2012, 12:05 am
First, don't battery testers put a load on the battery? You might want to measure that, you may be exceeding the output pin current.

Second, to use the full range you would need to output 9V, right? So I imagine some transistor would be required (connected up to, say 12V DC) so that it "amplifies" the output from the Arduino.
Please post technical questions on the forum, not by personal message. Thanks!

http://www.gammon.com.au/electronics

#### PeterH

#2
##### Dec 29, 2012, 12:15 am
The Arduino can only output 5V so there is no way to directly drive the meter to 9V. If you can cope with the complexity of a transistor circuit, you could use the Arduino to turn the transistor on and off (using a PWM control scheme similar to the current one) and use the transistor to switch a 9V supply to the gauge on and off.
I only provide help via the forum - please do not contact me for private consultancy.

#### PaulS

#3
##### Dec 29, 2012, 01:16 am
Quote
First, don't battery testers put a load on the battery?

The tester does. The meter doesn't. It appears that OP is only using the meter.

#### retrolefty

#4
##### Dec 29, 2012, 02:19 am
Here is the deal with most basic dc meter movements. They are current operated devices made to several standard current ranges say 0-50ua, 0-1ma, 0-25ma, etc. What turns such a meter movement into a voltmeter is a series resistor (called a 'multiplier' resistor in meter talk) that limits the maximum meter current to coincide with the maximum applied 'measurement voltage to the series resistor/meter circuit. This is not unlike sizing a resistor for a simple led, but instead of having to know the Vf of the led you need to know the 100% current rating of the meter movement. So if you look around you might find the series resistor for the meter and just change it's value such that 5vdc will drive it to full scale rather then the 9vdc it now requires. Reducing the resistor to approx half what it is should do the trick.

Lefty

#### arduinokov

#5
##### Dec 29, 2012, 03:31 am

The Arduino can only output 5V so there is no way to directly drive the meter to 9V. If you can cope with the complexity of a transistor circuit, you could use the Arduino to turn the transistor on and off (using a PWM control scheme similar to the current one) and use the transistor to switch a 9V supply to the gauge on and off.

Would a TIP120 Darlington Transistor be suitable? And power it with a separate power source? The transistor can then be controlled by using a PWM pin and similar code to what I have been using, correct? Any recommendations for the power source for the Transistor? Am I on the right track?

Thanks

#### arduinokov

#6
##### Dec 29, 2012, 03:36 am

Here is the deal with most basic dc meter movements. They are current operated devices made to several standard current ranges say 0-50ua, 0-1ma, 0-25ma, etc. What turns such a meter movement into a voltmeter is a series resistor (called a 'multiplier' resistor in meter talk) that limits the maximum meter current to coincide with the maximum applied 'measurement voltage to the series resistor/meter circuit. This is not unlike sizing a resistor for a simple led, but instead of having to know the Vf of the led you need to know the 100% current rating of the meter movement. So if you look around you might find the series resistor for the meter and just change it's value such that 5vdc will drive it to full scale rather then the 9vdc it now requires. Reducing the resistor to approx half what it is should do the trick.

Lefty

Thanks so much for your reply. The idea of changing out the resistor seems like the easiest solution to the problem.

#### arduinokov

#7
##### Dec 29, 2012, 06:41 pm
Hi,

Changing the resistor did the trick.  XD

Go Up

Please enter a valid email to subscribe