If you want to see the general build, go to photoseries which I posted earlier while the building was in progress. Information is there in image notes. I just updated some of it.
Here I want to share the code and some thoughts and experiences about the problematic parts.
Here's a video about the testing stages in chronological order and also the final result.
I doubt my code would be useful to anyone as is, but if someone is facing similar problems with a linefollower there might be some ideas to peek at. I hope the comments in code are helpful, but if You have questions what does some part do and why, then please ask.
Remove these ads by
Signing UpStep 1Problems - moving
First two parts in the video (link in intro) are only riding tests, random this and that way. The very first version had especially small pulleys on wheels and had too little torque to get moving straight, the robot could only turn around its axis. Second had medium sized pulleys and was able to move, but I made them even bigger later when the sensors acted as brakes and it was also desireable to make it slower. Which was still not enough slowing down and I also coded movements into shorter impulses instead of continuous.
The final sensor attachement was also the "caster". Crucial part with all the braking was to get balance right so that the driving wheels had minimum resistance from the caster (weight in center) but also the thing did not fall over to the other side. For that moving the battery pack on the underside was perfect. If someone plans to build two wheel differentially driven robot I recommend keeping some room around the battery to adjust the balance.
Images of wheel pulleys in reverse order of versions.
| « Previous Step | Download PDFView All Steps | Next Step » |













































Are you using a "motorshield" or a homemade motor controller?
I used a H-bridge chip L293D, just to handle the motor current, the reverse direction is not used in this case. As here http://www.instructables.com/id/Control-your-motors-with-L293D-and-Arduino/ , but just half of it in use.