Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
00 Careers Contact Us
Search...
Welcome visitor you can Login or create an account
p !!! Limited Seats Only. Book Your Seat Now. Click Here to Know More
ABLab Solutions > Knowledge Centre > Sample Codes > Peripheral Features > ADC > 4 Wire Resistive Touch Screen Sensor Interfacing with ATmega32
Knoweldge Centre
Sample Codes
The term generally refers to touching the display of the device with a finger or hand. Touch screens can also sense
Softwares
other passive objects, such as a stylus. Touch screen technology has been around for a number of years but
advanced touch screen technology has come on in leaps and bounds recently. Companies are including this
technology into more of their products. The three most common touch screen technologies include resistive,
capacitive and SAW (surface acoustic wave). Of all the kinds of touch screens available, Resistive touch screens are
easy to interface, cheap and they have fair sensitivity. Resistive Touch screens are simply transducers. This touch
screen has a resistive layers in both X and Y directions. According to the position of the touch, their X channel and Y
channel resistance changes. So, what we have to do is we have to determine the X and Y Channel resistance to get
the position of the touch in terms of X and Y co-ordinates. To read the position of the touch, we have to read touch
position sequentially i.e. first read X position and then read the Y position.
In this project, we will learn How to interface a 4 wire Resistive Touch Screen with AVR ATmega32 microcontroller.
Here, we will find the coordinate value of the point at which the touch screen is touched and we will display the
coordinate value in a 16X2 Alphanumeric LCD. The AVR ATmega32 Microcontroller will first read the X and Y value of
the coordinate point of the touch screen. But, the two outputs of touch screen sensor are analog in nature and
microcontroller cannot process the analog signal directly. So, first it will convert the two analog outputs of touch
screen sensor to digital values using its analog to digital converter and then it will display the two converted digital
6,431 views
values in the 16X2 alphanumeric LCD. Now, we will touch the touch screen sensor at different position and we will
see the changes in its output values(X and Y values) in the 162 alphanumeric LCD.
5,897 views
Hardwares Required
AVR Trainer Board-100-1pc
PC to ATmega16
Communication with LED
Display
5,814 views
12V, 1A DC Adapter-1pc
Softwares Required
5,152 views
AVR Studio 4
WinAVR -2010
SinaProg Hex Downloader
USBasp Driver
Circuit Diagram
4,157 views
C Program
//**************************************************************//
3,053 views
2,990 views
#include<avr/io.h>
/*Includes io.h header file where all the Input/Output Registers and its Bits are defined for all AVR
microcontrollers*/
2,764 views
2,722 views
Products on Sale
/*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us
Sale!
(microsecond delay)*/
#define LCD_DATA_PORT PORTB
/*Defines a macro for the lcd.h header File. LCD_DATA_PORT is the microcontroller PORT Register to which the data
pins of the LCD are connected. Default PORT Register for data pins in lcd.h header file is PORTA*/
#define LCD_CONT_PORT PORTD
/*Defines a macro for the lcd.h header File. LCD_CONT_PORT is the microcontroller PORT Register to which the
control pins of the LCD are connected. Default PORT Register for control pins in lcd.h header file is PORTB*/
#define LCD_RS PD0
/*Defines a macro for the lcd.h header file. LCD_RS is the microcontroller Port pin to which the RS pin of the LCD is
connected. Default Port pin for RS pin in lcd.h header file is PB0*/
#define LCD_RW PD1
/*Defines a macro for the lcd.h header file. LCD_RW is the microcontroller Port pin to which the RW pin of the LCD is
connected. Default Port pin for RW pin in lcd.h header file is PB1*/
#define LCD_EN PD2
/*Defines a macro for the lcd.h header file. LCD_EN is the microcontroller Port pin to which the EN pin of the LCD is
connected. Default Port pin for EN pin in lcd.h header file is PB2*/
Add to cart
#include<avr/lcd.h>
Sale!
/*Includes lcd.h header file which defines different functions for all Alphanumeric LCD(8-Bit Interfacing Method).
LCD header file version is 1.1*/
#include<avr/touchscreen.h>
/*Includes touchscreen.h header file which defines different functions for 4 wire Touch Screen.TOUCHSCREEN
header file version is 1.1*/
int main(void)
{
DDRB=0xff;
/*All pins of PortB are declared output (data pins of LCD are connected)*/
DDRD=0x07;
/*PD0, PD1 and PD2 pins of PortD are declared output (control pins of LCD are connected)*/
Add to cart
int x,y;
/*Variable declarations*/
Sale!
adc_init();
/*ADC initialization*/
lcd_init();
/*LCD initialization*/
lcd_string_write(ABLab Solutions);
/*String display in 1st row of LCD*/
lcd_command_write(0xc0);
/*Cursor moves to 2nd row 1st column of LCD*/
lcd_string_write(www.ablab.in);
/*String display in 2nd row of LCD*/
_delay_ms(500);
_delay_ms(500);
Add to cart
_delay_ms(500);
_delay_ms(500);
/*Display stays for 2 second*/
lcd_command_write(0x01);
/*Clear screen*/
Find us on Facebook
ABLab Solutions
5,023 likes
lcd_string_write(Sensor Output:-);
/*String display in 1st row of LCD*/
/*Start of infinite loop*/
while(1)//Start of Infinite loop.
{
x=read_touchscreen_x_coordinate();
/*Reading x-axis value of touch screen*/
lcd_command_write(0xc0);
/*Cursor moves to 2nd row 1st column of LCD*/
lcd_number_write(x,10);
Like Page
Be the first of your friends to like this
Shop Now
Connection Guide
The step-by-step connection guide for 4 Wire Resistive Touch Screen Sensor Interfacing with ATmega32 project is as
follows:
Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.
Connect PortB header with LCD data header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.
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.
Connect the 16X2 Alphanumeric LCD to the LCD header of AVR Trainer Board-100.
Connect the Pin1, Pin1, Pin1, Pin1 and VCC pins of 4 Wire Resistive Touch Screen header with PA0, PA1, PA2,PA3
and VCC pins of PortA header of AVR Trainer Board-100with 5 to 5 Connector.
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.
Connect the AVR USB Programmer to the PC/Laptops USB Port directly or with the help of USB AM-AF Cable.
Switch on the power with the help of Power Switch of AVR Trainer Board-100.
Download 4 Wire Resistive Touch Screen Sensor Interfacing with ATmega32 Hex file to AVR Trainer Board-100
with the help of SinaProg Hex downloader and AVR USBProgrammer.
Touch the Touch Screen sensor at different position and see the output.
Download Materials
4 Wire Resistive Touchscreen Sensor Interfacing with ATmega32 Code v1.1
19.42 KB
Download (http://www.ablab.in/?wpdmdl=8364)
Share
Download
Touch Screen Header File
v1.1to367
downloads Code
0.85 KBand Header Files
Download (http://www.ablab.in/?wpdmdl=6662)
Share
8
5408 downloads
1.14 KB
Download (http://www.ablab.in/?wpdmdl=6665)
3415 downloads
1.88 KB
Download (http://www.ablab.in/?wpdmdl=6638)
Related Posts
4 Wire Resistive Touch Screen Sensor Interfacing with ATmega16
4 Wire Resistive Touch Screen Controlled Robot with ATmega32
Password Protected 4 Wire Resistive Touch Screen Controlled Robot with ATmega32
4 Wire Resistive Touch Screen Controlled Wireless Robot with ATmega32 using Series 2 Zig Bee
4 Wire Resistive Touch Screen Controlled Wireless Robot with ATmega32 using 433MHz RF
4 Wire Resistive Touch Screen Controlled Wheel Chair with ATmega32 for Physically Handicapped
Relay based 4 Wire Resistive Touch Screen Controlled Home Automation System with ATmega32-II
Password Protected 4 Wire Resistive Touch Screen Controlled Wireless Robot with ATmega32 using 433MHz RF
Relay based 4 Wire Resistive Touch Screen Controlled Home Appliances System with ATmega32-I
BT136 Triac based 4 Wire Resistive Touch Screen Controlled Home Appliances System with ATmega32-I
Password Protected 4 Wire Resistive Touch Screen Controlled Wheel Chair with ATmega32 for Physically
Handicapped
BT136 Triac based 4 Wire Resistive Touch Screen Controlled Home Appliances System with ATmega32-II
4 Wire Resistive Touch Screen Controlled Wireless Wheel Chair with ATmega32 using 433MHz RF for Physically
Handicapped
4 Wire Resistive Touch Screen Controlled Robot with ATmega16
Password Protected Relay based 4 Wire Resistive Touch Screen Controlled Home Automation System with
ATmega32-II
Relay based 4 Wire Resistive Touch Screen Controlled Wireless Home Automation System with ATmega32 using
433MHz RF-II
Password Protected Relay based 4 Wire Resistive Touch Screen Controlled Home Appliances System with
ATmega32-I
Relay based 4 Wire Resistive Touch Screen Controlled Wireless Home Automation System with ATmega32 using
433MHz RF-I
Password Protected BT136 Triac based 4 Wire Resistive Touch Screen Controlled Home Appliances System with
ATmega32-I
BT136 Triac based 4 Wire Resistive Touch Screen Controlled Wireless Home Appliances System with ATmega32
using 433MHz RF-I
Leave a Reply
You must be logged in to post a comment.
Powered by SPIS