Your SlideShare is downloading. ×
Digital ir sensor interfacing with a tmega16(digital output,led display)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Digital ir sensor interfacing with a tmega16(digital output,led display)

1,013

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,013
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Digital IR Sensor Interfacing With ATmega16 (Digital Output, LED Display)
  • 2. Sneha Palace, Plot No.60, Laxmi Vihar, Near Apollo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 Table of Contents Project Description........................................................................................................3 Hardwares Required......................................................................................................3 Softwares Required.......................................................................................................3 C Program......................................................................................................................4 Connection Guide..........................................................................................................5 Update Yourself.............................................................................................................6
  • 3. Sneha Palace, Plot No.60, Laxmi Vihar, Near Apollo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 Project Description In this project, we will interface a Digital IR Sensor with ATmega16 microcontroller. We will display the digital output of Digital IR Sensor on a LED. Then, we will place our hand or a white paper (as an Obstacle) in front of the Digital IR Sensor and we will see the output value of Digital IR Sensor changing. Hardwares Required  AVR Trainer Board-100-1pcs  AVR USB Programmer-1pcs  12V DC Adapter-1pcs  Digital IR Sensor-1pcs  1 to 1 Connector-3pcs  10 to 10 FRC Female Connectors-2pcs  USB AM-AF Cable (Optional)-1pcs Softwares Required  AVR Studio 4  WinAVR -2010  SinaProg Hex Downloader  USBasp Driver
  • 4. Sneha Palace, Plot No.60, Laxmi Vihar, Near Apollo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 C Program //**************************************************************// //Microcontroller :ATmega16 //System Clock :1MHz //Project : Digital IR Sensor Interfacing With ATmega16 (Digital Output, LED Display) //AVR Compiler :AVR-GCC 4.3.2 //Author :ABLab Solutions // :www.ablab.in // :info@ablab.in //Date :1st January 2012 //**************************************************************// #include<avr/io.h> /*Includes io.h header file where all the Input/Output Registers and its Bits are defined for AVR microcontroller*/ #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 file. Default value of F_CPU in delay.h header file is 1000000(1MHz)*/ #include<util/delay.h> /*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/ void main(void) { DDRA=0x00; /*All pins of PortA are declared as input (PA0 pin is connected to DO pin of Digital IR sensor)*/ DDRB=0x01; /*PB0 pin of PortB is declared output (LED is connected)*/
  • 5. Sneha Palace, Plot No.60, Laxmi Vihar, Near Apollo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 unsigned char digital_ir_sensor_value; /*Variable declarations*/ /*Start of infinite loop*/ while(1) { digital_ir_sensor_value=PINA & 0x01; /*Reading Digital IR Sensor value */ PORTB=digital_ir_sensor_value; /*Value of Digital IR Sensor is displayed in LED */ _delay_ms(500); /*500ms delay*/ } } /*End of Program*/ Connection Guide The step-by-step procedure for Digital IR Sensor interfacing with ATmega16 (Digital Output, LED display) is as follows:  Insert the DC Pin of 12V DC Adapter to the DC Socket of AVR Trainer Board-100.  Connect PORTB Header with LED Header in AVR Trainer Board-100 with a 10 to 10 FRC Female Connector.  Connect the ISP Header of AVR Trainer Board-100 with AVR USB Programmer header with a 10 to 10 FRC Female Connector.  Connect the VCC, GND & DO pins of Digital IR Sensor to 5V, GND and PA0 of AVR Trainer Board-100 respectively with 1 to 1 Connectors.  Connect the AVR USB Programmer to the PC/Laptop's USB Port.  Switch on the power with the help of Power Switch of AVR Trainer Board-100.  Download the Digital IR Sensor interfacing with ATmega16 (Digital Output, LED display) Hex file to AVR Trainer Board-100.  See the output.
  • 6. Sneha Palace, Plot No.60, Laxmi Vihar, Near Apollo Hospital, Bhubaneswar-751005 Website: www.ablab.in | E-mail: info@ablab.in | Ph: 91-674-6573832 Update Yourself For more Softwares, Tutorials, Sample Codes, Installation Guides, User Guides, User Manuals, Videos, Products & Components and Updates, Please Visit us at: www.ablab.in Mail us at: Info@ablab.in View us at: www.youtube.com/ablabsolutions Like us at: www.facebook.com/ablab.in Join us at: www.facebook.com/groups/ablabsolutions

×