Lasers! and Pointers!

After a fair amount of dreaming way beyond my capacities for this first project, I ended up finding a solution to the workspace question by being slightly paranoid.

I work at a studio where my office is blind to the door of the studio space, which means that I can’t physically see anyone coming in or out. Having all kinds of equipment being used there means there’s lots of potential for theft, so my Personal project became a way to let me know (or anyone else working) that someone has passed through the doorway.

The initial prototyping of the project was pretty straightforward:

  • 1x Arduino Uno
  • 1x Breadboard
  • 1x Photo Resistor (CDS 5mm)
  • 1x LED Green 3mm general
  • 1x Laser pointer (Infinitor Red Laser)
  • 1x 330 ohm resistor
  • 1x 10K ohm resistor
  • lots x 22 ga. wire

I started with the potentiometer code from the online tutorial on this site and started exploring the idea of using a sort of tripwire to sound a chime of some kind. Running the tests gave me this setup and code:

/* Source code altered from this site’s demo potentiometer sketch found here¬†with a lot of influence and ideas from Login258 at Instructables.com. ¬†*/

int LEDpin = 8;
int OUT13 = 13;
int potentiometerPin = 0;
int LEDvalue;
int potentiometerValue;

void setup(){

pinMode(LEDpin, OUTPUT);
pinMode(OUT13, OUTPUT);

Serial.begin(9600);
}

void loop(){
if(ONOFF, HIGH){
{
potentiometerValue = analogRead(potentiometerPin);
LEDvalue = map(potentiometerValue, 0, 1023, 0, 255);
analogWrite(LEDpin, LEDvalue);

Serial.print(“Light sensor value: “);
Serial.print(potentiometerValue);
Serial.print(“. LED output: “);
Serial.println(LEDvalue);
delay(100);

if(potentiometerValue>400){
analogWrite(LEDpin, LOW);
digitalWrite(OUT13, LOW);
}else{
analogWrite(LEDpin, HIGH);
digitalWrite(OUT13, HIGH);
}
}
}
}

Ostensibly, the code was written with the idea that the photosensor receiving the light from the laser pointer would be covered and so have a relatively low threshold. The green indicator light, for whatever reason, wanted the code written above, even though theoretically it should have turned LOW if the laser was tripped. I couldn’t logically sort that out but it worked, so I left the code as it was.

It was once I started assembling the components together that the project became a lot more complicated. I decided that I should beef up the buzzer and photocell size (in order to make the action louder and easier to aim), but over the course of the construction of the prototype box both components broke and so I returned to my original parts, which worked out okay.

I learned about maintaining access to components when my speaker failed after I’d glued the lid down without thinking about how to get everything out if I needed to. Fortunately, I was able to get back into the box without too much external damage and discovered that the speaker failed due to the ground wire that had unseated.

While the initial design was to alert people coming into the studio, the applications can expand much further into my photographic work: during my research I found a few different possibilites for using this basic system as a slave trigger for strobe units or camera flashes, some that went so far as to fire the camera as well. Ideally, I’d like to move away from a laser altogether, since something like infrared, ultrasonic or even proximity sensors would allow me to widen the active area for an object to pass through – allowing more versatility of tripwire to actuate cameras.

For now, it works fine and while it was a fun project to do, I’m looking forward to exploring the tripwire possibilities further.

1 comment to Lasers! and Pointers!

  • FYI – photosensors come in different flavours. With some the resistance goes up as they get more light but with others it goes down. So it may indeed sometimes seem counterintuitive!