2019年8月6日星期二

Mobile Controlled ESP32 Two-Wheel Drive Robot

This project shows you how to make a smartphone-controlled robot using ESP32.

Things used in this project

Hardware components

DFRobot FireBeetle ESP32 IOT Microcontroller (Supports Wi-Fi & Bluetooth) ×1

DC motor (generic) ×2

Analog Comparator, w/ Voltage Ref ×1

DC Motor Driver, Full Bridge ×1

Breadboard (generic) ×1

Wheels ×2

Jumper wires (generic) ×1


Software apps and online services

STEMpedia Dabble

STEMpedia Pictoblox


Story

Today’s project is not going to be based on evive. Today, we’re going to make yet another smartphone-controlled robot but this time using ESP32. It can move forward, back, right, left, and doesn’t need Bluetooth! We’re to program it in PictoBlox, our graphical programming software with advanced interaction capabilities and control it using Dabble, our smart project interaction and controller app.

You can download PictoBlox from HERE and get Dabble on Google Play.

Ready to make the robot?

Let’s begin!



Step 1: List of Components Required

Hardware

ESP32

Motor Driver

Dual Shaft BO Motor

BO Motor Mount

BO Wheel

Caster Wheel

Breadboard

Samsung 3.7V 2600 mAh Lithium-Ion Battery

Acrylic Base Plate

Standoffs

Jumper Cable

Nuts and Bolts


Software

PictoBlox

Dabble


Step 2: Assembly of the 2-Wheel Drive Robot

Attach the motor mounting brackets to the bottom of the chassis using M3 bolts of 8mm length and M3 nuts.

Attach the two Dual Shaft BO motors to the motor brackets on the chassis using M3 bolts of 25mm length and M3 nuts.

Note: Make sure that the motor's wires are faced forward and are inwards.

Next, fit the wheels into the motor shafts.


As ESP32 has no internal battery, we need to supply external power to it. Thus, to hold up the external battery, we need to attach the 3D printed battery holder using M3 nuts and bolts.

As we already know, that for a 2-wheel drive robot we need third support which is the Caster wheel.

Mount three M3 standoffs on the caster wheel. Fasten the caster wheel with the standoffs to the chassis using M3 bolts of 8mm length.

Finally, flip the entire assembly.


Step 3: Connecting ESP32

Connect the ESP32 board, Voltage Regulator and Motor Driver on the Breadboard:

Make the connections as listed below:

Connect battery +ve terminal to the input of 7805 voltage regulator IC and” VIN” of Motor driver IC

Connect its -ve terminal to “GND” of ESP32 Dev Board, ” GND” of Motor Driver IC, “GND “of the Voltage regulator IC ( 7805)

Connect OutPut of voltage regulator IC to” VIN” of ESP32 Dev Board and “VCC” of Motor Driver IC

Connect Motor1 Enable Pin i.e EN1 present on the motor driver IC to pin D14 present on the ESP32 Dev Board. similarly, Connect EN2 to pin D23 of the ESP32 Dev Board

Connect Motor 1 Direction Control Inputs pin (i.e Pin IN A1 and IN A2) to D12 and D13 pin present on the ESP32 Dev Board Respectively.

Connect Motor 2 Direction Control Input pin (i.e Pin IN B1 and IN B2) to D22 and D23 respectively.

Connect one end of motor 1 to OUT A1 and another end to OUT A2.similarly, Connect one end of motor 2 to OUT B1 and another end to OUT B2


Step 4: Complete the Assembly

Once have made the two-wheel drive and the connections, fix the breadboard on your two-wheel robot above the chassis using a Double-sided tape.

Finally, connect a 7.4V Lithium Polymer Battery to ESP32.

Your robot is thus complete.

Step 5: Working of the Robot

We will be controlling the Smartphone using Dabble. Install Dabble and open it on your Smartphone.

Connect the Dabble by clicking on the Connect-Disconnect button and selecting your device's name from the menu. Open Gamepad and there you go!

The robot takes actions according to the button pressed. For example,

Up: Robot will move forward
Down: Robot will move backward
Left: Robot will turn left
Right: Robot will turn right

If none of the buttons is pressed, the robot will stop.


Step 6: PictoBlox- Graphical Code
Working with an ESP has never been this easy. Now just code it by dragging and dropping some blocks in PictoBlox.

You can download PictoBlox from here. Once installed, make the above script and upload it to your board.

Click Here to Download ESP32%2BMobile%2BRobot.sb3


Step 7: Arduino Code

You can also code it using Arduino:

Click Here to Download Mobile%2BControlled%2BESP32%2BRobot.ino


Step 8: Conclusion

With this, your robot is all set to do what you ask it to! ;)


Schematics

Fritzing Diagram for ESP32 robot     Click Here to Download

Code

Click Here to Download Mobile+Controlled+ESP32+Robot.ino (Arduino)

Click Here to Download PictoBlox Code for ESP32 robot (Scratch)

Click Here to Download evive Library (C/C++)

Click Here to Download Dabble Library (C/C++)


This article copied from hackster.io, Author: STEMpedia

没有评论:

发表评论