View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Color Follower Robot

4.9 | 9 ratings Rate this file 11 Downloads (last 30 days) File Size: 2.77 KB File ID: #27422 Version: 1.2

Color Follower Robot



29 Apr 2010 (Updated )

Code detects the red object in the image captured by webcam and communicates with micro-controller

| Watch this File

File Information

I had written this code for my mechatronics course project: Color Following Robot/Image Processing Robot. It follows object of any particular color (red in this case).
1) The robot (RC car) has a webcam mounted on top of it which captures images continuously. (Image Acquisition Toolbox)
2) Image processing toolbox helps to process these images to detect red pixels in the image. It finds area and centroid position of red object.
3) External Interfaces feature helps to set up a serial port object which send appropriate output to the microcontroller (PIC16F690 in this case) which controls RC servo & DC motor.
4) C code for PIC microcontroller available upon the request.
5) This code can be helpful to people who want to use image processing/ serial port communication for their projects.


Required Products Image Acquisition Toolbox
Image Processing Toolbox
Instrument Control Toolbox
MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
02 Feb 2016 bharath N

hi i'am working on the same project so please send the matlab code for it

Comment only
28 Sep 2015 yasin arafat

I'm interested in implement this project.Plz give me its C code and Ckt .... its will be helpful for me to make this project
here is my E-mail address

04 Nov 2013 shaheryar

26 Oct 2013 TRINAYAN

I saw your color follower robot file and its great. I am working on a similar project to detect red coloured balls and track them. I am confused by one part of your code. Say when you give the output to the microcontroller you are sometimes sending the small alphabets.There you have commented that say"Turn left with DC motor off". My question is how will the robot turn if the DC motor is off. And please send the microcontroller code if you can.
Thank you

18 Sep 2013 Uday Sharma

please send me ckt desing and other details of this project

Comment only
13 Feb 2013 bayan

bayan (view profile)

Awesome ,
Can you please send me the C code for the project ?!

23 Oct 2012 hafidzul

hi,interesting project...would u mind sending your project C code to

tq for sharing.

05 Jul 2012 sanket PUSATKAR

its really nice tejas sir
i m working on a robot for home automation so i want to study the project thoroughly if u dont mind..
plz sent me the code for micro.
if else if u have any supplementary document plz knowledge worth sharing

Comment only
05 Jul 2012 sanket PUSATKAR

31 Jan 2012 Yiu

Yiu (view profile)

I am also interested in the C code for the microprocessor. Would you mind send to Thanks for sharing!

Comment only
10 Jan 2012 aditya gosain

08 Dec 2011 Nithin Chandy

Can you please send C code for microcontroller to

Thanks in advance

Comment only
18 Mar 2011 JAIRO

JAIRO (view profile)

thank you so much, I will prove it

31 Aug 2010 Yogesh Patil

Can u please send me the C code for PIC microcontroller in your Colour following robot project to u.

Comment only
31 Aug 2010 Yogesh Patil

16 May 2010 1.2


16 May 2010 1.3

Added an image (flowchart), file remains same.

Contact us