WiFi Controlled Robot using Raspberry Pi – Android Controlled Robot

|

How to make an Android Controlled Robot?

Let us build a WiFi Controlled Robot using Raspberry Pi that can be controlled using your mobile phone wirelessly over WiFi, Yes; an Android Controlled Robot. Here, I will be using an App RootSaid – WiFi Command Center to send UDP commands to the listener (Android Controlled Robot). The listener accepts the UDP packets and then uses them to execute a set of instructions to drive the motor. So, How do you build a WiFi Controlled Robot using Raspberry Pi controlled by an android smartphone? Now let’s get started.


Why not make a PCB for your Project?

Making a PCB for your DIY project is not hard nowadays. PCB helps to get rid of all messy wires and stuff and gives your project an awesome look. And it’s cool to make your own PCB for your project right?

I use Altium Designer to draw the circuit and design the PCB. It is a powerful tool that can be used to design and create your own PCBs for your project as well as complex and multiplayer PCBs for industrial use. Here is the link to the Altium trial version. So make sure you check it out.

I use Altium Designer to draw the circuit and design the PCB. It is a powerful tool that can be used to design and create your own PCBs for your project as well as complex and multiplayer PCBs for industrial use. Here is the link to the Altium trial version. So make sure you check it out.


Making an Android Controlled Robot – Components Required

Click on them to purchase from amazon

Instructions


Learning DIY Robotics has Never been so EASY!

DIY Robotics is a fun and easy thing you can learn within a matter of minutes if you have a proper guide. Do you want to learn Robotics but don’t know where to start? Then THIS is for you. Here, we will help you get started with DIY Robotics with easy-to-follow, 100% FREE, step-by-step instructions starting from Robotics basics, parts of Robot, and then we will start complete step-by-step tutorials. Here you will also find an awesome collection of Robotics Project Tutorials from beginner level to advanced for you to get started with DIY Robotics.

Robotics Tutorial for Beginners
Robotics Tutorial for Beginners

Start Learning Robotics


Step 1 – The Chasis of the Robot

The first thing to do is set up the chassis for WiFi Robot using Raspberry Pi. You can build it the way you like. It should have enough space to fix our Raspberry Pi, L293D Motor Driver and a good battery.

WiFi Controlled Robot using Raspberry Pi - Android Controlled Robot
WiFi Controlled Robot using Raspberry Pi – Android Controlled Robot

In this project, I will be using a LiPo Battery. You can use a foam board or light metal sheet for building the base. If you want you can purchase one from here. Here you will find a list of robot chassis you can buy to build a wifi-controlled robot using raspberry pi.

Step 2 – Power Source for your Android Controlled Robot

For our WiFi Controlled Robot using Raspberry Pi, I will be using a 12V Lithium Polymer battery to power up the whole robot, that is the Raspberry Pi and L293D Motor Driver to drive the motors. We can provide 12 V directly to the motor driver Board as it has an inbuilt regulator to power the motor and Circuit separately. But powering raspberry pi with this 12 V battery will fry the Chips. So you will have to use a regulator to step down the 12V to 5V and supply it to Pi. You can Purchase your Lithium Polymer Battery From Here.

Step 3 – Raspberry Pi DC Motor Driving

Android Controlled Robot - DC Motors and Wheels
Android Controlled Robot – DC Motors and Wheels

You can control DC motor using Raspberry Pi using a suitable Driver Board. In this project we will be using 2 DC motors. These DC motors are driven using a Dual H Bridge Motor Driver IC – L293D. More details on driving DC motors using L293D IC can be obtained here. If you are new to this, it is better to go through this proceeding to next step to get a better understanding of the project.

Learn More About L293D Motor Driver IC

Step 4 – Where is the Pi Mommy!

To build a wifi controlled robot using a raspberry pi of course you will need a Raspberry Pi. Raspberry Pi is a low-cost single board computer which can be used for robotics, home automation etc.

Get your Raspberry Pi from Here

Download and burn an OS to a micro SD card and insert it into the raspberry Pi. In this project, I used Raspbian OS. You can download the OS by clicking the below link[AdSense-C]Download

Now power it up. Now fire up your terminal and create a password for the user ‘pi’ by executing the command

sudo passwd pi

Now perform and update and upgrade by running

sudo apt update -y && apt upgrade -y

Step 5 – Setting up the Network of your Android Controlled Robot

Connect your Raspberry Pi to the network and make sure your Raspberry Pi Robot is getting an IP address. Connect your android smart phone to the same address and make sure there is proper connectivity between the android smart phone and the raspberry pi. You can confirm it by pinging your android smart phone from your Raspberry Pi by executing the command

ping <ip address of mobile phone>

Take a note of the IP address of the raspberry Pi robot as we will be using it in the future.

ifconfig

Step 6 – Connections

Raspberry Pi of your Raspberry Pi Robot should be provided with 5V and L293D Motor Driver with 12 V.

For this project, we will be using 6 GPIO pins to control the robot. 33 and 11 for Motor 1, 13 and 15 for Motor 2 and 29 and 31 for Enable Pins. 29 and 31 should be always kept at Logic 1.

Step 7 – Setting Up the Listener

Now all you have to do is set up a listener on the Raspberry Pi WiFi Robot. Download the sketch from the link below and save it as a file named “controller.py”

The Code

Android Controlled Robot - Complete Code
Android Controlled Robot &#8211; Complete Code

Download

Now run the WiFi Robot controller script by executing the command

python controller.py

This will make the Raspberry Pi Wifi Robot listen to port 5050 for incoming UDP packets.

