You are on page 1of 10

8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Search...

Welcome visitor you can Login or create an account

n Robotics, Embedded System, Arduino and others starting are from 1st May.      Hurry Up !!!      Limited Seats Only.      Book Your Seat Now.         Click Here to Know More

Home Electroshop Knowledge Centre Educational Workshops Training Programs Engineering Projects More

ABLab Solutions > Knowledge Centre > Sample Codes > Peripheral Features > ADC > Light Follower Robot with ATmega16 using Analog Light Sensor

Light Follower Robot with ATmega16 using Analog Light Sensor Knoweldge Centre
The light following robot is a mobile machine which is capable of detecting and following the light source on the
Sample Codes
travelling path. The concept of this light following robot is very simple. It includes two LDR sensors, one on the front
Softwares
and other on the back. When the light falls on the front LDR sensor, the robot will move in the forward direction.
Similarly, the robot will move in the backward side when the light falls on the back LDR sensor.
Most Popular Posts
In this project, we will learn How to design a light follower robot with AVR ATmega16 microcontroller using Analog
light Sensor. This robot is an automatic robot i.e no manual control is needed. The robot will move either in forward Line Follower Robot with
direction or in backward direction depending on which direction intensity of light is more. Here, we will use two ATmega16 using Analog IR
Sensor
analog light sensors to measure the intensity of light. The two sensors will be placed in the front side and back side 19,325 views

of the robot. When there is a change in intensity of light on any side of robot, the output of that particular side’s
16X2 Alphanumeric LCD Interfacing
analog light sensor value changes and this change will be detected by the ATmega16 microcontroller. But the ATmega16
14,185 views
outputs of the two analog light sensors are analog in nature, so these signals cannot be processed directly by the
microcontroller. For this, we will use the ADC of the ATmega16 microcontroller to convert the analog signals to
LED Blinking with ATmega16
digital values. After converting the analog signals of analog light sensors to digital values, the ATmega16 14,008 views

microcontroller will compare the sensor values with each other. If the front sensor value is less than back sensor
value, the ATmega16 microcontroller will send the forward control signal to the DC motor driver (L293D) of the
L293D based DC Motor Driver
robot to move the robot in forward direction and if the back sensor value is less than front sensor value, the Interfacing with ATmega16 in
ATmega16 microcontroller will send the backward control signal to the DC motor driver (L293D) of the robot to 5V Mode
9,583 views
move the robot in backward direction. The above processes of ADC conversions, sensors output comparison and
robot control continues forever till the power source is there. 4X4 Keypad Interfacing with
ATmega16 and LCD Display
8,585 views

Hardwares Required
PC to ATmega16
Communication with LED
AVR Trainer Board-100-1pc
Display
AVR USB Programmer-1pc 8,201 views

12V, 1A DC Adapter-1pc
SinaProg Hex Downloader
Analog Light Sensor-2pcs Software
7,968 views
DC Motor Driver-1pc
Robot-1pc Accelerometer based Hand
1 to 1 Connector-7pcs Gesture Controlled Robot
with ATmega32
10 to 10 FRC Female Connector-2pcs 7,890 views

USB AM-AF Cable(Optional)-1pc


Obstacle Avoider Robot with
ATmega16 using Analog IR
Softwares Required Sensor
6,765 views

AVR Studio 4
16X2 Alphanumeric LCD
WinAVR -2010 Interfacing with ATmega32
SinaProg Hex Downloader 6,700 views

USBasp Driver

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 1/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Circuit Diagram Analog IR Sensor Interfacing


with ATmega16 and LED
Display
6,684 views

LM35 Temperature Sensor Interfacing


with ATmega32 and LCD Display
6,415 views

Accelerometer based Hand


Gesture Controlled Robot
with ATmega16
6,091 views

EM-18 RFID Reader


Interfacing with ATmega16
5,882 views

L293D based DC Motor Driver


Interfacing with ATmega16 in
PWM Mode
5,624 views

HC-06 Bluetooth Module


Interfacing with ATmega32
5,344 views

L293D based DC Motor Driver


