Object Follower Robot (with MBot + Pixy)

by Mech-Dickel in Circuits > Robots

15221 Views, 45 Favorites, 0 Comments

Object Follower Robot (with MBot + Pixy)

DSC07063_2.jpg
Tutorial: how to make an object follower robot (with mBot + Pixy)

Robots are cool. Robots that run around even more... but robots that follow things are awesome!

So, what about making one in a few easy steps?!?!

In the video you can see the whole work, but here I'll describe better each step and share more pictures.

But first, let's list all the needed materials/parts and tools.

Materials/parts:

  • a Makeblock mBot;
  • a Pixy CMUcam5 Image Sensor;
  • a RJ25 to Dupont Wire (from Makeblock);
  • electrical tape;
  • a power supply for mBot;
  • template for a custom bracket (to attach Pixy to mBot);
  • 2mm thick polystyrene sheet (a small piece);
  • sandpaper;
  • spray paint.

Tools:

  • USB cables (for mBot and for Pixy);
  • screwdriver;
  • utility knife.

You will also need a computer to code the mBot and configure Pixy. After that, you no longer need the computer to play with the object follower robot.

Assembling the MBot

Assembly: Makeblock mBot (Bluetooth version)

Assembling a mBot is quite easy and quick.

If your mBot is not assembled yet, you can follow the steps in the above video. Just skip the assembly of the Ultrasonic Sensor.

If your mBot is already assembled, just remove the Ultrasonic Sensor.

Mounting Pixy in MBot

DSC07036.JPG
05.JPG
06.JPG
DSC07063.JPG

There is no Pixy bracket for mBot on the market. Because of this I made my own with a small piece of 2 mm thick polystyrene sheet.

I used the toner transfer method to transfer the bracket template (available at the attached files) to the polystyrene.

But it can be made even easier by simply gluing the model with stick glue, or by simply drawing it directly into the polystyrene.

I cut with a utility knife and gave a good finish with sandpaper. I finished with spray paint.

With Pixy comes some L-shaped metal brackets and some screws. They are used to attach Pixy to the custom bracket.

And finally, Pixy and the custom bracket should be attached in front of the mBot (where the Ultrasonic Sensor was attached).

Electronics

12_pixy_lmr.png
mCore_WITH_HIGHLIGHTS.png

Now it's time for the RJ25 to Dupont Wire.

The Dupont ends must be connected to Pixy, like in the above picture. The two remaining ends (black and white) must be insulated to prevent short circuit.

The RJ25 end can be connected in any of the four mBot ports. It's possible because we will use the I2C interface, and all the ports has the required SCL, SDA, GND and 5V.

Install the power supply for mBot.

PixyMon and Arduino IDE

07_c.png

The first application we'll use is the PixyMon. First, connect the correspondent USB cable to Pixy and your computer, and then open the PixyMon application.

Initially, for everything work well, we have to change the interface way to I2C, as follows: File > Configure > Pixy Parameters (saved on Pixy) > Interface > Data out port > I2C.

Next, we're going to teach Pixy an object: Action > Set signature 1 > select the object.

Then, it's time to code. You must have installed the Pixy library for Arduino.

Connect the mBot with the correspondet USB cable to your computer and open the Arduino IDE. Select the right COM port and board (Arduino/Genuino Uno) and upload the code (available at the attached files).

Here you can download PixyMon and Arduino library: http://cmucam.org/projects/cmucam5/wiki/Latest_release

Downloads

Just Have Fun!

Makeblock mBot + Pixy (object following robot first tests)