Monday, October 20, 2008

8-Channel ADC Project with ATmega32

Hi friends,
here is a small project of Analog to Digital Converter using ATmega32 which is having on-chip 8-channel ADC.
The circuit also consists of an intelligent 16x2 LCD for displaying the value of the voltage applied at each channel. There is also a push-button to scroll throgh the different channels. The schematic is as shown in the figure:

When powered on, the LCD displays"ADC Testing.." on the first line and the value of the voltage applied at the channel0 on the second line. When the push-button is pressed, the second line displays the value of channel1. Like-wise, all the channels can be checked one-by-one by pressing the push-button. The channel count will roll back to channel0 after going to channel7.

The displays shown in the pictures on top show values at channel0 and channel1. Here a AA battery was connected to channel0 and the channel1 was connected with the +5v supply.
A 9-pin connector is used for ADC, 8 ADC channel pins and 1 ground pin. (the values displayed on LCD will fluctuate for a channel if nothing is connected to that channel)

The software is created in C using ImageCraft ICCAVR compiler.
The Schematic and code for this project can be downloaded here:

Download Schematic and Code
Download HEX file



Anonymous said...

Nice projects!
Why don't you use AVR-GCC its free, much popular and fantastic?
It integrates tightly with Avr Studio (by Atmel -FREE!) so no need to worry about makefiles or command line. Every thing can be done in GUI with AVR studio.

CC Dharmani said...

Hi Avinash,
since I had started with ICCAVR so got habit of it!! It's 'Application Generator' was great for me as I was starting on AVRs. I was bit confused about creating the makefiles in AVR-GCC, so i had dropped it that time.

But yes, I'm now trying to use AVR-GCC as it's free and good support is also available on net.

Thanks for the comment!

Sujit said...

Mind blowing...

Just the thing I needed.
Thanks for saving my day.

Anonymous said...

mr. dharmani, i am having trouble interfacing my atmega32 with the PC(using hyperterminal) so that the value read by the ADC is given on the screen....could you please help me out?....is it also possible that I send the value to my computer and the computer processes the value,instead of displaying it on hyperterminal

CC Dharmani said...

Hi sujay,
what kind of problem are you facing? If nothing is getting displayed, check out the RS232 connector connections. Also, while starting hyper terminal keep the 'flow control' as 'none'. If some garbage is getting displayed, check out that the PC baud-rate is matching with that of the microcontroller.

You can process the data inside PC rather than displaying it on hyper terminal, but for that you need to write a program running in PC which is having access of the serial port. Then you can process the received data using that program.

Ruzvay MSI said...

your device looks really impressive

but i think it can only measure dc values?

can u help me how i can build an ac voltmeter??

i was thinking, if the frequency is specified then the rms value can easily be calculated with a single sample and corresponding time by timer.

but most porbably the frequency wont be specified!!!
i also need the device to sense the rms value within less than a millisecond!! but a 50hz signal takes 20ms for a full cycle!!!

ankit jain said...

hi, nice work. i'm working on a project which would use an ADC chip of an Atmega8L
microcontroller. A PC would be interfaced via USB for controlling the ADC
card (Atmega + ADC chip) as well as collecting the data. An API and a
library (for Atmega controllers) needs to be developed. (The required
hardware with a USB inerface has already been built). sir i want to know its parameters, which r to be controlled. if u have the necessary code, plz mail me
thank u in advance
plz reply soon

aftab said...

hi thanks brother

Unknown said...

Dear CC Dharmani
I have using your ADC & LCD program can not working your circiut
I have connecting details:
AT32 to SPI then To connect LCd then i have write your program on chip circuit is no response all connection correct. but can not working pls help me

Anonymous said...

having a problem with this guys could any one send me its hex file so it could be directly acess by isp programmer ,,,actually i am getting compiling errors in this programe

salik said...

salik_salman2002@yahoo.com plz send me hex file here

santhu said...

thanks for ur ADC project..its really nice!!!!

Unknown said...

can u please indicate what changes we are supposed to make in the given program to interface the lcd in atmega 16 with AVRGCC?

santrox said...


all you need to change is changing atmega32 to atmega16 in the makefile.
email me @ whydevilcries@gmail.com if you need any help!!!

Anonymous said...

dharmani sir, cpould you please list atleast 3 applications of this project in real world.
i would be highly obliged if you can tell me atleast 3 applications of this project.
yours sincerely,
ankit bhardwaj
pls do reply your precious comment!!

rohith said...

i need code for particular application which i described below will u send us c-program for me..

my requirement is...

the required heating rate(25degree centigrade to 200 degree centigrade per minute) is entered and start ramp command to given through keypad(four switches) connected to port b of MC atmega32. as start ramp command given, timer1 which is being operated in fast pwm mode starts generating duty cycle variation the time required to reach the maximum set temperature.

the pwm signal generated from microcontroller is applied to the dc switching circuit constructed using MOSFET. which inturn switches the power supply connected to the drain of MOSFET via heating element. the heating element acts as load across the drain of MOSFET.

and heating element temperature is sensed by thermocouple and it is amplified and given to adc0 pin. finaly the linearly varying temperature is displayed through lcd and transmitted to computer with the help of Microcontroller USART for storing data

