First line follower

My first line follower, it uses a dspic33fj128mc802, 6 QRD1114 sensors, this motor driver http://www.sparkfun.com/products/9457 , this motors http://www.sparkfun.com/products/8911 (things that i win on the free day :D). i have already written the code for read the 6 sensors and obtain the line position and the motor driver part, now i'm tryng to write the pid routine. For read the sensor i use the scan capability of the pic and i take 10 sample of each channel and i do the average. The pic runs at almost 40 MIPS but i think that i will decrease the speed. the pwm frequency is 20 khz and the resolution is 12 bit.

update 18/04 : i finally write the pid code and now i am finding a way to set the three K.Soon a video of the proportional control not completely tuned

update 19/04: uploaded the video of the robot it uses a PD loop and the motor are at maximum speed.

follows a line

  • Actuators / output devices: 30:1 micro metal gearmotors
  • Control method: PID, with bluetooth for debug
  • CPU: dspic33fj128mc802
  • Operating system: Windows with Microchip MPLAB IDE
  • Power source: 7, 4 500 mAh
  • Programming language: C
  • Sensors / input devices: 6 QRD1114
  • Target environment: indoor flat surfaces

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/first-line-follower

Nice project, I hope you can

Nice project, I hope you can post some video once you have the PID sorted =)

What makes you want to reduce the processor speed?

i want to reduce the speed

i want to reduce the speed mainly because the pic at 40 MIPS consume 75 mA but for now i will finish the code for that speed and then i will decide.

pickit3 and mplab

i like the pickit3 very much but i don’t have the 2 so i can’t make a comparison, but i never had a problem with it, one time i also put 9 volt across it and it is still there and works.Mplab(im using and old version not the X) is a bit strange and complicated at first but thanks to some tutorials, the forum and a lot of trials and errors i get how to make it works for what i need to do(basic stuff).Sorry for my english.

The PICkit2 is supposed to be the better of the two programmers.

I don’t recall all of the reasoning, but, I believe it had to do with capabilities.

That’s because Microchip (at

That’s because Microchip (at least in the beginning) crippled the PICkit3 to less capabilities. There was a lot of fuss about that you couldn’t power your circuit anymore with the PICkit3, but I think they just put the option to another menu and that’s why people complained.

Another reason seemed to be the “programmer on the go” feature which at release wasn’t yet implemented.

i confirm you that it can

i confirm you that it can power your circuit, i think that the PICkit2 could be also used as 3 channel logic analyzer.I had never used the “programmer on the go” feature

want some help

can yo plz Share the Sensors Code with me.
i have to make a robot using Digital logic design…
my Email ID is

[email protected] 

Great resources for line follower

i found this fantastic guide for build and more important program a line follower http://www.scribd.com/doc/49813253/Building-Autonomous-Line-Followers-using-Arduino-and-PID .just wanna to share

Speedy smooth line follower

Hey you got that going really well. Is this the end of development or do you have further plans for it. Whats the bluetooth for?

function of blueetooh and future ideas.

the bluetooth was used for debug the robots,when it runs it sends the six sensors readings,the calculated position,the error value, the correction that “exits” from the PD routine, and the two motor speeds.I build this robot mainly because i want to learn to use and program the dspics.Regarding this robot i think i will try to make a line maze solver but the code will not be easy.Thank you for the comment.