Introduction: Infrared Tracking Camera Mount

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.

Step 1: Materials and Equipment

Equipment needed

  1. Hot glue gun
  2. Rotary tool
  3. Soldering iron
  4. Wire cutters

Materials

The Camera Mount

  1. MDF board 1200x600x60mm cut to size (all pieces with measurements shown above)
  2. 2 Tower Pro Micro 9g servos
  3. Glue sticks (for hot glue gun)

The Tracking System

  1. 4 standard infrared phototransistors
  2. 4 10K ohm resistors
  3. 1 small prototyping PCB
  4. 8 400mm long, light hookup wire (red)
  5. 2 150mm long, light hookup wire (one red and one black)
  6. 4 100mm long, light hookup wire (black)
  7. 1 Arduino Uno R3
  8. 1 Adafruit Motor shield (v1, but there is a v2)

The Infrared Signal Source

  1. 9 Standard infrared LEDs
  2. 1 prototyping PCB board for LEDs - cut to size (25x30mm)
  3. 1 prototyping PCB board for mini amp - cut to size (25x40mm)
  4. 1 40mm heat shrink tubing (cut in half, length ways)
  5. 1 Small safety pin
  6. 2 750mm long, light hookup wire
  7. 1 4 pin terminal header
  8. 2 BC547 transistors
  9. 1 400ohm resistor
  10. 2 30mm wire links (one red one black)
  11. 1 Arduino Uno R3
  12. 1 6xAA battery holder
  13. 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.

Method

  1. Mark and cut out all the pieces from the board of MDF (The measurements are shown above)
  2. Once you have all the pieces start by building the base
  3. Glue the side pieces (C and D) to the bottom plate (A) and then glue front plate (E) on.
  4. Cut out a servo hole (using the rotary tool) from piece B - see picture for measurements
  5. Glue in servo 1 into hole (B), screw holes will be on the inside
  6. Glue top on the base
  7. 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.
  8. Glue servo 2 into the hole cut into H.
  9. 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).
  10. 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).
  11. Screw a servo arm onto each servo. Make sure that length ways, they are in the middle of their full range of motion.
  12. 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.

Method



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.

Method

LED board



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.


Mini Amp

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

-MrSirLRD

Comments

author
craigstandlee made it!(author)2017-01-11

I downloaded the flash dect. code but it will not open, in fact the only code that opened is the ir detect. Any suggestions?

author
SpencerR20 made it!(author)2016-12-08

In the IR_FLASH_DETECTOR code I cant see where you have incorporated the photo transistors like in the Flash_det code (e.g. you have used Tr1, Tr2... for the transistors in the flash_det code) would I have to add these to the flash detector code?

author
S%C3%B8ren+StigA made it!(author)2015-10-02

So cool. It is just what I am looking for:-)

I will go back home and built this. Wauw

author
MrSirLRD made it!(author)2015-10-02

Let me know how it goes!

author
MrSirLRD made it!(author)2016-11-07

Hi,
I have meant to do an update on this but also haven't had the time. Except for using stepper motors instead of servos I haven't really thought about many improvements so far

author
S%C3%B8ren+StigA made it!(author)2016-11-07

:-/ One year passed, and I did not find the time to build the tracking camera. I hope it will be possible soon.
Did you had any learnings that I should know of?

author
ngonidzashemwedzi made it!(author)2016-05-15

thanks MrSirLDR

author
ngonidzashemwedzi made it!(author)2016-05-12

thank you ,how about on the receiver side

author
MrSirLRD made it!(author)2016-05-13

For the delay between samples you might be able to get away with the same value, for the distance between pulses you'll have to do some testing, look at the instructable for more information

https://www.instructables.com/id/Arduino-IR-signal-detector

author
ngonidzashemwedzi made it!(author)2016-05-10

hello , i would like to use 50Hz and 100Hz too , what values should use the code

author
MrSirLRD made it!(author)2016-05-10

For the emitter you would want to pulse the leds once every 10ms for 100 Hz and once every 20ms for 50Hz

