How to make a light-following robot in one afternoon
An easy intro to robot-making.
If you want an easy project to complete in a day or so, or something to introduce kids to the world of robots and electronics, make this light-following robot your weekend project. The concept is very simple, and could be built in an infinite number of ways, with parts that you may already have on hand. For now, though, I’ll tell you exactly how I made mine.
- 2 small DC gear reduction motors—what’s used here can be found as a “micro gear box speed reduction motor,” and is available in a variety of RPM specifications
- 2 CR2032 coin cell batteries
- 6 LDRs, or Light-Dependent Resistors
- Wheels purchased or salvaged from a toy car
- ½-inch-thick wood, medium-density fiberboard, or other similar material
- Perfboard (optional)
- Soldering iron
- Glue gun
- Drill with bit set and hole saw
- Router, mill, table saw, or other tool for adding cavities to wood
I’ll first discuss the electronic circuit of the device, then explain how it’s actually assembled, as this can be done in a variety of ways. As shown in the above schematic, the positive side of the stacked batteries (connected in series for 6V) are wired to one side of each of the 6 LDRs. Three of these LDRs are arranged on the left side of the robot, and the non-battery lead of each is connected to the right motor. The other three LDRs are arranged on the right side, and the non-battery lead is connected to the left motor. The motor leads not connected to LDRs are applied to the negative battery connection, completing a circuit.
RELATED: Slipping into this ‘skin’ turns any object into a robot
The setup acts in such a way that when light is shined on the left LDR array, resistance to the right motor is lowered, and thus power is applied. This causes the motor to spin forward on the right side, turning it towards the light shining on the left array. The opposite effect will apply with the other three right LDRS and left motor, and if light is shined equally on both sides, the robot will travel forward. If either motor turns backwards, swap the battery and LDR leads.
To get these components to look like an actual moving robot, I first put a ½ inch slot in a piece of medium-density fiberboard with my milling machine, where the tiny motors could reside. A router or tablesaw could also be used for this task, if you’ve got it. I then used a 2¾-inch hole saw to cut out a circular assembly that would form the robot’s body with the slot in the middle. Finally, I traced the shape of a CR2032 batteries in the MDF behind the slot, and cut a rough cavity for the CR2032 batteries.
From here, I used the perf board to lay out the circuit, then arranged the wires so that when it’s attached to the MDF body with hot glue, the batteries are sandwiched between the + and – wires to supply power. (The wire was stripped back and rolled around the insulation.) The motors were held on with a combination of hot glue and the glued perf board, and wheels were drilled out to a diameter that could be pressed directly onto the gearmotors.
While this setup did work, in retrospect it would be easier to simply purchase a 6V coin cell holder with leads already available for a solid connection, especially if you don’t have a board lying around. Hot glue—even more hot glue, that is—could then be used to keep everything in place.
This is how I made the ‘bot shown in the video below. You could copy my methods step-by-step, create a 3D printed or otherwise carefully designed version, or simply start the build with the tools and materials at your disposal and see where it leads. As long as you can get the wheels to roll the device around, you’ll have something entertaining that follows a flashlight beam. You can make your frame out of wood, plastic, cardboard, or other readily-available materials.
(Jeremy S. Cook is a freelance tech journalist and engineering consultant, with over 10 years of factory automation experience. An avid maker and experimenter, you can follow him on Twitter, or see his electromechanical exploits on the Jeremy S. Cook YouTube channel.