4 digit Auto-ranging Voltmeter

Discussion in 'The Projects Forum' started by vortexmc, Sep 24, 2008.

  1. vortexmc

    vortexmc Thread Starter New Member

    Joined:
    Sep 24, 2008
    Messages:
    3
    Hi everyone, this is a new project that i have undertaken, and i was hoping too get some advice on how to accomplish this.The project requires the construction of an auto-ranging volt meter that can measure positive DC voltages in the ranges 0v-1v, 0v-100mv and 0v-10mv. The display should 4 digits up to a maximum value of 1.000 volts. There should be an indication of some form when the input voltage is out of range. The one restriction is to use a PIC processor of 20 pins or less.
  2. beenthere

    beenthere Retired Moderator

    Joined:
    Apr 20, 2004
    Messages:
    15,815
    Location:
    Missouri, USA (GMT -6)
    You will need at least 10 bits for the resolution (don't expect the last two to be stable). Convert the voltage reading after conditioning, output the number to the display.

    You will need some external hardware for the voltage ranging.
  3. scubasteve_911

    scubasteve_911 Senior Member

    Joined:
    Dec 27, 2007
    Messages:
    1,202
    What about running an ADC and a DAC together?

    The scheme would be, the DAC would be responsible for changing the reference voltage on the ADC. It would start out high, then climb downwards to autorange the signal. You need a really nice reference and a high resolution DAC for this, since you're relying on its precision.

    The ADC should also be accurate. You need to run a slight-negative rail on the input stage. So, it would go, voltage input to clamping diodes on the input to an opamp buffer. The buffer should be powered below ground. Or, perhaps it is best to add a bit of known bias on to the input. This is because there is usually a minimum input voltage to the ADC. Also, you need to find low-input/output offset amplifiers/ADCs. Even a pretty good opamp has about +/- 1mV input offset voltage. You can get them down to about a microvolt though using a chopper-stabilized amp.

    Steve
  4. liitlefan

    liitlefan New Member

    Joined:
    Sep 24, 2008
    Messages:
    7
    i agree.great idea ,i like it .but it cost a lot ~~
  5. scubasteve_911

    scubasteve_911 Senior Member

    Joined:
    Dec 27, 2007
    Messages:
    1,202
    This is how I roll when I design :)

    I can design a lot of things really poorly, but the challenge is doing it well. Although, there are advantages to making something inexpensive.

    OP,

    You PM'd me about clarifications, but I would like to keep the discussion public so that others may benefit.

    If you want to design a good autoranging meter, you should be using a microcontroller. The microcontroller is loaded with code to execute the task at hand. There are many available to use, any relatively modern one will work for this project. I recommend Cypress PSoC microcontrollers, since they're easy to use. You can get a programmer and a mini-development board from Digikey for about 55$

    http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=428-1585-ND

    It may be a bit much to spend right away, but think of all the fun things you will be able to do. I learned how to program with the microcontroller in both assembly and C when I was 17. Now, I use more powerful microcontrollers, but you need to spend money to get the debugging tools and software.

    I would use a quality analog-to-digital converter. In your case, you do not need to take samples very quickly. Resolution is the most important factor, since you want a bit of precision. There are many errors associated with ADCs and many books written on the subject, so try to find the lowest DNL, INL possible. There are other things, but these are probably the most important.

    http://en.wikipedia.org/wiki/Analog_to_digital_converter#Quantization_error

    So, basically, an ADC will give your microcontroller a code that is a function of the reference voltage you supply and the input voltage. I am suggesting that you change the reference voltage dynamically with your input voltage. For example, an ADC has a 5V reference applied and a 2.5V signal is input. This gives you a half-scale digital code. If an 8-bit converter is used, you should get 10000000 in a perfect world. Realistically, you can get steps of (5V / 256 (8bits) roughly 19.53mV. So, your input voltage is now ambiguous. Depending on what sort of precision you require, you should increase the resolution to achieve this.

    An autoranging ADC can do a bit better. For instance, if you had a 1V reference instead of a 5V reference, you will get 5 times better resolution. You can provide a varying reference voltage by means of a DAC. Clearly, your fully relying on the precision of the DAC, so it needs to be as accurate as possible. So, high resolution with low drift. Preferably one that you can attach a really nice voltage reference to.

    The process would be, you write the maximum voltage you would expect to the DAC. Measure the ADC, then find out where you should set your DAC to. Maybe keep within sensible ranges, for easier calculation.

    The main problem with measuring signals that are extremely low is that opamps and ADCs don't like anything near their supply rail. So, if you're powering by a single supply, then you might only be able to get with 10mV of each rail at best. This is why I propose using an opamp meant for dual supply operation and bringing the negative supply input below ground. You should be buffering the input before the ADC to guarantee enough output impedance to drive the ADC, plus an anti-aliasing filter (either in the opamp circuit, or after before the ADC). Look up this term and research the need, it's beyond the scope.

    Another good way to do this is to have many opamps with different gain. You can fix the reference to a set voltage. Microcontroller usually come with comparators with different voltages to select from, or at least a crappy ADC. You can read in directly what voltage it is, then select an appropriate gain stage with analog switches. You can then figure out what the voltage is knowing the gain setting, fixed reference voltage, and ADC value. Of course, this can be a bad idea for high precision because of the variance of offset voltages encountered, gain errors, tempcos of gains, and overall matching of the circuit.

    Or, the absolute simplest way would be to bring in a voltage directly into the microcontroller's ADC with a 1.25V reference. You need to protect the inputs with some zener diodes to supply rails and have a resistance in series beforehand. This wouldn't be good for any high impedance voltage source to be read though, so consider adding a buffer first. You can also go to town with multi-point averaging to rectify any random noise you might encounter.

    Good luck,

    Steve
  6. vortexmc

    vortexmc Thread Starter New Member

    Joined:
    Sep 24, 2008
    Messages:
    3
    Thank you steve for your clarifications, it makes alot more sense with what tou have said, i have chosen to use a PIC 16f690 microprocessor. Would u mind giving me a couple of ideas regarding the code, steps i should follow, in conjuntion to the auto-ranging, and with the general approach to the project.Again thank you :D
  7. scubasteve_911

    scubasteve_911 Senior Member

    Joined:
    Dec 27, 2007
    Messages:
    1,202
    You're welcome. I would try to do a block diagram of all the functional parts of the system. Then, fill in the blocks with actual components. Produce a schematic of the work, then post it to ensure that you didn't miss anything.

    When I work with micros, I treat them as black magic boxes that will do what I want in the end. As long as the IOs are able and my processing/storage/timing demands are reasonable, then it is a safe bet. Then, I build the hardware and start trying to build the software 'framework'.

    This approach has been good to me, so I suggest you do something similar.

    Steve
  8. Pich

    Pich Active Member

    Joined:
    Mar 11, 2008
    Messages:
    119
    Location:
    Vancouver Canada
  9. scubasteve_911

    scubasteve_911 Senior Member

    Joined:
    Dec 27, 2007
    Messages:
    1,202
Similar Threads
Forum Title Date
The Projects Forum 555 digital stopwatch Oct 10, 2014
The Projects Forum programming alpha/num digital display Oct 5, 2014
The Projects Forum How to use analog computational circuits to feed a digital display? Sep 2, 2014
The Projects Forum PWM signal to digital? Jul 31, 2014
The Projects Forum 8 bits Digital to Analog Converter Jul 29, 2014

Share This Page