Building a laser "electric eye" sensor

I'm doing the setup work for using an Arduino to control high speed photography.

I have various types of photo gate sensors, plus a vibration/loud noise sensor using a Piezo element taken out of a cheap piezo buzzer. (You can get piezo vibration sensors from electronics suppliers, but these aren't very sensitive to sounds)

I wanted to be able to shine a laser beam across an arbitrary space into a photo sensor, and rig the Arduino to open my camera's shutter once the beam is broken.

I found these excellent "Optoschmitt triggers" on Mouser.com. ( http://www.mouser.com/ProductDetail/Honeywell/SD5600-001/?qs=%2Fha2pyFaduiEjZTzBoOKjYG9TK%2FZmMmmWGJyf4%252bzfsQ%3D) They take +5 volts and ground, and output a logic 1 (light detected) or a 0 (no light detected. They are most sensitive to IR, but work ok with red laser light.

They are built to snap cleanly from 0 to 1 and back again, and very fast. They are directional, so they are good at rejecting stray light.

The problem is that they are TINY (Maybe 3 mm in diameter) and just about impossible to aim a laser at without a very steady stand and a very precise screw-driven aiming rig, which I don't have.

So, DIY to the rescue. After some tinkering, I found that a piece of wax paper about 10 CM in front of the sensor diffuses the laser beam into a much larger spot. You can then aim the laser into a a circle of around 3 - 5 CM in diameter and the sensor still picks it up.

My first prototype had the wax paper held in a frame in front of the sensor. It was awkward.

The new, still decidedly home-brew looking sensor is build into a small rectangular cardboard box I found lying around. I took a small square scrap of "Luan" (thin fake plywood) and drilled a hole in it's center small enough that the sensor fit into the hole very snugly. Then I soldered some scrap 2 pair telephone wire to the leads, using red and black for power, and green for the signal output. Fool that I am, I cut off the yellow wire. Don't do that. (See below)

I cut a square hole in my box slightly smaller than my square of wood and hot-glued the wood piece over the hole, with the sensor facing into the interior of the box. On the opposite side of the box I cut a larger square hole, and taped some wax paper over the hole, making a little window into the inside of the box. I added aiming marks on the outside of the box just outside the window so you can more easily gauge where to aim the laser beam.

Next I made a mount to attach the sensor box to a tripod or lighting stand. Here in the US, tripod mounts use a 1/4 inch, 20 thread-per inch (TPI) bolt.

I took a scrap of sheet steel and drilled a hole slightly larger than 1/4". I hot-glued a 1/4 inch 20 TPI nut over the hole in the sheet metal so a bolt could come up through the sheet metal and thread into the nut. I then hot-glued the sheet metal into the bottom of the box after drilling a hole into that. I could now attach the bottom of the box to the mounting thread on a tripod.

I then stick the box on a lighting stand and adjust it to the desired hight. I attach a laser pointer or laser emitter to the head of a tripod and set the tripod so the laser pointer's hight is about the same hight as the middle of the wax paper window into the sensor box. Then I aim the laser pointer so it shines a dot in the center of the wax paper window.

Attaching the sensor to the Arduino is very easy. You wire black to ground, red to +5V, and the green wire to an available digital input. You can use an "FALLING" interrupt to trigger code when the beam is broken, write a while loop that uses digitalRead to wait for the pin value to drop low, or use "register-banging" code to check the pin's state directly. The "register-banging" approach is the hardest to implement, and least portable (port and bit assignments vary between Arduino models) but this is the fastest way to detect a change in an input, so I use the register-banging approach, since for my application, microseconds matter.

I wish now I had wired the yellow wire to the anode of a green LED, and attached the cathode to the black wire (through a ~250 ohm current limiting resistor)

Then I could have attached the green LED to the top of my box as an indicator light. When aiming the laser, I would set up the Arduino to read the light sensor, and light the green LED when the sensor detects the laser beam. I may go back and splice in a green LED. It would make aiming much easier.

Here are some pictures of my rig:

Last night I took some test shots.

I rigged the laser sensor at about waist height, and put a vibration sensor on the floor. I also put my camera on the floor. I put a piece of tape on my flash contacts so the camera wouldn't fire the flash with the flash in the hotshoe.

I have separate opto-isolator based triggers for both the flash and the camera.

I rigged a setup where the camera is on BULB (It opens the shutter as long as the shutter release switch is closed, and release the shutter when the switch is opened.)

The Arduino looks for the photo sensor's state to change form 1 (light detected) to 0 (beam broken). At that point it tells the camera to open it's shutter and beings looking for a vibration signal. When it detects a vibration, it pauses for a few milliseconds, then fires the camera flash through another digital output pin.

After a few more milliseconds, it releases the camera shutter and goes back to waiting for the laser beam to be broken again.

Here is a (very boring) sample image of a gym ball being dropped on the floor. You can see that the ball is flattened on the bottom where it is compressing.

Something like a golf ball being hit by a club, or a balloon popping, would be much more interesting. Those sorts of things are next...

Bad link. Let me try that again...

Nice project & photo :slight_smile:

I think you could get away with cheaper photo transistors (or maybe even a photo resistor). If the signal isn't as clean you can handle that easily in software (link switch bounce).

Although the device you linked does have a 15/60 nS fall/rise time vs several uSecs for typical photo transistors. I am not sure if the difference is material for this application....would have to do the maths...

Interesting approach having a 2 stage trigger process.

AnalysIR:
Nice project & photo :slight_smile:

I think you could get away with cheaper photo transistors (or maybe even a photo resistor). If the signal isn't as clean you can handle that easily in software (link switch bounce).

Although the device you linked does have a 15/60 nS fall/rise time vs several uSecs for typical photo transistors. I am not sure if the difference is material for this application....would have to do the maths...

Interesting approach having a 2 stage trigger process.

It depends on the application. I intend to use this rig for several applications where fast switching are very useful:

  1. Triggering the flash in high speed photographs, where multiple microsecond response is too slow (Like taking pictures of bullets). In that case I will probably have to connect the flash directly to the output of the sensor, since using the Arduino introduces a lot of extra latency. (either using interrupted or fast polling of the pins using port registers.)

  2. Over the air communications using a laser. Multi-microsecond response might be good enough for this application as long as the response is crisp. The triggers I'm using snap between states, so they will produce very clean square waves.

This is why most systems like this don't use a Laser, but instead just use a focused LED.

You can also put the LED and phototransistor in two tubes parallel to each other, and put a retroreflector on the other side. A bicycle taillight or a piece of license plate or reflective strip off of a safety jacket works as a retroreflector.

A screw-aimed type of a laser mount isn't hard to build. Get two T-shape brackets, some 1/4-20 nuts and bolts and a large washer to serve as the vertical aim knob. Use 2 short bolts and nuts to put together the "horizontal" part of the T brackets, sandwiching a nut at the bottom of the "vertical" of the T bracket. Take a long bolt, the washer, and a nut and assemble the knob and add the knob to the brackets. Attach the laser to your new mount. Put your mini "laser cannon" on a flat surface and set up a target. Aim the horizontal by moving the T's "bottom" back and forth, then adjust the vertical with the knob. You should be able to hit the sensor from a good range like a Civil War artillery piece! (that was the source of the design)