author
gturner5 made it!(author)2015-10-18

I like the concept, what kind of range is it possible to get during the day outdoors?

author
MrSirLRD made it!(author)2015-10-18

I'm not sure, i've never tested it outside

author
JacoV3 made it!(author)2015-08-16

whats the most simplest form of the code. like the basis.

author
MrSirLRD made it!(author)2015-08-16

They main function of the code is the flashing IR detection. The code take 100 readings from each photo transistor and for each set of readings determined whether the pulsing signal is present by working out the period of the dominant signal. Each of the four sets of signals is then compared to see which one is the strongest, the servo moves the camera accordingly

author
JacoV3 made it!(author)2015-08-23

Ah k makes sence. what is ment by

if((Sig[i]-C)<30&&(Sig[i]-C)>-30)

What is the 30 for?

.........

if(t>t2)

Val=t-t2-48;

What in the 48 for?

author
MrSirLRD made it!(author)2015-08-23

for more information on the signal detection see https://www.instructables.com/id/Arduino-IR-signal-detector/

author
JacoV3 made it!(author)2015-08-23

Yeah i have a general idea of what its doing but the teating and comparing part is quite comfusing. I was just wondering if you have an earlier version thats easier to understand and still works for this project. I like the idea of the tracking but really want to understand each line of code too. Which makes it abit hard for me i guess lol

author
MrSirLRD made it!(author)2015-08-23

I don't have any earlier version of the code, the position function either compares the top and bottom photo transistor or the left and right and it just tests whether the difference is greater than a certain precision

author
JacoV3 made it!(author)2015-08-16

ah k jup i kind of get the idea of why it needs to be done but when looking at the code i get abit lost on what each part is actually doing.

author
JacoV3 made it!(author)2015-08-16

Hey thanx heaps for your sample. I set it all up and working really good. I just wondered if you had a more in depth explanation on what each line of the ID detector code is doing. I understand most of it some parts i dont quite get why its there.

author
MrSirLRD made it!(author)2015-08-16

Any particular part?

author
JacoV3 made it!(author)2015-08-16

the signal function and position function variable code is abit hard to understand.

author
JacoV3 made it!(author)2015-08-13

Hey just wondering. Did u use 2 arduino unos because the list seems like there are 2.

author
MrSirLRD made it!(author)2015-08-13

I used the second one to create the flashing IR light, but you can create that using any method

author
JacoV3 made it!(author)2015-08-09

Hey. Great project thanx. Im trying to make this but there ia no scenatic for the motor driver. And do you really need it. Couldnt you just use the arduino uno?

author
MrSirLRD made it!(author)2015-08-10

You don't need the motor driver, there was just a library for it. You can just use the uno on it's own, you might find a library for that too. Here's the schematic for the board btw https://www.adafruit.com/products/81#technical-details-anchor

author
JacoV3 made it!(author)2015-08-10

Makes sence. I guess using a shield is beter. I bought on today. Will give your project a whirl. Cheers

author
MrSirLRD made it!(author)2015-08-10

Awesome, good luck

author
technovative made it!(author)2014-07-31

Cool project. Nicely executed prototyping. The IR sensors and tracking code seem to work well. I think stepper motors might be a better choice for more precise smother motion. I like the level of detail you've given in this Ible. Thumbs up.

author
MrSirLRD made it!(author)2014-07-31

I thought about using stepper motors, but already had the servos, but I agree I'll have to use them next time! Thanks for your comment, I'm glad you liked it! (I try to leave nothing out of my explanations!)

author
AJMansfield made it!(author)2014-07-27

Needs a video demonstration.

author
MrSirLRD made it!(author)2014-07-27

There are two videos at the end

About This Instructable

9,757views

44favorites

License:

Bio: I like to make everything and anything! from electronics to food! and i'll be showing you all the things i come up with here!
More by MrSirLRD:Marbled Triple Choc-Chip Cookies 3D Printed Mini Haptic ActuatorEnglish Scones
Add instructable to: