Revolutionizing Robotics: Building a Human-Following Robot with Arduino Uno and Cutting-Edge Sensors

Explore the future of robotics with our step-by-step guide on creating a human-following robot using Arduino Uno, IR sensors, ultrasonic sensors, L293D motor driver shield, 4 DC motors, and a powerful 18650 battery. Unleash your creativity and embark on a journey into the world of DIY robotics.


Introduction


Discover the endless possibilities of robotics as we guide you through the process of building a human-following robot using the latest technology. Our comprehensive tutorial leverages the power of Arduino Uno, IR sensors, ultrasonic sensors, an L293D motor driver shield, 4 DC motors, and a high-capacity 18650 battery. Dive into the exciting world of DIY robotics and learn how to bring your creation to life.






Understanding the Components


Learn about the key components that make up your human-following robot. From the brainpower of Arduino Uno to the precision of IR sensors and ultrasonic sensors, each element plays a crucial role in creating an intelligent and responsive robot. Explore the capabilities of the L293D motor driver shield and the energy efficiency of the 18650 battery.


Step by Step Assembly


Follow our detailed step-by-step instructions to assemble your robot. We'll guide you through the wiring of Arduino Uno, connecting IR sensors for obstacle detection, integrating ultrasonic sensors for distance measurement, and utilizing the L293D motor driver shield to control the movement of 4 DC motors. Watch as your robot takes shape and becomes a technological marvel.





Programming your Robot


Unlock the potential of your robot by delving into the programming side. Gain insights into coding for sensor integration, motor control, and the logic needed for your robot to follow humans accurately. Our user-friendly code snippets and explanations make the programming process accessible even for beginners.


-----------------------------------------------------------------------------------

//https://www.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g //
// Human Following Robot version 2.0 //
// MOHD SOHAIL //

#include<Servo.h> #include<AFMotor.h> #define RIGHT A2 #define LEFT A3 #define trigpin A4 #define echopin A5 AF_DCMotor Motor1(1,MOTOR12_1KHZ); AF_DCMotor Motor2(2,MOTOR12_1KHZ); AF_DCMotor Motor3(3,MOTOR34_1KHZ); AF_DCMotor Motor4(4,MOTOR34_1KHZ); Servo myservo; int pos =0; long time; void setup(){ // put your setup code here, to run once: Serial.begin(9600); myservo.attach(10); for(pos = 90; pos <= 160; pos += 1){ myservo.write(pos); delay(15); } for(pos = 160; pos >= 0; pos-= 1) { myservo.write(pos); delay(15); } for(pos = 0; pos<=90; pos += 1) { myservo.write(pos); delay(15); } pinMode(RIGHT, INPUT); pinMode(LEFT, INPUT); pinMode(trigpin, OUTPUT); pinMode(echopin, INPUT); } void loop(){ unsigned int distance = read_cm(); int Right_Value = digitalRead(RIGHT); int Left_Value = digitalRead(LEFT); Serial.print("R= "); Serial.print(Right_Value); Serial.print(" L= "); Serial.print(Left_Value); Serial.print(" D= "); Serial.println(distance); if((Right_Value==1) && (distance>=10 && distance<=30)&&(Left_Value==1)){forword();} else if((Right_Value==0) && (Left_Value==1)){turnRight();} else if((Right_Value==1) && (Left_Value==0)){turnLeft();} else if((Right_Value==1) && (Left_Value==1)){stop();} else if(distance > 6 && distance < 10){stop();} else if(distance < 6){backword();} delay(50); } long read_cm(){ digitalWrite(trigpin, LOW); delayMicroseconds(2); digitalWrite(trigpin, HIGH); delayMicroseconds(10); time = pulseIn (echopin, HIGH); return time / 29 / 2; } void forword(){// turn it on going forward Motor1.setSpeed(120); Motor1.run(FORWARD); Motor2.setSpeed(120); Motor2.run(FORWARD); Motor3.setSpeed(120); Motor3.run(FORWARD); Motor4.setSpeed(120); Motor4.run(FORWARD); } void backword(){ // the other way Motor1.setSpeed(100); Motor1.run(BACKWARD); Motor2.setSpeed(100); Motor2.run(BACKWARD); Motor3.setSpeed(100); Motor3.run(BACKWARD); Motor4.setSpeed(100); Motor4.run(BACKWARD); } void turnRight(){ // the other right Motor1.setSpeed(200); Motor1.run(FORWARD); Motor2.setSpeed(200); Motor2.run(FORWARD); Motor3.setSpeed(100); Motor3.run(BACKWARD); Motor4.setSpeed(100); Motor4.run(BACKWARD); } void turnLeft(){ // turn it on going left Motor1.setSpeed(100); Motor1.run(BACKWARD); Motor2.setSpeed(100); Motor2.run(BACKWARD); Motor3.setSpeed(200); Motor3.run(FORWARD); Motor4.setSpeed(200); Motor4.run(FORWARD); } void stop(){ // stopped Motor1.setSpeed(0); Motor1.run(RELEASE); Motor2.setSpeed(0); Motor2.run(RELEASE); Motor3.setSpeed(0); Motor3.run(RELEASE); Motor4.setSpeed(0); Motor4.run(RELEASE);
}

-----------------------------------------------------------------------------------

Testing and Troubleshooting


Put your robot to the test and troubleshoot any issues that may arise. Learn how to fine-tune sensor sensitivity, adjust motor movements, and optimize battery usage. Our troubleshooting guide ensures a smooth transition from assembly to operation.


Conclusion

Embark on a journey of innovation and discovery with our guide to building a human-following robot. Combine the power of Arduino Uno, IR sensors, ultrasonic sensors, L293D motor driver shield, 4 DC motors, and a reliable 18650 battery to create a cutting-edge robotic companion. Embrace the future of DIY robotics and witness the incredible possibilities that lie ahead. Start your adventure today!




Watch out more contents here :

1. Human Following Robot : click here
2. How to make Long Range Android Car : click here
3. Ph sensor simulation using Proteus : click here

Post a Comment

0 Comments