Introduction: Mobile Controlled Line Follower Robot With Obstacle Avoidance
This was just an idea in which several features like obstacle avoiding, line follower, mobile controlled, etc were mixed together and made into a single piece.
All you need is a controller with some sensors and an outfit for this setup. In this, I have made a toy car looking outfit for the setup.
List of components required
1. Arduino (any micro-controller if you are familiar with that.)
2. HCSR-04 Ultrasonic sensor
3. IR sensor (You can buy it or Can make your own like me)
4. HC-05 Bluetooth module
5. L293D motor driver
7. DC motors, wheels and chassis
Step 1: For Making Your Own IR Sensor
It is better to build your own sensor than purchasing it. I had made a sensor first but kept both transmitter and receiver very near which a results in high sensitivity and unable to detect the black color. After making a modification, it worked fine.
List of components required
2. IR led a.k.a Transmitter
3. Photodiode or IR receiver
4. Resistors (100ohm, 2x10Kohm,330ohm)
5. Potentiometer (4.7Kohm)
Connect the components as shown in the circuit diagram on a breadboard and check the working it.
If everything goes well then places the components on the PCB board and solder the components. And test the sensor on the black surface and adjust the sensitivity with a potentiometer as required.
Step 2: Making Body
As already I had mentioned it looks like a toy car. For this, you require a chassis which you can purchase or make yourself. Wheels are connected to motors and motors are attached to chassis.
Generally, all sensors and microcontrollers work on 5v but this 5v is not enough to drive motors so we require a motor diver IC (like L293D). This driver IC drives the motors from the small input voltage with the help of external supply.
The connections for the IC and motors are shown in the circuit diagram.
I have used a small 12V 1A lead acid battery as an external source for motors and 5v power is given by the Arduino.
Step 3: Arduino Connections
Attach all the sensors to the Arduino and program it.
-- Bluetooth module.
Bluetooth power on with a 5V power but the data transmission is done with 3.3V. Arduino has a data transmission power of 5V so we use a voltage divider between Arduino transmit pin and Bluetooth module receiver pin. However, Arduino can take a 3.3V signal so there is no need of voltage divider between the Bluetooth transmitter and Arduino receiver pins.
The connections for the Bluetooth module and Arduino are shown in the circuit diagram.
-- IR sensors
The data pins or signal pins of IR sensors are connected to Arduino's digital pins and note the digital pin numbers. Power to the sensors is given from the Arduino.
-- Ultrasonic sensor
Generally, the Ultrasonic sensor has four pins they are trig, echo, Vcc, and Gnd. The trig pin triggers the sound waves whereas the echo pin receives the sound waves. The trig pin and echo pin of the sensor are connected to Arduino's digital pins which have PWM. The power to the sensor is taken from the Arduino.
The Gnd pin of the buzzer is connected to Gnd of Arduino with a resistor in series is Signal pin of the buzzer is connected to Arduino's digital pin.
-- Motor driver
The connections to motors and motor driver are shown in the previous step. Now input pins of the motor driver IC are connected to Arduino's digital pins and power to IC is taken from the Arduino. However, we are giving an external to the driver IC for driving motor but to work IC 5v power is required which is given by Arduino.
All the connections are made to Arduino and now program the Arduino considering all the input and output pins of Arduino.
Step 4: App Building
There are many platforms for building applications for Android but the easiest platform is MIT App Inventor 2. It's an online app building platform with many examples and guidelines.
I will share the app which I have built and try to build your app so that it will give lots of experience and can customize yourself for the need.
If you have any doubts or queries just comment on this thread.
Password for the app is " makeyourself ".
Step 5: Programming
I will just give an Idea on programming the Arduino. If you have faced any difficulties on writing your code just comment I will try to help you. Importing the file will not give any skills and knowledge. So try to code yourself however if you want the code just comment I will send you the code.
-- Write a code for Ultrasonic to get the distance of an obstacle from the sensor.
-- Write a code for the buzzer and activate it when the distance is below the given value of distance and make the signal of motor driver to low so that motors will stop.
-- Write a code for Bluetooth module using Serial communication and note the data coming from the module when a particular button is pressed on mobile.
-- With that data give signals to the motor driver so that we get a required output.
-- Write a code for IR sensors such that when a signal from particular sensor changes the motor driver signal also changes and will drive the motors according.
If you have any doubts or queries comment below or can reach out to me on my email id