This Instructable shows you how to make a camera mount that will track a 200Hz pulsing infrared (IR) light source. Tracking this 200Hz pulsing source and not simply the brightest IR light, makes this system more resilient to background IR noise.
Although in this build i used my phone (Samsung S3) as my camera, the concept shown could be used to make devices that fit any camera.
As this is just the first prototype, the mount itself is made of 6mm MDF, though later versions could be 3D printed which would reduce weight and increase the precision of movements.
The total cost for this build was about $45 and i had to make a few ad hoc adustments to the origional design as i went.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Materials and Equipment
- Hot glue gun
- Rotary tool
- Soldering iron
- Wire cutters
The Camera Mount
- MDF board 1200x600x60mm cut to size (all pieces with measurements shown above)
- 2 Tower Pro Micro 9g servos
- Glue sticks (for hot glue gun)
The Tracking System
- 4 standard infrared phototransistors
- 4 10K ohm resistors
- 1 small prototyping PCB
- 8 400mm long, light hookup wire (red)
- 2 150mm long, light hookup wire (one red and one black)
- 4 100mm long, light hookup wire (black)
- 1 Arduino Uno R3
- 1 Adafruit Motor shield (v1, but there is a v2)
The Infrared Signal Source
- 9 Standard infrared LEDs
- 1 prototyping PCB board for LEDs - cut to size (25x30mm)
- 1 prototyping PCB board for mini amp - cut to size (25x40mm)
- 1 40mm heat shrink tubing (cut in half, length ways)
- 1 Small safety pin
- 2 750mm long, light hookup wire
- 1 4 pin terminal header
- 2 BC547 transistors
- 1 400ohm resistor
- 2 30mm wire links (one red one black)
- 1 Arduino Uno R3
- 1 6xAA battery holder
- 6 AA batteries
Step 2: Building the Mount
This camera mount is made of 6mm MDF which was light weight, though a thinner board might have been better.
- Mark and cut out all the pieces from the board of MDF (The measurements are shown above)
- Once you have all the pieces start by building the base
- Glue the side pieces (C and D) to the bottom plate (A) and then glue front plate (E) on.
- Cut out a servo hole (using the rotary tool) from piece B - see picture for measurements
- Glue in servo 1 into hole (B), screw holes will be on the inside
- Glue top on the base
- Glue together the rotating plate, pieces F,G,H (the notch seen in piece H is not seen in the picture as it was added later to let more light in on the right phototransistor ) make sure you cut out the servo hole (using the rotary tool) from piece H.
- Glue servo 2 into the hole cut into H.
- Glue together the camera holder (phone holder), pieces I,J,K,L,M,N,O. Pieces N and O go on the back of M and I to hold the phone in place (seen in picture).
- Glue the arrow shaped rotor guides in place, on piece B and piece H. The point of the arrow should be 40mm from the end of piece B and 60mm from the bottom of piece H (seen in picture).
- Screw a servo arm onto each servo. Make sure that length ways, they are in the middle of their full range of motion.
- Glue servo 1's arm onto plate G and servo 2's arm onto piece I
Camera mount Finished!
Step 3: The Tracking System
The electronics for the tracking system are pretty straight forward as most of the work is done by the Arduino module and the Adafruit Motor shield.
1. Mark out the spots from the phototransistors (PT) on piece K. On the top and bottom arms the (PT) will be glued 20mm from the ends and 10mm from each side, on the side arms they will be 10mm from the ends and 15mm from the sides.
2. Bend the leads of the PT into shape. The leads of the top and left PT will be bent over the edge, the bottom and right PT leads will be bent outwards.
3. Solder one of the 400mm wires onto each of the PT leads
4. Glue each of the PT in place on K. Make sure the leads of the PTs on the side arms are both facing left and the leads of the PTs on the top and bottom arms are facing up
5. Next solder together the PCB (refer to schematic).
6. Solder R1-4 (10k Ohm resistors) connecting one end of all 4 to a common node (this will be GND)
7. Solder the PTs T1-4. The layout of the PT's are; T1 = bottom PT, T2 = top PT, T3 = right PT, T4 = left PT. when soldering the PTs make sure you connect the emitter side (the short lead) to the resistor and the collector (the long lead) to a common node with all the other PTs (this will be the 5v rail).
8. At the emitter pin of all the PTs solder a 100mm wire, this will be connected to the Adafruit Motor shield.
9. At the 5v rail (red) and GND (black) solder a 150mm wire this will also be connected to Adafruit Motor shield.
10. Solder the 100mm wires (analog read in from PTs - voltage across resistor will be proportional to light intensity) to the prototyping analog pin space on the Adafruit Motor shield, make sure they are in the right order (T1=A0 etc).
11. Solder the 5v and GND wires to the Adafruit Motor shield (there is a prototyping rail for both of these).
12. Hot glue all wires to their respective PCB boards, this will prevent them from being ripped out.
13. Connect the servos to the Adafruit Motor shield's servo terminal pins, servo 2 to pin 1 servo 1 to pin 2.
14. Cable tie the PT wires to prevent tangling when the mount moves, first cable tie pairs then all wires together.
15. Put all the electronics into the base, secure with hot glue.
Tracking system finished!
Step 4: Tracking System Code
The code is what really makes this device work. It reads in an array of 100 values from each PT and determines whether or not the 200Hz pulsing signal is there. It then moves the two servos to follow the pulsing IR light source.
For more information on the signal detection code, visit my other Instructable Arduino IR signal detector
The tracking code IR_flash_director is available below.
The IR_reader code just prints out the raw values from each PT, which I found useful when testing
Step 5: Infrared Signal Source
This device produces a strong 200Hz pulsing IR signal with the use of an Arduino Uno, though you could produce it with a 555 timer.
1. Cut out a small PCB board from a larger prototyping board (25x30mm).
2. solder the array of 9 LEDs onto the smaller PCB board, following the layout shown in the picture, making sure to solder the two positives and two negatives together with hookup wire.
3. Solder two 750mm long hookup wires to the LED board, one for positive, one for negative (I used double stranded AV wire ). Hot Glue wires in place.
4. Hot glue the 40mm long heat shrink tubing (cut length ways) onto the back of the LED board. This will stop the safety pin from shorting out the LEDs.
5. Hot glue a safety pin on the opposite side to where you soldered the 750mm positive and negative wires. the safety pin is what you will use to secure the LEDs to yourself.
6. Now the LED board in finished test it through a camera, you should see the LEDs emit a purple light.
This amplifier is needed because the output of the I/O pins is not enough to power all 9 of the LEDs.
1. Cut out a small PCB board from a larger prototyping board (25mmx40mm).
2. Following the schematic, solder the parts together on the PCB, starting with 4 pin terminal. This amplifier board is designed to connect directly to the Arduino Uno, the first pin will connect to the GND on the digital pin side.
3. Next solder both BC547 transistors together, the emitter of T1 to the collector of T2. These cascaded transistors will amplify the pulsing signal considerably.
4. Solder the 400Ohm resistor between the collector and base of T1
5. Solder the positive wire from the LED board to the emitter of T2 and the negative to the GND terminal pin
6. Use a link to join the base of T2 to the 3rd terminal pin (the 2nd and 4th terminal pins are only there for support).
7. Solder another link from the collector of T1, leave it floating, this will connect into the Arduino's 5v pin.
8. Turn the board upside down and connect it to the Arduino Uno, remembering to connect the GND pin to the Arduino's GND pin and the 5v wire to the Arduino's 5v pin.
9. Solder a 2.5mm DC power jack to a 6x1.5 AA battery pack, this will provide the 9v power for the Arduino (and will last a whole lot longer than a 9v battery).
Signal Source Complete!
Step 6: IR Signal Code
This code simply pulses the pin 12 for 250uS every 5mS producing the 200Hz signal, the code, "flashing_ir" is available below.
Once uploaded onto the Arduino Uno you can test that the singal is being produced by using the "Flash_det" code and your tacking system, the Flash_det code will simply print out negative values if the signal is detected.
Step 7: Final Testing
As seen in the videos (view 1 and view 2) the device is a bit slow and clunky, but as this is just the first prototype, i was pretty happy with that! It was able to detect the IR signal from up to about 3-4 meters away and ignored other light sources as designed (the light in my room for example).
I put most of the clunky/slow movement down to the small servos which will have to be upgraded in the next design (especially if a larger camera is used).
This device is just one application of the signal tracking system which was initially designed (but never implemented) to guide a quadcopter in for landing, though i see many applications for it.
I entered this Instructable in the "Epilog Challenge VI" as I believe the Epilog Zing 16 Laser will help me create lighter weight and more precise parts for future projects (some parts in this project had to be made larger and less precise due to limitations in what i could cut out) so if you liked this Instructable / were inspired by it to create your own device by using the same concept, please vote for me!
Thanks for reading