Interfacing with ATmega32 in
PWM Mode
5,101 views

LM35 Temperature Sensor


Interfacing with ATmega16
and 7 Segment Display
4,924 views

DTMF based
Mobile/Cellphone Controlled
Robot with ATmega16
4,473 views

DS1307 RTC Interfacing with


C Program ATmega16 and LCD Display
4,037 views

//**************************************************************// Line Follower Robot with


//System Clock                          :1MHz ATmega32 using Analog IR
Sensor
//Software                                 :AVR Studio 4 3,904 views

//**************************************************************//
7-Segment Display Interfacing with
ATmega16
#include<avr/io.h> 3,896 views

/*Includes io.h header �le where all the Input/Output Registers and its Bits are de�ned for all AVR
microcontrollers*/

#de�ne           F_CPU           1000000 Relay Interfacing with


ATmega16
/*De�nes a macro for the delay.h header �le. F_CPU is the microcontroller frequency value for the delay.h header 3,861 views

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


Horizontal Scrolling in 16X2
Alphanumeric LCD with
#include<util/delay.h>
ATmega16
/*Includes delay.h header �le which de�nes two functions, _delay_ms (millisecond delay) and _delay_us 3,835 views

(microsecond delay)*/

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 2/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

#include<avr/adc.h> DS1307 RTC based Digital


/*Includes adc.h header �le which de�nes di㫘�erent functions for Analog to Digital Converter. ADC header �le Clock Designing in 24 Hour
Format with ATmega32 and
version is 1.1*/
7-Segment Display
3,824 views

int main(void)
LED Interfacing with
{ ATmega16
3,811 views

DDRB=0x0f;
HC-06 Bluetooth Module
/*PB0,PB1,PB2 and PB3 pins of PortB are declared output ( i/p1,i/p2,i/p3,i/p4 pins of DC Motor Driver are
Interfacing with ATmega16
connected )*/ 3,785 views

EM-18 RFID Reader


int front_sensor_value,back_sensor_value;
Interfacing with ATmega32
/*Variable declarations*/ 3,732 views

PC Controlled Robot with


adc_init();
ATmega16
/*ADC initialization*/ 3,713 views

PC to ATmega32
/*Start of in�nite loop*/
Communication with LCD
while(1) Display
{ 3,546 views

3-axis Accelerometer Sensor-


front_sensor_value=read_adc_channel(0); ADXL335 Interfacing with
/*Reading front light sensor value*/ ATmega16
3,520 views

back_sensor_value=read_adc_channel(1); 00 to 99 Display in Quad 7-


Segment Display with
/*Reading back light sensor value*/
ATmega16
3,410 views

/*Comparing the front and back light sensor value*/


128X64 Graphical LCD
if(front_sensor_value < back_sensor_value)
Interfacing with ATmega16
{ 3,334 views

HC-05 Bluetooth Module


PORTB=0x0a;
Interfacing with ATmega32
/*Robot will move in forward direction*/ 3,195 views

00 to 99 Display in Quad 7-
}
Segment Display with
else if(back_sensor_value < front_sensor_value) ATmega32
3,137 views
{
Analog to Digital Converter of
PORTB=0x05; ATmega16 with LED Display
3,127 views
/*Robot will move in reverse direction*/

}
else
4X4 Keypad Interfacing with
{ ATmega32 and LCD Display
3,087 views

;
Character Display in 128X64
/*Null statement*/ Graphical LCD with
ATmega32
} 2,828 views

20X4 Alphanumeric LCD


} Interfacing with ATmega16
2,807 views

}
DS1307 RTC Interfacing with
ATmega32 and LCD Display

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 3/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Connection Guide 2,725 views

The step-by-step connection guide for Light Follower Robot with ATmega16 using Analog Light Sensor project is as
follows: Products on Sale
Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.
Sale!

Tech Ambassador Program
AVR Trainer Board and Programmer

Combo

Rs.1,100.00
Rs.1,000.00

Add to cart

Connect PortB header of AVR Trainer Board-100 with Input header of DC Motor Driver with a 10 to 10 FRC
Sale!
Female Connector.

