IR sensor programming on Atmega8 and Atmega16

post footer border
IR sensor is the acronym of infrared sensor. It is most commonly used in line follower bots , path finder, wall avoid-er or in color detector bots etc.

IR sensor works on the principle of emitting IR rays and receiving the reflected ray by a receiver.

It's significant role in most of the bots makes him an one of the important peripheral of Atmega8 / 16.

Whereas its working is very easy along with its coding. 
It is work similar as a key.

Here is a simple code to check whether your IR sensor is working properly or not.
IR sensor code


In the above code we connected 8 LED's to the PORTB of Atmega8 to check the output.
LS and RS is the left and right sensor respectively.

OUTPUT:-
When LS is TRUE first 1-4 LEDs will glow
When RS is TRUE first 4-8 LEDs will glow


Download the full Project file :

Link 1 :



Recent Posts