Hello Readers, welcome to my Blog - A Blog For Bloggers By A Blogger. I'm Arun, an entrepreneur Blogger from India.

## Analog to Digital Converter of ATmega16 with LED Display

13470
Mark as Favourite

Microcontrollers are capable of detecting binary signals: is the button pressed or not? These are digital signals. When a microcontroller is powered from five volt, it understands zero volts (0V) as a binary 0 and five volts (5V) as a binary 1. But the real world is not so simple and likes to use shades of gray. What if the signal is 2.72V? Is that a zero or a one? We often need to measure signals that vary; these are called analog signals. And these analog signals have to be processed by the microcontroller. But the microcontroller cannot process the analog signals of nature, so these analog signals needs be converted to digital signals first. This conversion can be achieved using an analog to digital converter.

In this project, we will learn How to convert an analog signal to digital signal using the Analog to Digital Converter of AVR ATmega16 microcontroller. The AVR ATmega16 has an inbuilt 8 channel, 10 bit analog to digital converter. Here, we will first convert a 5V signal and then a 0V signal with a reference voltage of 5V of ADC. After each conversion, the analog to digital converter of ATmega16 will give a 10-bit value for each signal (5V and 0V).These outputs of the analog to digital converter are displayed in a 1×8 LED array. When a 5V signal is converted, the output of analog to digital converter is 0x3ff (1023) and when 0V signal is converted, the output is 0x00 (0). But the LED array can display only 8-bit at a time. So, the 1×8 LED array will first display the lower 8-bit and then the upper 2-bit of the 10-bit digital output with a delay of 500ms.

### Hardwares Required

 Name Quantity AVR Trainer Board-100 with ATmega16 1pc AVR USB Programmer 1pc 12V, 1A DC SMPS Adaptor 1pc 1 to 1 Connector-Female to Female 1pc 10 to 10 FRC Female to Female Connector 2pc