Step 8 – Install RootSaid WiFi Command Center from Google PlayStore to your Android SmartPhone

RootSaid WiFi Command Center is an android app that can be used to control robots and home appliances over WiFi. All you have to do is connect your mobile phone to the network, enter the IP address and Port of the server (the robot) and control it using the arrow button. Click here to know more about this App.

Click Here to Download this app from Playstore.

Step 9 – Let’s Ride the Bot!

WiFi Robot using Raspberry Pi is all set and ready to go.

Now all you have to do is start the App, enter the IP address of the Pi and port it is listening to (5050).

Load the IP and Port using the link button and navigate to the Robot Controller Tab.

Now you can control the robot by simply pressing the forward, backward, left and right buttons.

These DIY Robots are Really Awesome

Google Mobile ALOHA

Google Mobile ALOHA: The Future of Household Robotics

With help from Berkeley University, Meta, and Stanford University, Google created Mobile ALOHA, an AI
Read More

Robotic Revelations: 36 Fun Facts About the World of Robots 2024

From the tiniest nanobots to giant industrial machines, explore the diverse and surprising world of…
Read More

Transforming Learning through Robotics with mBot 2 Neo – Robot Kit for Beginners

mBot2 is a new and powerful smart robot kit for kids developed by Makerblocks to…
Read More
Bio-inspired Robots

Nature’s Blueprint: Bio-Inspired Robots Redefining Innovation

Bio-inspired robots are inspired by nature, incorporating lessons from numerous animals and biological processes to…
Read More

Best DIY Affordable Arduino Robot Dog | Get your own Boston Dynamics Spot!

Petoi BittleX, the new version of Bittle the companion robotic dog.
Read More
Bittle: The Canine Robot Companion Now with Supercool Sensor Pack

Bittle: The Robot Dog Companion Now with Supercool Sensor Pack

Bittle is the first quadrupedal robot dog in the world that is the size of…
Read More
next-generation robots

Next-Generation Robots – The New Era!

As technology continues to advance at an unprecedented pace, the next generation of robots is…

Read More

Let’s Use Arduino To Take Charge Of The Bittle| Petoi Bittle The Arduino Programmable Robot

Hey, guys welcome back. How about making a DIY Arduino robot dog? What if the…

Read More

Petoi Bittle – The Robot Dog Inspired by Boston Dynamics Spot

Hey guys, are you interested in doing a robot dog project? Then, I just wanna…

Read More
bird robot

Engineers Create Perching Bird-Like Robot

Using sensors, 3D printed hardware, and motors, the robot (named SNAG) can perch itself on a…
Read More
Robotic Innovations of 2022

Latest Robotics Innovations | Robots you don’t want to miss in 2022

Innovations in Robotics changed the whole world into a digital era. Check out the latest…
Read More
Creating a Robot for Kids

Complete Beginner’s Guide to DIY Robotics | Robotics For Beginners

Understand the basics of making your own Robots. Let us take a look at what…
Read More

Similar Posts

6 Comments

  1. bu robota ortam sesi dinlemek için neler yapılabilir yada raspberry ile ortam sesi dinlemek mümkünmü

  2. What will be the port no.
    You are mentioning two different port no. In screen shot and content
    We are facing problem in connecting raspberry pi and mobile app

    1. There are no specific ports. Just use the same port number on both robot, and the app.

  3. This android app works well with Mega256 + SEEED WiFi Shield + Cisco Access Point + Samsung S9 tablet. OS: Ubuntu 16.04. IDE: Sloeber Eclipse Plugin 4.3.

    Tricks:
    1> Close reading of the UDP port: 5050 section of this article. This had to be embedded in the Arduino code for the Mega256+WifiShield
    2> Using SEEED wifi_upd.ino and their Example 1 from their WiFi shield support page.
    3> Swapping the “uart(2,3) of Uno for the Mega256 Serial3 and the cross matching of the Mega-TX with Wifi-RX and Mega-RX with Wifi-TX.

    Recommendation:
    1> Replace the “string” with appropriate numeric characters to support Switch-Case usage and avoid string compares.
    2> Annotate the images of the WiFi Command Center. There is too much guessing involved to be user friendly.

    1. I updated my comments from 200602. Please delete those earlier comments.

  4. Nice job on the knowledge transfer.

    This Raspberry robot article was more helpful than the complementary Arduino article.

    The android app, WiFi Command Center, works well with Arduino Mega256 + SEEED WiFi Shield + Cisco Access Point + Samsung S9 tablet. OS: Ubuntu 16.04. IDE: Sloeber Eclipse Plugin 4.3.

    Tricks:
    1> Close reading of the UDP port: 5050 section of this article. This had to be embedded in the Arduino code for the Mega256+WifiShield
    2> Using SEEED wifi_upd.ino and their Example 1 from their WiFi shield support page.
    3> Swapping the “uart(2,3) of Uno for the Mega256 Serial3 and the cross matching of the Mega-TX with Wifi-RX and Mega-RX with Wifi-TX.

    Recommendation:
    1> Replace the “string” with appropriate numeric characters to support Switch-Case usage and avoid string compares.
    2> Annotate the images of the WiFi Command Center. There is too much guessing involved to be user friendly.
    3> The Action1 and Action2 seem ot have different naming conventions in the WiFi Command Center. The UDP packet yields “action 1” for Action1 amd “action2” for Action2. My application was modified to accomodate the “” diference between the two.
    4> Clearing packets for the next UDP packet required some experimenting with delay() values.

Leave a Reply

Your email address will not be published. Required fields are marked *