================================================================================================================================================

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

Thanks!!
-----------
ccd@dharmanitech.com

Thursday, October 9, 2008

Home-made Double Layer ATmega32 PCB for RS232/RS422 Communication testing















Hi guys,
after making my single layer starter's kit M32_Card, I was looking for making a double layer M32 PCB at home. So, here is my attempt to make it. Well, it didn't turn out to be as difficult as I had thought it to be earlier. I had to dump one PCB before making this one as the top-layer routine was not solder-friendly!!

I've made this one mainly for an application where RS232 & RS422 testing was required. It uses MAX232 & MAX488 ICs from for those serial communication. Selection between RS232 & RS422 is through jumpers. The board is using ATmega32 controller, just like my single layer pcb. It also has 4x4 matrix keyboard, an LCD interface, ADC connector, SPI connector (for In System Programming), a reset switch and an LED for beginner's programming. It operates with the standard 12v DC adapter.

Here is the schematic (click on the image to enlarge):


There is a small mistake here in the schematic, the RX/TX pin connections in the RS232 connector are swapped, which I found while testing the PCB. So, I had to correct it by cutting those two tracks and placing jumpers. After the correction, the communication with PC was established. The schematic is similar to the M32_Card, accept that I've removed the RTC DS1307 and placed the MAX488. Also, the individual push buttons are replaced with the 16 key matrix key-board.
Click here to get more info and for downloading code to interface the 4x4 matrix keyboard shown here

The PCB etching is done with Ferric Chloride. In making the double layer PCB, as I don't have any PTH (printed through holes) facility, I've put small pieces of single core wire into the holes and soldered both sides. Check out the top and bottom layers here














If you have an application where the circuit can not be contained in a single layer, a home-made double layer PCB is worth a try!!

Thanks!
---------
ccd@dharmanitech.com

Friday, October 3, 2008

Thermometer using DS1621 and Nokia 3310 LCD interfaced with ATmega8


Hi friends,
in my last post I had discussed Nokia 3310 LCD interfacing with AVR ATmega8. It's really fun to work with this LCD.

Now, here I'm presenting one application with the same LCD: Designing a thermometer using DS1621 temperature sensor IC. DS1621 is 8-pin sensor from Maxim, with temp range of -55 to +125 degree C, which can be interfaced with microcontroller over two-wire serial i2c bus. It has operating voltage range from 2.7 to 5.5v. I'm operating it here at 3.3v, same as the one driving the LCD and ATmega8. DS1621 doesn't require any external components to measure temperature. It has got continuous or one-shot temperature reading capability to save power.
Check out the schematic:


Here is the Proteus ISIS simulation result:



I'm using here LM317 for getting 3.3v supply, any 3.3v rgulator can be used to replace it. The LED is only for checking the health of the circuit incase nothing comes up on display. The circuit is programmed to update temperature appx. every second.

I've taken help of LFG application for generating different sizes of fonts for the LCD, thanks o the author M.Ebrahimy. The application can be downloaded from here:
LCD Font Generator

I've created library functions for DS1621 interface with AVR using ICCAVR compiler. This functions can be used with i2c base routines discussed in my earlier posts. You can download the project source code here.





Download
------------------
HEX file
Source code (including the 3310 & DS1621 Libraries)
Proteus Simulation Model


(Do you wanna use this HEX file but don't want my name on the display?? Well, just learn how to play with hex file from intel HEX-file tutorial, find ascii characters of my name in the hex file and replace them with yours!!)

Download Datasheets:
1. DS1621
2. ATmega8

Thanks!!
---------
Contact: ccd@dharmanitech.com