arduino

Simple 4 Whealed Robot – A Beginners Guide

I am getting so many questions from my friends and subscribers who are starting to build their own robots. Some of them are not able to follow everything I do. So lets rewind a little bit. This time, I decided to do something for the beginners who are starting their journey. In this post, I will show you how to build a simple four wheeled robot using Arduino and control it using a joystick. This one is very easy to build and perfect for beginners to get started on robotics.

You Will Need

For this, you will need a chassis; a body to fix everything on, Four Wheels, Two Dummy Wheel Shafts, 2 DC motors, L293D Motor Driver, Arduino UNO and a Battery.

Sponsor Link

This Project is Sponsored by UTSource. UTSource is a professional electronic components supplier.

Get Started

In this Video Tutorial, I have explained each and everything in detail. Take a look at it. First take the chassis and fix the DC motors. Make sure the wheel won’t fall off while it is moving. You will have to tighten the nuts using a spanner. Now take the two dummy wheels shaft and fix it to the chassis. Now tighten all the connections using a spanner.[AdSense-C] Next connect the wheels to all the four shafts. Take a wheel and insert the shaft into it. Now use a screw or a bolt to fix it. Do the same for all the four wheels. Now its time to fix our boards onto the body. Use some double sided tape to stick the boards on the body. First we will fix the arduino. Then the motor driver….

The What??

H-Bridge motor Driver. This is the thing that is gonna drive our DC motors. Click here to know What is an H-Bridge Motor Driver? Read that? Now you know what an H-Bridge is. Now connect the terminals of the motor to the motor driver board. And fix the battery.

The Connections

The connections are easy.[AdSense-B] I connected arduino and L293Ds Motor Driving Power Input Pin to 12 V lithium Polymer battery and connected the 5 V output of Arduino to the Motor Drivers VCC. Connections from Arduino to L293D D3 ——> Input 1 of Motor A D4 ——> Input 2 of Motor A D6 ——> Input 1 of Motor B D7 ——> Input 2 of Motor B 5V ——> VCC of Motor Driver Board GND—-> GND of Motor Driver Board Connections from Arduino to Joystick D13 —–> VCC of Joystick A0 ——> Output 1 of Joystick A1 ——> Output 2 of Joystick GND—–> GND of Joystick

Lets Start Writing

This is the code for moving the bot using the Joystick. Just copy all this and paste it inside arduino IDE.[AdSense-B]
void setup() { pinMode (3, OUTPUT); pinMode (13, OUTPUT); pinMode (4, OUTPUT); pinMode (6, OUTPUT); pinMode (7, OUTPUT); pinMode (A0, INPUT); pinMode (A1, INPUT); pinMode (A2, INPUT); Serial.begin(9600); } void forward() { digitalWrite(3, HIGH); digitalWrite(4, LOW); digitalWrite(6, HIGH); digitalWrite(7, LOW); } void backward() { digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(6, LOW); digitalWrite(7, HIGH); } void left() { digitalWrite(3, HIGH); digitalWrite(4, LOW); digitalWrite(6, LOW); digitalWrite(7, HIGH); } void right() { digitalWrite(3, LOW); digitalWrite(4, HIGH); digitalWrite(6, HIGH); digitalWrite(7, LOW); } void stop() { digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(6, LOW); digitalWrite(7, LOW); } int fb,lr; void loop() { digitalWrite(13, HIGH); fb=analogRead(A0); lr=analogRead(A1); if (fb <= 50) { forward(); } else if (fb >= 900) { backward(); } else if (lr <= 50) { right(); } else if (lr >= 900) { left(); } else { stop(); } }
Upload the sketch and have fun.
Jithin Sanal

View Comments

Recent Posts

Transform Your Trash into Treasure: 10 Genius Ways to Reuse Old Electronics!

Discover creative ways to recycle old electronics into new, useful gadgets. Turn your electronic waste…

7 days ago

Not Just for Lights – Top 10 LED Projects That Will Shock You!

Explore the top 10 advanced LED projects that go beyond basic lighting. Perfect for electronics…

1 week ago

Revolutionizing PCB Fabrication: How UV Resin is Redefining the Art of Circuit Board Design

The integration of UV resin into the PCB production process represents a great achievement and…

1 month ago

Unlock the Secrets to Thriving in Electronics Engineering: A Must-Read Guide for Aspiring Engineers

Discover essential tips for electronics engineering graduates to gain practical experience, from internships to DIY…

2 months ago

Beginners Beware: Must-Have Electronics Tools for Beginners in 2024

Learn essential tips on setting up your workspace, choosing the right tools, and starting your…

2 months ago

2024 Electronics: Top Electronics Trends and Innovations

The electronics sector is about to undergo a revolutionary period that will be characterized by…

2 months ago