mBot as an object follower robot 3 years ago

How to make mBot follow objects with Pixy CMUcam5 Image Sensor.

Constructing Steps


The entire process to turn mBot into an object follower robot are shown on the above video. But below are the steps described and with some additional info.


Step 1: mounting bracket

We need a way to attach Pixy in the mBot. So I made a custom mounting bracket (the template is available in the attached files).

This part is made out with a piece of high impact polystyrene sheet (2mm thick).

The template is passed to the polystyrene piece using the toner transfer method (here you can see more about this technique: https://www.youtube.com/playlist?list=PLA9_fDHqO0ttRE7GjVHymxS7Uy8yy9Ile).

Finished with blue spray paint.

The Ultrasonic Sensor of mBot must be removed (Pixy will be placed there) - using this DIY mounting bracket and some screws and other small mounting brackets that comes with Pixy.



Step 2: wiring

Pixy is connected to mCore (mBot's brain) with a RJ25 to Dupont Wire. The RJ25 end can be connected in any port of mCore, because all the ports has the required SCLSDAGND and 5V, as you can see in the picture below (highlighted in red). (Tested and it actually works.)


The jumpers in the other end must be connected like in the picture below.



Step 3: PixyMon application

PixyMon is a tool "to see what the robot sees". With this application we set the desired signature (which is the object we want mBot follow).


The default data out interface of Pixy is SPI. So, for all work well, it must be changed to I2C with the PixyMon application (FileConfigurePixy Parameters (saved on Pixy)InterfaceData out portI2C).

Link to download PixyMon: http://cmucam.org/projects/cmucam5/wiki/Latest_release



Step 4: code

The code is in the attached files.

I have used the Arduino IDE 1.6.6 to make the programming and to upload it to mCore board.

We must have installed the Pixy library for Arduino (it can be obtained in the same link above, for PixyMon).


My code is based in the code of this link: http://cmucam.org/projects/cmucam5/wiki/Latest_release



Step 5: have fun!

Show more comments
  • Project Difficulty Level
  • Required Skills
    Software Machinery Electronics