Voltmeter using AVR microcontroller (Atmega16)

Hello all,

I am trying to design voltmeter which reads between 0 - 5V and displays the output. However, one of the requirements of project is that it should have analog output, that is, dial and pointer display. 

One of the way I found was to use a small stepper motor. But I am having difficulty as to how to control stepper motor rotation in accordance with the measured voltage. 

Hi @srinidhi1992,

Thanks for being part of the GitHub Community Forum! We’re glad you’re here.

I wanted to jump in here, and mention that if you don’t get the help you’re looking for from this particular community, you might want to try getting help somewhere that focuses on hardware. It’s definitely possible another GitHub user might have run into this same issue and can help, but the GitHub Community Forum focuses primarily on topics related to GitHub, Git, and development projects hosted on GitHub. We want to make sure you’re getting the best support you can, but this forum may not be the right place for this particular topic.

Best of luck!

Hello srinidhi1992

the best way to create an analog voltage from a digital pin is to define the output as a PWM pin. First set the mark-space ratio/duty-cycle of the PWM output to be proportional to the value read from the analog input pin. Then, you will need to smooth this output via a resistor-capacitor network. If you are driving something like a classic iron volt meter, you need to keep the output linear, so it is advisable to buffer the output through an op-amp.

In principle, this is explained in a lot of detail in https://arduino-info.wikispaces.com/Analog-Output

Good luck with your project.

Geekuino has a good response. I’m wondering if your atmega doesn’t already have an adc built into it. Many of them do. Checkout this website for some helpful information.

Also be sure to check the Arduino forums to see what others have done as they use similar microprocessors.