AVR Trainer Board-100

Rs.800.00
Rs.700.00

Add to cart

Sale!

Connect the 12V pin of PWM & Motor Voltage header of DC Motor Driver with the 12V header of AVR Trainer
Board-100 with a 1 to 1 Connector.


ABLab Solutions

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 4/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Powered by WordPress Popup

Tech Ambassador Program
AVR USB Programmer

Rs.350.00
Rs.300.00

Add to cart

Find us on Facebook

Connect the Robot connector to the Output header of the DC Motor Driver.

Switch o㫘� the Mode Switch of DC Motor Driver.


ABLab Solutions

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 5/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Powered by WordPress Popup

Tech Ambassador Program
Connect the VCC and GND pins of two Analog Light Sensor with 5V and GND header pins of AVR Trainer Board-
100 with 1 to 1 connectors.

Connect the O/P pins two Analog Light Sensor with PA0 and PA1 pins of PortA header of AVR Trainer Board-100
with 1 to 1 Connectors.


ABLab Solutions

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 6/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Powered by WordPress Popup

Tech Ambassador Program
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/Laptop’s USB Port directly or with the help of USB AM-AF Cable.


ABLab Solutions

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 7/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Powered by WordPress Popup

Tech Ambassador Program
Download Light Follower Robot with ATmega16 using Analog Light Sensor Hex �le to AVR Trainer Board-100 with
the help of SinaProg Hex downloader and AVR USB Programmer.

Switch on the power with the help of Power Switch of AVR Trainer Board-100 and see the output.


ABLab Solutions

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 8/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Powered by WordPress Popup

Tech Ambassador Program
Download Materials

Light Follower Robot with ATmega16 using Analog Light Sensor Code v1.1 174 downloads   13.16 KB

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

ADC Header File v1.1 4882 downloads   1.88 KB

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

Related Posts

Light Follower Robot with ATmega32 using Analog Light Sensor


Analog Light Sensor Interfacing with ATmega16 and LCD Display
Analog Light Sensor Interfacing with ATmega16 and LED Display
Digital Light Sensor Interfacing with ATmega16 and LCD Display-Analog Output
Digital Light Sensor Interfacing with ATmega16 and LED Display-Analog Output
Analog Light Sensor Interfacing with ATmega32 and LED Display
Analog Light Sensor Interfacing with ATmega32 and LCD Display
Digital Light Sensor Interfacing with ATmega32 and LED Display-Analog Output
Digital Light Sensor Interfacing with ATmega32 and LCD Display-Analog Output
Line Follower Robot with ATmega16 using Analog IR Sensor
Obstacle Follower Robot with ATmega16 using Analog IR Sensor
Line Follower Robot with ATmega32 using Analog IR Sensor
Obstacle Follower Robot with ATmega32 using Analog IR Sensor
Digital Light Sensor Interfacing with ATmega16 and LCD Display-Digital Output
Digital Light Sensor Interfacing with ATmega16 and LED Display-Digital Output
Digital Light Sensor Interfacing with ATmega32 and LCD Display-Digital Output
Digital Light Sensor Interfacing with ATmega32 and LED Display-Digital Output
Obstacle Avoider Robot with ATmega16 using Analog IR Sensor
Edge Detector Robot with ATmega16 using Analog IR Sensor 
ABLab Solutions
Edge Detector Robot with ATmega32 using Analog IR Sensor

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 9/10
8/9/2016 Light Follower Robot with AVR ATmega16 Microcontroller using Analog Light Sensor

Powered by WordPress Popup


One thought on “Light Follower Robot with ATmega16 using Analog Light
Sensor”

Pingback: Light Follower Robot with AVR ATmega16 Microcon...

Leave a Reply

Tech Ambassador Program
You must be logged in to post a comment.

Sitemap | Privacy Policy | Terms & Conditions Copyright © 2016 ABLab Solutions Powered by SPIS


ABLab Solutions

http://www.ablab.in/llight­follower­robot­with­avr­atmega16­microcontroller­using­analog­light­sensor/ 10/10

You might also like