Lego Robotics with Arduino 1
I have a bunch of these little motors recovered from broken printers. They have a neat feedback system built onto the back using a slotted infrared sensor and an encoding wheel. All that needs to be added is a 74LS14 (or equivalent) Schmitt trigger to clean up the pulses coming from the infrared sensor. I modified the motor spindle to take the smallest Lego Technic gear and built a little test rig with a linear actuator type arrangement. The motors can be glued upside-down to a 4x2 stud Lego plate and occupy roughly the same space as a classic Lego Technic 4.5 volt motor. VIDEO - Lego Robotics Test Rig The motor is driven by a L293NE H-bridge IC with another of the Schmitt inverters used to reduce pin count to just 2 - MotorDirection and MotorSpeed. The code uses an interrupt to count the incoming pulses on a pin and also detects a stall situation by checking if the pulse count has stopped when the motor is supposed to be running. TEST CODE // Lego Robotics Test 002 // G...