You Are Here: Home » AVR ATmega Projects » A 10 Bit LED Digital Panel Meter With Auto Ranging Based On The ATMEGA8

A 10 Bit LED Digital Panel Meter With Auto Ranging Based On The ATMEGA8

Download the AVRStudio assembly source for the program: M8DPM091109A.asm
Download the AVRStudio hex file: M8DPM091109A.hex

Find updates at

10 bit LED

– A 10 bit digital panel meter for positive voltage only.
– Input resistance: about 130k
– Ranges: 0 to 10.20 volts and 0 to 102.3 volts.
– Over range indication.

This project came from friend named Don’s need for a digital panel meter for a power supply project. This was further complicated by Don and me being on different continents, and the problems that go with troubleshooting remotely.

Don had considered an ATMEGA8 project that was posted on the web, but when contacted, the author was not helpful and seemed very discouraging. So rather than pick through his code, trying to figure out what he had done, I thought about writing the code myself. Most of it could be taken from other projects.

Then I realized that with only the 10 bit A-to-D converter on the available AVR controllers, the resolution would only be 100 millivolts because Don intended his power supply to supply over 20 volts.

The 10 bit A-to-D converter has a range of 0 to 1023. To explain in a little more detail, using the ATMEGA8’s internal 2.5 volt band gap reference means that by using a resistive divider ahead of the A-to-D converter, the input could be scaled such that any voltage range from 0 to 2.5 volts or higher could be accommodated. If the range had less than 1024 steps, then some resolution would be lost. For Don’s application, a 102.3 volt scale would be necessary. The least significant digit would be 100 millivolts. And when he used the meter to measure (for example) 10.0 volts, the 100 millivolt resolution would be a little bit coarse.

LED Digital Panel Meter

“Ok, no problem”, I thought. “He can have two ranges on the meter. He can switch between two resistive dividers on the input to get a 10.23 volt full scale range and a 102.3 volt full scale range.

And why not have the meter switch between the two ranges automatically. That would make the project a lot more interesting. I had always taken it for granted that auto ranging voltmeters were pretty simple, and this would be a chance to do something unusually analog with an AVR controller, so why not?


For more detail: A 10 Bit LED Digital Panel Meter With Auto Ranging Based On The ATMEGA8

Leave a Comment

You must be logged in to post a comment.

Scroll to top