The cheapest line follower?

I made this line follower using 2 CD’s as wheels. 2 Hitec modified servos as gear dc motors, a 3 dollar microcontroller (PIC16F873A), 2 phototransistors and 2 IR leds and 1 small caster wheel.

EDIT 1: Here I add the code (WARNING: The code is written on PIC C language, you can translate it to Arduino)

#include <16F873A.h>
#use delay(clock=20000000)
//#byte PORTA=0X05
//#use rs232(baud=56000, xmit=PIN_C6,rcv=PIN_C7)

//#ORG 0x0F00,0x0FFF {} //for the 4k 16F873/4  //bootloader space


SET_TRIS_B(0X03);                           //PIN B0 & B1 as inputs



                                //RUEDAS ENCENDIDAS (B3 Y B4)
                //IF(INPUT(PIN_B0)==0 && INPUT(PIN_B1)==0){CONTADOR=0;}
                }                                         //goes Foward if there is black line on both sensors

                }                                        //turns right until left sensor catches black line

            ELSE {PORTB=0X04;
                }                                       //turns left until right sensor catches black line




Very cool ! Are you going to release the DIY documentation or is this SHOW & TELL without the TELL ?

Very cool ! Are you going to release the DIY documentation or is this SHOW & TELL without the TELL ?

Thanks for the appretiation. I'll gladly share steps to DIY on weekend (short of time now) , and now I'm open to any question.

Questions ?
Yeah, I have one. Why a PIC instead of a $3 Pro-Mini from eBay ?
Also , did you write an algorythmn that could be used to write the arduino code or did you " skip" that step and codd it on the fly ?

I did this proyect two years ago, when I knew little about electonics and only knew about pics (not heard about arduino yet back then). Today I'd use an Attiny45/85 or the minipro as you suggested.

I still have the code (which I did on the fly) and will share on weekend too. It is very short and easy to translate to arduino. (Just a main loop with some for loops inside, using digital input and output).

Ok. You're forgiven. I like the ATtiny85 idea. I buy em by the dozen. They're so usrful and I have a Kickstarter TinyISP.

I'm looking for a good price for attiny85. Where do you buy them? Soic or dip?

ALWAYS DIP so I can plug them into my ATtinyISP

How about $1.00 ?

PS-ALWAYS MAKE SURE IT SAYS -20PU in case you need the higher speeds.