Lecturer:
Lab instructor:
Nathaniel McVical
Pham Xuan Trung
Nguyen The Nghia
09ES
Trn Vit Tun
L Ch Cng
L Hong Nht
2. Introduction
In the previous version, we did build a design and implementation of line follower
robot. In this project we show that how our design works in pratical. Futhermore, we focus on
the components operation by performing many test cases. The main target is that our circuit go
well and robot can follow line. In the final version we keep the same design as midterm report.
3. Discussion
3.1 Design
Discussion design:
Requirement definition
Robot must go in line correctly
Low- cost
Not too large in size
System Specification
- Microcontroller will control motor go in line correctly with two LDR sensor takes
value from ground (Black or white).
- Material to do robot is easy to buy in shop with low cost such as: geared motor,
resistors, Light dependent resistor (LDR), some ICs...
- Size of robot about with CDs disk in diameter.
Function
Turn right
When right LDR meet black line, the left motor will rotate faster than right motor.
Cross intersection
If robot go to intersection, two LDR meet black line. We can improve that by the way is
to ignore two LDR sensors and also two motor go straight.
T junction
The problem here is to have both sensors detect the line at the same time !. However,
the msp430 will know the line has made a turn and we can program it to ignore the
Search mode
However at the higher speeds our robot could lose the line or skid off the track so it is
normal to include a sub routine in program to help the robot find the line again. In its
simplest form, one simply makes the robot move in a circle until it picks up the line
again. If the robot cannot find the line within a reasonable time then the msp430 can
power down the whole robot to conserve the batteries.
Architectural design
Prototyping
Debugging
Hardware:
- Use voltmeter to check all voltages needed .
- Connect ports on MSP430G2231 to motor corresponding.
- Connect input from signal of LDR to IC MSP430.
Software:
- Using Texas Instruments Code Composer Studio Core Edition version 4.2.1.00004 MSP430
to write and debug code.
- Use oscilloscope to check signal PWM.
- Use Laboratory power supply
Testing
- We check the left or right motor and consider if it move when the left or right sensor meet
black line. This is to guarantee that the signal of sensor being active.
- Checking speed of motor when we change the color of ground.
Block Diagram:
Battery
Left motor
Microcontroller MSP430
Sensor
ADC
PWM
Motor
driver
Right motor
Parts list:
1. Resistors: 220 (2), 470 (1), 100 (4), 22K (2)
2. Light Dependent Resistor (2)
3. Capacitors 0.1uF (3), 1uF (1)
4. Diodes: 1N4004
5. IC: LM1117 3.3 volt voltage regulator
6. Texas Instruments MSP430 Value Line LaunchPad Development Board
7. Texas Instruments MSP430G2231 microcontroller.
8. DC Motor: DC geared motor with Wheel
9. Motor control module L298N
10. One reset push button switch
11. Perforated PCB
12. 4 x AA Battery holder
13. CD/DVD ROM
14. Bolt, Nuts, Double Tape and Standard Electrical Tape for the black line
3.2. Implementation
3.2.1 Sensor Working Principle
This Line Follower Robot design used the photocell sensor known as a Light Dependent
Resistor (LDR) made from Cadmium Sulphide (CdS) to detect the black track line, when
the LDR is above the black track line it will give a high resistance value while above the
white background and it will give a low resistance value. Together with the 22K resistor,
they will form whats known as the voltage divider circuit. This voltage divider circuit
sensor will provide the varying voltage according to the amount of the light intensity
reflected back to the LDR. The blue Light Emitting Diode (LED) will provide a constant
light source for the sensors.
Figure 2: The Line Follower Robot Photocall (LDR) Sensor Working Principle
10
11
12
13
3.2.6 Programming
#include<msp430g2231.h>
#define L_MOTOR BIT0
// Left Motor
// Right Motor
// sensor led
14
15
16
17
18
19
4.2 Result
In general, we completed our robot as we designed. However, we have a big problem
with power supply for circuit. The pwm signal as well as photo resistor run well but the
unstable voltage make our circuit fail (The MSP430G2231 microcontroller can not work with a
unproperly voltage). We will describe more about the problem in summary section.
20
6. Work Assignment:
There are 3 members in our group.
1. Le Hoang Nhat: (60 hours)
-Design UML diagram
-Work on circuit
-Implement components
-Testing
-Write Report
- Presend demo
2. Tran Viet Tuan: (60 hours)
21
22