Yet, Another Line Following Robot!

Oh, MC40A and LSS05 is on the rack. I requested 1 set of material from sales, want to test it out. For new comers, MC40A is Mini Mobile Robot Controller and LSS05 is Auto-Calibrating Line Sensor. For more information, please click on the respective link and download the User's Manual and the sample source code (MC40A only).

Oh, MC40A and LSS05 is on the rack. I requested 1 set of material from sales, want to test it out.

Here is the outcome: MC40A + LSS05


For new comers, MC40A is Mini Mobile Robot Controller and LSS05 is Auto-Calibrating Line Sensor. For more information, please click on the respective link and download the User’s Manual and the sample source code (MC40A only).

OK, let’s talk about the new line following robot. Before that, please go through the MC40A first.


MC40A is designed as mobile robot controller. With the rich features, it helps beginner to get start in building mobile robot, yet reserving the feature to expand the capabilities of the controller. Come with sample source code for PIC16F887 and PIC16F877A, user may start in no time with powering up the controller.

  • Come ready with PIC16F887
  • SMD components
  • L293B support 2 brush motor as actuator to mobile robot tires
  • Connector for LSS05 (Auto-Calibrating Line Sensor)
  • 2 programmable push button as digital input
  • Sample source code to test the board
  • Sample source code for Line following, ADC, LCD, DC brush motor, UART
  • Input power: 7V to 12V
  • Support 10-bit PWM for speed control for both channel of motor
  • Support 2×8 parallel LCD (optional)

When you get MC40A, it already come with a PIC16F887 (not PIC16F877A) and L293 motor driver. loaded with a test code or demo code. However, you will need 2×8 LCD to see the message display. DO ORDER the 2×8 LCD and 2×40 ways straight pin header (male) to solder it.

lcd-8x2-3137-222x2962×8 small and cute, yet powerful LCD!

straight-pin-header-male-2x40-ways-1965-280x3732×40 ways straight pin header

OK, what else? Battery holder which can accomodate 4xAA batteies, or adapter to power it.

4xaa-battery-holder-2143-222x2964 x AA battery holder


AC to DC adapter, regulated, 12V, 2A.

DONOT use Un-regulated Adapter, according to User’s Manual of MC40A, higher voltage might burn the capacitor and worst – cause small explosion on the capacitor.

Personally, I like to use Lipo battery which can provide longer usage and mobility to my robot 🙂

LIP-7.4-900-222x2967.4V – 2 cells Lipo battery (1300mAh)

OK, I have the power, the LCD, still need motor and wheel. I get myself a pair of SPG-10-150K + Bracket, also the low cost mini wheel that fit SPG-10.

pololu-micro-gearmotor-bracket-1-pair-3127-222x29630-1-micro-metal-gearmotor-3115-222x296SPG10-150K with Bracket

2395-222x296Low Cost mini wheel, don forget to order 1 PAIR

I think we are good to go! Oh.. how about the base? Well, you can choose the Tamiya base if you like and save the money for the motors and wheels. I am using a scraped PCB as the base. here is it!


The MC40A is being mounted on a PCB, with the SPG-10 and the mini wheel. Nice, right? Recylce for those unused part. Save the earth! LSS05 is being mounted on the bottom front part of the robot.


Well, the sales din send the LSS05 cable for me, so I have to make my own, you guy should have a proper cable. Don worry, it is nicer that this one 🙂

OK, we are good to run the test program. I have just edited the sample code and uploaded today. You may try it out. The line following program is based on this design. If you are designing your own mobile robot, it can still work, just you need to modify the speed, direction etc. Feel free to modify it and share with us.

If you don have UIC00B, you may get one from here. Who does not have it, right? Every PIC user should have one 🙂

Donwload the sample source code from MC40A product page(MC40A-887 FastLineFollowing), unzipped it. Open PICkit 2 Programmer software, load it into MC40A. Use the PIC16F887, not PIC16F877A as the MC40A come with PIC16F887.

Upon completing the program loading, you should hear beep from buzzer if you have connect the jumper to activate the Buzzer.


And the LCD will show “Cytron Tech” for ~1 second.


And continue with the testing code. Just try playing with the tests. Not all can be done such as ADC, Limit (limit switches), UART, SKPS etc. You can try to play with DC motor, LED + Buz, LSS05 and line following. Before you test the motor, you need to provide pwoer to motor, it can either be from another source or Vin (sharing same power as the power for circuit). I decided to use the Lipo battery to power the circuit and also motor, so I adjust the jumper at JP5 to “Vin”


OK! Having fun already? Let’s try the Line following demo. Uses the SW1 to navigate meme to “9.LineFo”


Press SW2 to run this mode, it will ask you to calibrate the LSS05, press the button between LCD and LSS05 connector. once the LCD blink, swing the LSS05 at the bottom of robot through the Line, several times, left and right! It will take 4 to 5 seconds, and calibration is done.

Press SW1 and line following will run! If you construct the robot using the same motor, same wheel, battery (7.4V) and LSS05, it should be something like this (Tomorrow I will upload the video 🙂 )

So the long list of item you need is MC40A + LSS05. Of course if you already have the other tools such as battery, motors, wheels, etc. My mobile robot is just an example, you are free to use any motor, or base, or wheel, or battery ( <= 12V ), try it and let us know how is your project going on!

I might recommend sales to sell MC40A in package. Next sharing I will be talking about using SKPS!! Maybe next week 🙂


4 thoughts on “Yet, Another Line Following Robot!”

  1. Freescale smart car 2010 competition just finished. The winning car was extremely fast, didnt expect can be so fast and even can run in dark condition. Maybe cytron can teach us how to develop a fast line following car like this.

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

DIY Interactive Robot Using REKA:BIT With Micro:bit
BLTouch Installation for Ender 3 with 32-bit V4.2.2 Board
Pick and Send Random Meal’s Option and Locations through Telegram Bot Using Grove WiFi 8266 on micro:bit
DIY Automated Vacuum Cleaner Using REKA:BIT With Micro:bit
Rainbow Spark in Mini House using Maker Uno.
Tutorials of Cytron Technologies Scroll to Top