Programmable Logic DesignLine Blog

Apple Sample

Men versus Women: Help required controlling meters!

Clive Maxfield

2/18/2009 2:25 PM EST

I find myself in a bit of a pickle with regard to my "Man-versus-Woman Display-O-Meter" (see blogs #212701651, #212900832, #212901825, #212902580, #212903198, and #213300574).

On the bright side, I'm progressing in leaps-and-bounds when it comes to creating a simple prototype and using my PICAXE microcontroller to read the values on switches and control output devices in the form of LEDs as illustrated below (I'll post a video of this sometime soon):

On the downside, I'm starting to realize just how little I know when it comes to controlling analog devices like meters. Let me explain, and maybe you'll be able to offer some suggestions. Remember that I want to be able to control a variety of analog meters of different shapes and sizes, such as the one shown below:

First of all, I was chatting to my friend Joe in the UK, who suggested the following circuit:

In this simple case, which could be used to control a small meter, we use only 4 control bits (in the case of larger meters I might use 6 or 8 control bits to achieve a higher resolution and smoother output changes). We can assume that these bits come either from the PICAXE controller itself (whose outputs can sink/source up to 20 mA) or from my 74HCT595 shift registers (whose outputs can sink/source up to 35 mA).

The rough idea here is to set things up such that a 1 on the MS control bit will cause around a 50% deflection on the meter; a 1 on the next bit will result in around a 25% deflection, and so forth down to the LS control bit, which provides only a small deflection. When all the control bits are 1, this should equate to a full-scale deflection (the reason I use the "around" qualifier at the beginning of this paragraph is that the response of an analog meter is non-linear).

Now, Douglas (who gave me the meter shown above) told me that its full-scale deflection equated to 50 µA (that's fifty micro-amps). I hadn't really thought much about how small this was until I noticed a wire strapped across the meter's control terminals. My business colleague Alvin says that this wire is intended to act as a shunt resistance. Hmmm, I vaguely remember that the meters we used in the labs back in high school were equipped with shunt resistances ... but that's as far as my knowledge goes.

Furthermore, I'm currently acquiring meters from all over the place, such as a 4-inch-square beauty I just salvaged from some scrap equipment as shown below:

This has no indications whatsoever as to how much current equates to a full-scale deflection. So now I'm in a bit of a quandary, because once again I realize just how little I know about stuff like this, which is why I'm coming to you for advice...

How can I tell whether a meter requires me to use a shunt resistance or not? If it does require a shunt resistance, how do I go about determining the value? Will the circuit shown above work for meters with and without shunt resistances? What procedure should I use to determine what current is required to achieve a full-scale deflection (without blowing the meter up in the process)?

My head hurts... any suggestions would be very gratefully received...

2009 New Year Resolution (Goal: Walk 1000 miles at ~3 miles a day)
[A=Actual, C=Current, P=Plan-to-Date, R=Remaining, T=Total]

Days:  T=365, C=49, R=316
Miles:  T=1000, P=147.00, A=168.06, Δ=+21.06, R=831.94
Note:  Urrggh... it was cold and wet last night...

Questions? Comments? Feel free to email me – Clive "Max" Maxfield – at max@techbites.com). And, of course, if you haven't already done so, don't forget to Sign Up


print

email

rss

Bookmark and Share

Joinpost comment



Comments


EDW

2/19/2009 11:17 AM EST

All meters are basically a spring loaded coil of wire placed in a magnetic field. Input current causes a magnetic force, which balances with the spring force to produce a equilibrium position.

To make it read bigger amps add a low shunt resistance.

To make it read volts add high series resistance.

In your case I think you should not use any shunt resistance (so as to limit the power dissipated by the meter) and only use series resistors. Take the PIC output voltage and apply it to the meter with a 1 meg pot in series (set to max resistance!). Dial the pot down until you get full deflection, then measure the pot with a DMM and put a fixed resistor of this value permanently in series with the meter. You might want to add a fixed resistor to your test setup, say 10k or so, to prevent accidents from happening.

Have you considered using PWM for the meters? Even a simple first order PWM should work fine. This would give you very fine grained control of the meter position and would drastically reduce pin count and external components.

In CPLDs and FPGAs I implement PWM via an up-counter, a comparator, and a register. if the up-counter is less than the register value, make the output high. If it is greater than or equal, make the output low. If the clock into this process is fast enough the meter will act like a low pass filter and display a steady value. To use a slower clock, add a capacitor to the meter. Width (bits) of the counter and register determine the resolution.

For audio you should use at least a second order modulator in order to obtain reasonable clock speeds and low noise floor.

Sign in to Reply


EDW

2/19/2009 11:21 AM EST

Also, you might want to put your LEDs in a XY grid and multiplex them. LEDs are more power efficient when multiplexed, and you would drastically reduce your IO pin count & wiring.

Sign in to Reply


Bob Lindner

2/26/2009 10:20 AM EST

You can use a resistor ladder network much like D to A chips do.

Sign in to Reply


Max the Magnificent

3/5/2009 9:26 AM EST

Thanks for the input -- I agree about the PWM -- and also the way you were talking about doing it (register, counter, comparator) -- in fact I'm going to use a cheap-and-cheerful 50 cent PIC for each meter to implement the PWM -- each of these PICS will be told what to do by my PICAXE ... still fine-tuning the details. Cheers -- Max

Sign in to Reply


Please sign in to post comment

Navigate to related information

Product Parts Search

Enter part number or keyword
PartsSearch

FeedbackForm