Pengikut

Banner

Kamis, 02 Juni 2011

robot move LED (Light Emitting Diode) that will easiest

As a beginner, we can learn to make a simple robot first. A robot
can move to follow a thick black line. This robot is commonly called a line
tracker or a line follower. How can this robot follow black line? Surely
needed a sensor, ie proximity sensors. This sensor can be our own.
The principle works is simple, just use the properties of light that will be reflected if
on light-colored objects and will be absorbed if the dark object.
As light source we use LED (Light Emitting Diode) that will
emit red light and to capture the reflection of light we use LEDs
photodiode. If the sensor is located above the black line then photodioda will receive
very little reflected light. But if the sensor is above the white line
photodioda will receive a lot of light reflection. Here is the illustration:




diode resistance became lower. By doing a little modification, the magnitude
resistance can be converted into voltage. So if the sensor is above
black line, then the sensor output voltage will be small, and vice versa.
To be able to read by the microcontroller, the voltage sensor must be adjusted to
TTL voltage levels of 0-1 volts for logic 0 and 3-5 volts for logic 1. In
line tracker robot, needed at least 2 pieces arranged for proximity sensors
both are located right above the black line. Consider the following picture:
In Figure 1 above both fruit proximity sensor above the black line, then
microcontroller will command the robot to move straight. However, if the position
sensors as in Figure 2, the robot should turn right. And if a position sensor
as in Figure 3, the robot should turn left. Thus the robot will
permanent move to follow the black line. Here is a complete range of two sets of sensors
proximity to the robot line tracker:


As the "brain" type of robot used AVR ATmega8535 microcontroller which will
read data from proximity sensors, processes it, then decide the direction
robot movement. On this track the robot line, proximity sensor output is connected to
PortA.0 and PortA.1 on the microcontroller. While connected to the motor driver
PortC.0 s / d PortC.3 as shown in the picture below:
+5 V
+5 V
+5 V
Go Motor Driv er
To the Proximity Sensor
To the Proximity Sensor
Go Motor Driv er
Go Motor Driv er
Go Motor Driv er
U1
ATmega8535
PB.2 (INT2/AIN0)
3


XTAL1
13 XTAL2
12
9 RESET
VCC
10
GND
11
PB.6 (MISO)
7
PB.7 (SCK)
8
PD.0 (RXD)
14
PD.1 (TXD)
15
PD.2 (INT2)
16
PD.3 (INT1)
17
PD.4 (OC1B)
18
PD.5 (OC1A)
19
PD.6 (ICP1)
20
(OC2) PD.7
21
(ADC0) PA.0
40
(ADC1) PA.1
39
(ADC2) PA.2
38
(ADC3) PA.3
37
(ADC4) PA.4
36
(ADC5) PA.5
35
(ADC6) PA.6
34
(ADC7) PA.7
33
(TOSC2) PC.7
29
(TOSC1) PC.6
28
PC.5
27
PC.4
26
PC.3
25
PC.2
24
(SDA) PC.1
23
(SCL) PC.0
22
Aref 32
GND
31
AVCC
30
PB.5 (Vote)
6 PB.4 (SS)
5 PB.3 (OC0/AIN1)
4
PB.1 (T1)
2 PB.0 (XCK/T0)
1
10uF/16V
S1
33pF
33pF
10K
XTAL
11.0592 MHz
SPI PORT
123456
Motion
Motion
SCK
VCC
GND
MISO
SCK
MISO
RESET
Robot Line Tracker By Hendawan Soebhakti
Batam, 11 January 2008 4
To be able to "think", then the microcontroller must be programmed in advance. The following
line robot program is created using the software tracks CodeVisionAVR.
# Include
unsigned char sensor;
void main (void)
{
while (1)
{
sensor = Pina;
sensors & = 0b00000011;
switch (sensor)
{
case 0b00000001: PORTC = 0b00000001; break; / / turn right
case 0b00000010: PORTC = 0b00000100; break; / / turn left
case 0b00000011: PORTC = 0b00000101; break; / / straight forward
case 0b00000000: break;
}
};
}
Once finished creating the program, then we need to "download" it into the
microcontroller.
To move the dc motor, dc motor needs a driver who is IC L298
assembled as shown below:
+12 V
+5 V +12 V
To the AVR (PC.0)
To the AVR (PC.1)
To the AVR (PC.1)
To the AVR (PC.2)
1N4001
MOTOR LEFT
1N4001 1N4001
1N4001
U1
L298
1A1
5
1A2
7
2A1
10
12 2A2
1EN
6
2EN
11
1Y1
2
1Y2
3
2Y1
13
2Y2 14
1E
1
2E
15
RIGHT MOTOR
1N4001 1N4001
1N4001 1N4001
1 1



Tidak ada komentar: