Introduction: THE ULTIMATE FOLLOWER

helllo friends

Here we are going to build a ine follower along with the object follower

so the first step is to complete making th line follower and then we will switch on to the object following robot

so the list of parts you we will be needing is ,which i havce divided into two set

PARTS

1)a standard simple robot chasis 2) two dc geared dc motor 150 RPM 3)arduino uno 4) three IR sensor 4)wheels for motors 5) H-bridge LM293D motor driver module 6) jumper cables 7)battery 12volts 8) line following path 9)a green flouroscent ball 10) two servo micro motor (9g) 11)pixycam

you can also prefer to buy this thing onlin

http://www.ebay.in/itm/-/252926949691?

Step 1: Step 1: Gather All the Material

gather this item and start joining them as per the schematic diagram mentioned.

and download the code below and using the ARDUINO.IDE in your laptop upload the code into your arduino board

/*this code is totally developed by Milin Parekh www.instagram.com/build_more/

*/

const int sensorPin = 8; // the number of the pushsensor pin

const int sensorPin1 = 9; // the number of the pushsensor pin const int sensorPin2 = 10; // the number of the pushsensor pin const int motor1 = 13; // the number of motor pin 1 const int motor2 = 12; // the number of motor pin 1

// variables will change: int sensorState = 0; // variable for reading the pushsensor status int sensorState1 = 0; // variable for reading the pushsensor status int sensorState2 = 0; // variable for reading the pushsensor status

void setup() { // initialize the LED pin as an output: pinMode(motor1, OUTPUT); // initialize the pushsensor pin as an input: pinMode(sensorPin, INPUT); pinMode(motor2, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT);

}

void loop() { pinMode(4, HIGH); pinMode(5, HIGH); // read the state of the pushsensor value: sensorState = digitalRead(sensorPin); sensorState1 = digitalRead(sensorPin1); sensorState2 = digitalRead(sensorPin2);

// check if the pushsensor is pressed. // if it is, the sensorState is HIGH: if (sensorState == HIGH && sensorState1 == LOW && sensorState2 == LOW) { // turn LED on: digitalWrite(motor1, HIGH); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == HIGH && sensorState2 == HIGH) { // turn LED on: digitalWrite(motor1, HIGH); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == HIGH && sensorState2 == LOW) { // turn LED off: digitalWrite(motor1, LOW); digitalWrite(motor2, HIGH); } else if (sensorState == HIGH && sensorState1 == LOW && sensorState2 == HIGH) { // turn LED off: digitalWrite(motor1, LOW); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == LOW && sensorState2 == HIGH) { // turn LED off: digitalWrite(motor1, HIGH); digitalWrite(motor2, LOW); } else if (sensorState == HIGH && sensorState1 == HIGH && sensorState2 == LOW) { // turn LED off: digitalWrite(motor1, HIGH); digitalWrite(motor2, LOW); } else if (sensorState == HIGH && sensorState1 == HIGH && sensorState2 == HIGH) { if (sensorState == HIGH && sensorState1 == LOW && sensorState2 == LOW) { // turn LED on: digitalWrite(motor1, HIGH); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == HIGH && sensorState2 == HIGH) { // turn LED on: digitalWrite(motor1, HIGH); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == HIGH && sensorState2 == LOW) { // turn LED off: digitalWrite(motor1, LOW); digitalWrite(motor2, HIGH); } else if (sensorState == HIGH && sensorState1 == LOW && sensorState2 == HIGH) { // turn LED off: digitalWrite(motor1, LOW); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == LOW && sensorState2 == HIGH) { // turn LED off: digitalWrite(motor1, HIGH); digitalWrite(motor2, LOW); } else if (sensorState == HIGH && sensorState1 == HIGH && sensorState2 == LOW) { // turn LED off: digitalWrite(motor1, HIGH); digitalWrite(motor2, LOW); } }

else if (sensorState == LOW && sensorState1 ==LOW && sensorState2 == LOW) { if (sensorState == HIGH && sensorState1 == LOW && sensorState2 == LOW) { // turn LED on: digitalWrite(motor1, HIGH); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == HIGH && sensorState2 == HIGH) { // turn LED on: digitalWrite(motor1, HIGH); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == HIGH && sensorState2 == LOW) { // turn LED off: digitalWrite(motor1, LOW); digitalWrite(motor2, HIGH); } else if (sensorState == HIGH && sensorState1 == LOW && sensorState2 == HIGH) { // turn LED off: digitalWrite(motor1, LOW); digitalWrite(motor2, HIGH); } else if (sensorState == LOW && sensorState1 == LOW && sensorState2 == HIGH) { // turn LED off: digitalWrite(motor1, HIGH); digitalWrite(motor2, LOW); } else if (sensorState == HIGH && sensorState1 == HIGH && sensorState2 == LOW) { // turn LED off: digitalWrite(motor1, HIGH); digitalWrite(motor2, LOW); } } }

Step 2: Step 2: Uploading Code and Joining Parts

join the component listed as per the schematics shown here and the thing is done to move

Step 3: Step 3

now attach the green fluorcent ball as you have seen in the images, to the line follower.

Step 4: Step 4 :Now the Object Followig Part

you must download and install the pixy mony cam softwarare into you desktop to program the camera

nothing to do much just easily connect the cam to the lapotp or pc and open the software and get the image of object you want to follow upon

Step 5: Step 5: S O F T W a R E

clikc on the ACTION menu and then to et signature and then keep the object in front of the camera and then with th hwlp of mouse select the portion colour of the object you want to follow and then clik on the RUN option in action menu.

and then you will see the camera will follow on to the object wherewer it goes

this canera has the range of 180 degree as a servo motor is used .

Step 6: Step6: Pixycam

this camera a best version for automatd following programs

it has microcontroller which works on the ADLAB

and it has pre defined slots for the servo motor as servo 1 and servo 2

so you only have to insert the servo motor intothe slots and give the supply to the camera andsetup all things as mentioned in STEP 5.

still you you guys faces any qustion regarding my stuffs then do mention it in the comments,,, or mail me (milinparekh93@gmail.com)

Comments

author
Swansong (author)2017-05-08

It looks like it works really well :) It's pretty responsive.

author
MilinP2 (author)Swansong2017-06-22

yes it works very easily and well

About This Instructable

233views

2favorites

License:

More by MilinP2:VOICE CONTROLLED ARDUINO ROBOTLED CUBE 3x3x3THE ULTIMATE FOLLOWER
Add instructable to: