Sie sind auf Seite 1von 9

0 items in cart Rs.0.

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

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

Most Popular Posts


Line Follower Robot with
ATmega16 using Analog IR
Sensor
14,472 views

LED Blinking with ATmega16


8,596 views

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

16X2 Alphanumeric LCD


Interfacing with ATmega16
8,585 views

L293D based DC Motor Driver


Interfacing with ATmega16 in
5V Mode

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

Accelerometer based Hand


Gesture Controlled Robot
with ATmega32

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

AVR USB Programmer-1pc

5,814 views

12V, 1A DC Adapter-1pc

Obstacle Avoider Robot with


ATmega16 using Analog IR
Sensor

16X2 Alphanumeric LCD(JHD162A)-1pc


4 Wire Resistive Touch Screen Sensor-1pc
1 to 1 Connector-8pcs
5 to 5 Connector-1pc
10 to 10 FRC Female Connector-2pcs
USB AM-AF Cable(Optional)-1pcs

Softwares Required

5,152 views

SinaProg Hex Downloader


Software
4,880 views

Accelerometer based Hand


Gesture Controlled Robot
with ATmega16
4,794 views

AVR Studio 4
WinAVR -2010
SinaProg Hex Downloader
USBasp Driver

Circuit Diagram

4X4 Keypad Interfacing with


ATmega16 and LCD Display
4,674 views

16X2 Alphanumeric LCD


Interfacing with ATmega32
4,643 views

EM-18 RFID Reader


Interfacing with ATmega16

4,157 views

L293D based DC Motor Driver


Interfacing with ATmega16 in
PWM Mode
4,002 views

Analog IR Sensor Interfacing


with ATmega16 and LED
Display
3,531 views

LM35 Temperature Sensor


Interfacing with ATmega32
and LCD Display
3,520 views

L293D based DC Motor Driver


Interfacing with ATmega32 in
PWM Mode
3,402 views

C Program

EM-18 RFID Reader


Interfacing with ATmega32

//**************************************************************//

3,053 views

//System Clock :1MHz

HC-06 Bluetooth Module


Interfacing with ATmega32

//Software :AVR Studio 4


//**************************************************************//

2,990 views

Line Follower Robot with


ATmega32 using Analog IR
Sensor

#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

LED Interfacing with


ATmega16

#define F_CPU 1000000


/*Defines a macro for the delay.h header file. F_CPU is the microcontroller frequency value for the delay.h header

2,722 views

file. Default value of F_CPU in delay.h header file is 1000000(1MHz)*/


#include<util/delay.h>

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*/

AVR Trainer Board and Programmer


Combo
Rs.1,100.00
Rs.1,000.00

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;

AVR Trainer Board-100


Rs.800.00
Rs.700.00

/*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);

AVR USB Programmer


Rs.350.00
Rs.300.00

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

/*X-axis value is displayed in 2nd row of LCD*/


lcd_string_write( );
/*Two empty space are displayed in LCD*/
y=read_touchscreen_y_coordinate();
/*Reading y-axis value of touch screen*/
lcd_number_write(y,10);
/*Y-axis value is displayed in 2nd row of LCD*/
lcd_string_write( );
/*Four empty space are displayed in LCD*/
_delay_ms(1);
/*1ms delay between each reading of touch screen values*/
}
}

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

4 Wire Resistive Touch Screen Sensor Interfacing with ATmega32

Download (http://www.ablab.in/?wpdmdl=6662)

Alphanumeric LCD Header File v1.1

Share
8
5408 downloads

1.14 KB

Download (http://www.ablab.in/?wpdmdl=6665)

ADC Header File v1.1

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

One thought on 4 Wire Resistive Touch Screen Sensor Interfacing with


ATmega32
Pingback: 4 Wire Resistive Touch Screen Sensor Interfacin...

Leave a Reply
You must be logged in to post a comment.

Sitemap | Privacy Policy | Terms & Conditions

Copyright 2016 ABLab Solutions

Powered by SPIS

Das könnte Ihnen auch gefallen