Making a Robot Play Fetch

by Arduino_having11_Guy in Circuits > Robots

2157 Views, 5 Favorites, 0 Comments

Making a Robot Play Fetch

DSC_9461.JPG
DSC_9468.JPG
DSC_9463.JPG

Use the new Pixy2 and a DFRobot ESP32 FireBeetle to create a robot that can find and retrieve items!

Parts

Robot Platform

DSC_9465.JPG

Pixy recently came out with their next version of their Pixy Camera, which can recognize objects and track them. DFRobot sent me one, so I decided to create a robot that can grab an item and then bring it back.

I used a MiniQ robot chassis from DFRobot as the platform that the robot would be built upon. It comes with multiple mounting holes, so I designed a battery riser using Fusion 360 that attaches to a set of holes. Then I mounted the gripper to the front.

Pixy Camera Setup

pixy1.PNG
pixy2.PNG
pixy3.PNG
pixy4.PNG

The makers of the Pixy Camera provide a software called PixyMon, which shows what the camera "sees" and lets users adjust parameters, set interfaces, and create color codes. I downloaded and installed PixyMon from their website here. Then I connected the Pixy2 to my PC via USB and went to the File menu and selected Configure.

First, I set the interface to I2C, as I will be using a non-Arduino board.

Next, I tuned some miscellaneous settings in the expert menu, as seen in the image.

Finally, I got out the block I wanted to use and clicked "Set signature 1" under the Action menu. This sets what the Pixy looks for.

Wiring

schematic.png

Since I setup the Pixy to use the I2C mode, only 4 wires are needed to connect it to the ESP32 FireBeetle. Just connect SDA, SCL, 5V, and GND. Then I wired up the L293D dual H-bridge DC motor driver to pins IO26, IO27, IO9, and IO10, along with power and output, as seen in this image.

Creating the Program

The program "flow" goes as follows:
Find target block

Get width and position

Adjust robot position based on where the block is

Move forward until it gets close enough

Grab object

Reverse backwards

Release object

Using the Robot

DSC_9458.JPG
Fetch Robot with Pixy Computer Vision

I first put up a piece of white paper for the background to prevent other objects from being accidentally detected. Then, I reset the ESP32 and watched it drive towards the object, grab it, and then return it, as seen in the video.