need to drive a zero centered meter [SOLVED]

hi, I have a meter which is zero center, which means that the current through the meter at zero is zero, there for I need to switch my pcm around as this meter can go both positive or negative (please see attached photo).
I found a sketch at Inkling

       outputValue = map(sensorValue, 0, 1023, 0, 255);  // scale for analog out
       analogWrite(analogMeterPin, outputValue);         // write the analog out value

but it only goes positive my meter only has two terminals… :roll_eyes:
Thanks
Cris H.

VOR.jpg

You may be able to do what you want with an H-bridge, like for driving motors in forward and reverse.

Or, since meters are not very fast, a relay.

You can do that with two PWM pins connected to the meter terminals.

If you set a LOW on one pin and output PWM on the other, current will flow in one direction. Reverse the pin settings to have the current flow in the other direction. Since LOW is not 0 V, you will probably need to calibrate the PWM settings to get the meter deflection you wish. You may need a resistor in series with the meter to limit the current.

jremington: You can do that with two PWM pins connected to the meter terminals.

If you set a LOW on one pin and output PWM on the other, current will flow in one direction. Reverse the pin settings to have the current flow in the other direction. Since LOW is not 0 V, you will probably need to calibrate the PWM settings to get the meter deflection you wish. You may need a resistor in series with the meter to limit the current.

Ok I'll byte,, ok so I have 2 pcm outputs and you need a ground so "who is on first"?? :cold_sweat: do you mean hook one output to one side of the meter and the other output to the other side???? or do you mean hook both outputs to one side and ground the other??? ~~Cris

phoenixcomm:

jremington:
You can do that with two PWM pins connected to the meter terminals.

If you set a LOW on one pin and output PWM on the other, current will flow in one direction. Reverse the pin settings to have the current flow in the other direction. Since LOW is not 0 V, you will probably need to calibrate the PWM settings to get the meter deflection you wish. You may need a resistor in series with the meter to limit the current.

Ok I’ll byte, ok so I have 2 pcm outputs and you need a ground so “who is on first”?? :cold_sweat:
do you mean hook one output to one side of the meter and the other output to the other side???
or do you mean hook both outputs to one side and ground the other???
~~Cris

No ground needed. Just two pwm pins, one series resistor most likely, wired to the two meter terminals, and some ‘fancy coding’. Things you need to know or find out is what the full scale deflection current rating of the meter is for both directions from ‘center zero’. As in perhaps it’s rated as -1.0 mA to +1.0 mA?

The pin that is LOW acts more or less as ground.

FYI - With an H-Bridge there is no ground to the meter either. If the voltage to the + terminal is lower than the voltage to the - terminal, the meter will go in the negative direction.

If you were to ground the meter's - terminal, the only to get a negative reading on the meter would be to apply a negative voltage to the + terminal. That would require a negative voltage-supply and an additional analog circuit to bias the Arduino's output voltage.