abcd said...

hey all
i am working ADC atmega 32 and getting garbage value at the output

Sushant Bhangale said...

what is 8 channel & how its work

Anonymous said...

Can i use the code for atmega16???? plz help out..

Zoniv said...

hello, nice to read your article. I would suggest you to use AVR-GCC as its free and reliable.Though ICCAVR is not bad also. thanks for your nice post.

Technopreneur said...
This comment has been removed by the author.
Technopreneur said...

You should also check The Engineering Projects because they have posted a lot of Arduino Projects and PIC Mirocontroller Projects and have also designed many new Proteus Tutorials. I hope you guys are gonna like them.

Router Login said...

You content is good but its optimization is not up to mark you must work on its optimization. Check out some Router Ips and these articles will help you.

HindiVale said...

I have read each and every part of this article and I think this is the best.

Connect HP Printer to Mac Wireless said...

This is a very Amazing and Very Informative Article we get a lot of Information from this article we really appreciate your team work keep it up and keep posting such informative articles.

assignment help nz said...

I appreciate the time and effort you took into putting everything together. You're in luck if you're reading this because you may pay our organisation to assignment and relieve yourself of the load of writing! Thank you for making this information available.

Gregory J. Trujillo said...
This comment has been removed by the author.
Gregory J. Trujillo said...

You have done a great job on this article like Best Coursework Writing Service. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you.

Anonymous said...

You know, I am very interested to use such things. I remember, once I got an opportunity to use this converter in my project, and at the same time, I also had a dissertation to write. To be honest, I did not want to write a dissertation neither wants to miss the opportunity to use this converter. Therefore, I found a Supply Chain Dissertation help service. So, I can use it properly in my project.

jessciacarvin said...

You are doing a great job, your effort is useful for Engineering students. And we understand the student's problems and we know in the academic career they have faced many challenges and everyone is very important for them.

William said...

Literally, you have shared a very interesting topic, but I am not able to read it completely because right now, I have to find a logo design on an urgent basis. Therefore, I have saved this post, and I will revisit it once I get free from my work.

robu said...

This project explains converting analog data into digital data using ATmega32.It can be used in various applications like Temperature sensing and control, lightning sense and control devices, fire detection, and safety devices.
Robu is an online electronic store where you can order electronic components at competitive prices. If you are a beginner or hobbyist then it is the best place for you to shop online. Here you will get start-to-end technical support for your project. For more details, you can visit https://robu.in/.

semi trucks accidents said...

Embark on a journey of electronic exploration with the 8-Channel ADC Project featuring ATmega32. This meta description hints at a hands-on project that involves an Atmel microcontroller (ATmega32) and an 8-channel Analog-to-Digital Converter (ADC). Discover the thrill of converting analog signals into digital data and unlocking the potential for various applications. Perfect for electronics enthusiasts, hobbyists, and aspiring engineers eager to delve into the world of microcontroller projects.Thank you for sharing your expertise! Keep up the excellent work! Continue to share. Please feel free to look at my website.

Fairfax Virginia DUI Lawyer said...

Take a trip through electronic research with the ATmega32-powered 8-Channel ADC Project. An 8-channel analog-to-digital converter (ADC) and an Atmel microcontroller (ATmega32) are used in a practical project that is hinted at in this meta description. Experience the excitement of transforming analog signals into digital information and realizing the possibilities for a multitude of uses. Ideal for amateurs, prospective engineers, and electronics lovers who are excited to explore the world of microcontroller projects.It is quite sophisticated and easily readable. Even better, you've made it simple to read and easy to grasp. You're a really talented writer. I'm grateful.

Nandi IVF said...

In-vitro fertilization (IVF) is a fertility treatment where eggs and sperm are combined in a laboratory dish, and resulting embryos are transferred to the uterus. Rohini, a bustling suburb in Delhi, offers Nandi IVF Clinic equipped with state-of-the-art technology and experienced fertility specialists. These centers provide comprehensive services including consultations, fertility assessments, hormonal treatments, egg retrieval, embryo transfer, and ongoing support.

Patients in Rohini have access to personalized care, cutting-edge reproductive techniques, and a supportive environment throughout their IVF journey. With a focus on compassion and expertise, IVF in Rohini aim to fulfill the dreams of couples seeking to build their families.

villa rao said...

The 8-Channel ADC Project with ATmega32 is a remarkable demonstration of embedded systems engineering, showcasing the versatility and power of microcontroller-based projects. With the ATmega32 microcontroller at its core, this project effectively interfaces with eight analog sensors, converting their signals into digital data for processing. The meticulous attention to detail in designing the hardware and software components, coupled with the seamless integration of the ATmega32's ADC capabilities, ensures accurate and reliable conversion of analog signals into digital values.
Abogado de Posesion de Drogas en Orange

Anonymous said...

Embark on a project with ATmega microcontrollers for innovative electronic solutions. Explore versatile applications in robotics, automation, and more. Enhance your workspace with the captivating aroma of Ana Abiyedh perfume, adding a touch of luxury to your creative endeavors.