Introduction: How to Build PHIL - a Light Tracking Robot
In this Instructable I will be showing you how I made this dual axis light tracking robot using an Arduino Uno. All the CAD and code will be included so you can build it yourself without needing any programming or designing skills. All you will need is a 3D printer, an Arduino Uno and a few other basic parts!
Supplies
Tools you will need:
> A PC (duh)
> A 3D printer
> Soldering iron (and solder wire)
> Screw driver
Materials:
> 3D printing filament (PLA recommended)
> Proto board
> Self-adhering rubber or foam strip (optional)
> Some thin solid core wire
> Heat shrink tubing
Off-the-shelf components:
> Arduino Uno (Or compatible board)
> 2 x 100 µF capacitors rated for 5V
> 2 Micro servo motors
> 4 Light dependant resistors (LDR's)
> 1 x 5mm LED
> 1 x 220 Ohm resistor
> 4 x 10 kOhm resistors
> 11 x M3 self tapping screws
> 8 x M2 self tapping screws
> 4 x M3 machine screws with nuts
Step 1: Printing All the Parts
The first step is to 3D print all the parts using the STL files I've provided. I painted mine to my liking, but you can leave it as it is or use different filament colours. That's up to you!
Step 2: Electronics & Gimble Assembly
For this step you can install the LDR's and servo motors, as well as mount the Arduino to the base plate. Keep in mind that we still have to make the power distrubution board, so don't assemble any 3D printed parts in advance.
Installing the LDR's:
The robot tracks light by comparing the values returned by 4 photoresistors. There values will differ from each other if the light source is not perpendicular to the tracking head, as the light shade will cast a shadow on some of the LDR's. The arduino code will then move the head in an X and Y axis accordingly in order to stay on point with the light source. Mounting the LDR's is very simple: they have special pockets designed into the tracking head. Simply poke the legs through the holes, apply super glue and push it in until it sits flush with the surface.
Installing the servos:
Slot the servos into place and secure them with M2 self tapping screws as shown. You can now complete the mechanical assembly by mouting the servo horns to the designated brackets. After this you can attach the tracking head to the top of the assembly using 4 M3 machine screws & nuts. The pivot of the X axis can be attached using anything that can work as a 3mm shaft. I used a piece of BBQ skewer. This completes the dual axis gimble.
Mounting the Arduino Uno:
Align the screw holes on the arduino with the holes in the base plate, and secure it with 3 M3 self tapping screws.
Step 3: Power Distrubution
A key component of this robot is the power distrubution board, as it ensures that the correct power gets transmitted to the right component. This board will also help reduce voltage fluctuations caused by the servos being powered directly from the Arduino.
Making the board:
Cut out a piece of proto board, roughly 45 x 35mm in size. This should give you enough room to solder all the components. Refer to the circuit diagram provided, and solder the components accordingly. The servo motors both have 100 µF capacitors over their power and ground wires to prevent votage drops. The 4 LDR's have 10 kOhm resistors as voltage deviders wired to ground (refer to circuit diagram). The power LED fits in a hole on the electronics housing, and has a 220 Ohm resistor connected to lower the power in order to prevent it from burning out. Alternatively to using proto board, you can simply solder everything together in mid air, although that would be pretty messy.
Step 4: Full Assembly
Now that the power distrubution board is made its time to put it all together!
Connecting the wires:
First solder the appropriate wires from the power distrubution board to the various designated components. (Be sure to route them through the hole in the electronics housig from the bottom, otherwise you will have a problem!) IMPORTANT: Make sure you wire up the LDR's in the right sequence as show in the picture. These numbers correspond to the numbers in the circuit diagram. Same with the servos - the bottom one is marked "Y" and the top one "X". You can use heat shrinkable tubing to clean things up a little. Now, plug the remaining wires into the appropriate pins on the Arduino. The Power LED can be push-fitted into the hole above the USB port after some super glue had been applied.
Assembling the 3D printed parts:
The gimble assembly can now be attached to the top of the electronics housing with 4 M3 self tapping screws. Next, gently fit the Arduino (which is already attached to the bottom plate) along with the power distrubution board into the electronics housing, pushing until the plate is flush with the bottom and the screw holes are aligned. Now, using 4 M3 self tapping screws, attach the bottom plate to the electronics housing. Some rubber/foam feet can be added over the screws, to give it stability and prevent the screws from scratching your tables.
Step 5: Coding
The time has come to give this robot some life! Find the code I wrote attached to this step, and upload it to the Arduino via the Arduino IDE (Can be downloaded here). The robot is USB powered, so you can use any standard USB power source to power it up. (e.g. Power banks, phone charegers, laptops etc.)
Step 6: Final Notes
You can now power Phil up and have him speak for himself! Use a flashlight (Or any other bright light source) and try moving it around. It should follow the light wherever it goes. If it works, congrats, you built it correctly!
This was my first ever robotics project and I think it turned out pretty well. Please note that "Dynagon Robotics" is not a company, it is simply a name I came up with to represent my robotic projects.
Happy making :)