Control analog meter with microcontroller

Thread Starter

andy.wpg

Joined Jun 15, 2013
4
I've seen projects where a couple of analog meters are used to display the time. The meter markings are redone and its a cool looking workshop clock.

I have searched and searched here and generally on the internet and can't seem to find anything about how to control the voltage to a panel meter with a microcontroller.

One idea I came up with was to use a digital potentiometer as part of a voltage divider - control the pot and you control the voltage the meter sees.

The other idea I had was using PWM, but I'm not sure how an analog meter would react to, say, a 1Khz pulse slamming it - or whether it would react at all!

Anyone have any ideas on how this is generally done?

Thanks,

Andy
 

THE_RB

Joined Feb 11, 2008
5,438
PWM works fine, just put a resistor (or trimpot) between the digital PWM pin and the meter, so that the meter reads full scale when pwm is 100%. You can also put a cap across the meter, so it is getting smooth DC not pulses.
 

ErnieM

Joined Apr 24, 2011
8,377
I'll do a trimpot
That would be my last choice: trim pots wander. Fixed resistors tend to stay, well, fixed. Just get close, the meter can tolerate a small over voltage so aim close to there.

The closer you get to full scale = 100% PM the better control you have, but leave a few % in your pocket anyway for (if nothing else) power supply tolerance.

What are we talking here? .1uf ceramic? Or an electrolytic of a few uf or so?
Small. I'd use zero and let the mechanical inertial of the meter do the averaging. That means finding a PWM rate high enough to be imperceptible. Otherwise a cap may slow the response as it has to charge and discharge to approach new settings.
 

THE_RB

Joined Feb 11, 2008
5,438
I would use a fixed resistor and a trimpot, if you are looking for the best of all options. The fixed resistor makes up maybe 90% of the resistance and the trimpot makes the last 10% of the series resistance when it is turned near the middle. That gives ease of calibration (less sensitivity).

I disagree with ErnieM's point about trimpots having low reliability. A decent brand trimpot that has not been abused should be very reliable. I prefer the plastic box type, not the cheap open frame type.

Re the cap there's no reason not to use a largish value cap of at least a couple of uF. Assuming a series resistor of a few thousand ohms the time constant is still quite short, in the order of a handful of mS to go from 0 to 100%.

But the cap will still smooth the PWM current pulses to a smooth average DC current, much better for a delicate moving coil meter.
 
Top