ablab

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 LCD Display

8150
1
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 volts, 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 16×2 alphanumeric LCD by the microcontroller. 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). If other voltage levels are converted by the analog to digital converter, then the output will be in-between 0 and 1023.

Softwares Required

Hardwares Required

Name Quantity
AVR Trainer Board-100 with ATmega16 1pc
AVR USB Programmer 1pc
12V, 1A DC SMPS Adaptor 1pc
RG1602A 16X2 Alphanumeric LCD Green 1pc
1 to 1 Connector-Female to Female 4pc
10 to 10 FRC Female to Female Connector 2pc

Circuit Diagram

Video

Connection Guide

The step-by-step connection guide for Analog to Digital Converter of ATmega16 with LCD Display is as follows

  • Steps - 1 ( 0f 11 )

    Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.

  • Steps - 2 ( 0f 11 )

    Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.

  • Steps - 3 ( 0f 11 )

    Connect RS, RW & EN pins of LCD control header with PD0, PD1 & PD2 pins of PortD header respectively in AVR Trainer Board-100 with 1 to 1 Connectors.

  • Steps - 4 ( 0f 11 )

    Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.

  • Steps - 5 ( 0f 11 )

    Connect PA0 pin of PortA header to any pin of 5V header with a 1 to 1 Connector.

  • Steps - 6 ( 0f 11 )

    Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.

  • Steps - 7 ( 0f 11 )

    Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-FM Cable.

  • Steps - 8 ( 0f 11 )

    Switch on the power with the help of Power Switch of AVR Trainer Board-100.

  • Steps - 9 ( 0f 11 )

    Download the Analog to Digital Converter of ATmega16 with LCD Display Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.

  • Steps - 10 ( 0f 11 )

    See the output.

  • Steps - 11 ( 0f 11 )

    Now, connect PA0 pin of PortA header to any pin of Ground (GND) header with a 1 to 1 Connector.

  • Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.

    Steps - 1 ( 0f 11 )

  • Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.

    Steps - 2 ( 0f 11 )

  • Connect RS, RW & EN pins of LCD control header with PD0, PD1 & PD2 pins of PortD header respectively in AVR Trainer Board-100 with 1 to 1 Connectors.

    Steps - 3 ( 0f 11 )

  • Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.

    Steps - 4 ( 0f 11 )

  • Connect PA0 pin of PortA header to any pin of 5V header with a 1 to 1 Connector.

    Steps - 5 ( 0f 11 )

  • Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.

    Steps - 6 ( 0f 11 )

  • Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-FM Cable.

    Steps - 7 ( 0f 11 )

  • Switch on the power with the help of Power Switch of AVR Trainer Board-100.

    Steps - 8 ( 0f 11 )

  • Download the Analog to Digital Converter of ATmega16 with LCD Display Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.

    Steps - 9 ( 0f 11 )

  • See the output.

    Steps - 10 ( 0f 11 )

  • Now, connect PA0 pin of PortA header to any pin of Ground (GND) header with a 1 to 1 Connector.

    Steps - 11 ( 0f 11 )

Downloads

Analog to Digital Converter of ATmega16 with LCD Display Project File
  • 80 downloads 0 Kb

Post a Comment

    • BandhiyaHardik
      if i change my voltage 5 to 2.5 at PD0 , it also shows 1023 adc value why???
      2016-11-07 23:33:19
      Reply