Line Following Obstacle Avoiding Maze solving Robot part 5
Continue from Part 5
PART1 System DesignPART2 Mechanical designPART3 Motor controlPART4 Electronic integration PART5 Softwear devolopment PART6 Final Code
Actuators:
DC geared motor:
They’re cheap, and available in multiple variations of speed and torque. Some even come with gear sets, so you can customize it to best suit your robot. The disadvantage is you have no internal feedback control. That means you have no idea of the speed of the motor.
A word of caution here, the speed mentioned in the motor stats represents what is called the “no-load” speed of the motor. The motor will never run at that speed when you fix a chassis and all your components onto it. Pick a motor with a low voltage rating. This means, just for example, you should pick a 6V motor over a 24V motor. Motors with lower ratings are generally lighter.
A geared DC Motor has a gear assembly attached to the motor. The speed of motor is counted in terms of rotations of the shaft per minute and is termed as RPM .The gear assembly helps in increasing the torque and reducing the speed. Using the correct combination of gears in a gear motor, its speed can be reduced to any desirable figure. This concept where gears reduce the speed of the vehicle but increase its torque is known as gear reduction. This Insight will explore all the minor and major details that make the gear head and hence the working of geared DC motor.
Specifications:
1. 100 RPM 12V DC motors with metal Gearbox.
2. Shaft diameter: 6mm.
3. Gearbox diameter 37 mm.
4. Motor Diameter 28.5 mm
5. Length 63 mm without shaft
6. Shaft length 15mm
7. Weight: 300 gm.
8. 10Kgcm torque.
9. No load current: 800mA (Max).
DC gear motor:
Interfacing to Arduino board:
Display:
Circuit
To wire your LCD screen to your Arduino, connect the following pins:
-
LCD RS pin to digital pin 12
-
LCD Enable pin to digital pin 11
-
LCD D4 pin to digital pin 5
-
LCD D5 pin to digital pin 4
-
LCD D6 pin to digital pin 3
- LCD D7 pin to digital pin 2
- Additionally, wire a 10K pot to +5V and GND, with its wiper (output) to LCD screens VO pin (pin3).
If we look at the Arduino LiquidCrystal library that you can use to interact with the LCD display, all we need from this table is:Liquid Crystal (rs, rw, enable, d4, d5, d6, d7)
Interfacing LCD connection to Arduino board:
Pin configuration of Interfacing LCD to Arduino :
LCD Pin Number | Symbol | Function |
1 | Vss | Display power ground |
2 | Vdd | Display power +5V |
3 | Vo | Contrast Adjust. Altered by adjusting the voltage to this pin, grounding it sets it to maximum contrast. |
4 | RS | Register select |
5 | R/W | Data read/write selector. Its possible to read information from a display however there's no need for it here so grounding it sets it permanently write. |
6 | E | Enable strobe |
7 | DB0 | Data Bus 0 |
8 | DB1 | Data Bus 1 |
9 | DB2 | Data Bus 2 |
10 | DB3 | Data Bus 3 |
11 | DB4 | Data Bus 4 |
12 | DB5 | Data Bus 5 |
13 | DB6 | Data Bus 6 |
14 | DB7 | Data Bus 7 |
15 | A | LED backlight power +5V |
16 | K | LED backlight power ground |
Programming part:
-
Line follow with maze solve program
int r1 = 12; //BROWN
int r2 = 13; //BLACK
int l1 = 11; //BLUE
int l2 = 10;//GREEN
int rs = 8;//GREEN SEN
int ls = 9;//ORENG
int a,b,c;
void setup() {
Serial.begin(9600);
pinMode(r1, OUTPUT);
pinMode(r2, OUTPUT);
pinMode(l1, OUTPUT);
pinMode(l2, OUTPUT);
pinMode(rs, INPUT);
pinMode(ls, INPUT);
}
void loop() {
a=digitalRead(ls);
b=digitalRead(rs);
c=analogRead(A0);
delay(1);
if (c > 500 )
{
digitalWrite(r1, HIGH);
digitalWrite(r2, LOW);
digitalWrite(l1, LOW);
digitalWrite(l2, HIGH);
Serial.println(c);
delay(700);
}
if(a==HIGH && b==HIGH)
{
digitalWrite(r1, HIGH);
digitalWrite(r2, LOW);
digitalWrite(l1, HIGH);
digitalWrite(l2, LOW);
}
else if(a==LOW && b==HIGH)
{
digitalWrite(r1, HIGH);
digitalWrite(r2, LOW);
digitalWrite(l1, LOW);
digitalWrite(l2, LOW);
}
else if(a==HIGH && b==LOW)
{
digitalWrite(r1,LOW );
digitalWrite(r2, LOW);
digitalWrite(l1, HIGH);
digitalWrite(l2, LOW);
}
else if(a==LOW && b==LOW)
{
digitalWrite(r1,LOW);
digitalWrite(r2, LOW);
digitalWrite(l1, HIGH);
digitalWrite(l2, LOW);
}
}
/*else {
digitalWrite(r1, HIGH);
digitalWrite(r2, LOW);
digitalWrite(l1, LOW);
digitalWrite(l2, HIGH);
delay (800);
}
Comments