5
http://www.instructables.com/id/Another-Arduino-Laser-Tripwire/ Home Sign Up! Browse Community Submit All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech Another Arduino Laser Tripwire by Jonathan Robson on February 27, 2009 Table of Contents Another Arduino Laser Tripwire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: Another Arduino Laser Tripwire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 2: Build the Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 4: The Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Another Arduino Laser Tripwire

  • Upload
    swonera

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

arduino

Citation preview

Page 1: Another Arduino Laser Tripwire

http://www.instructables.com/id/Another-Arduino-Laser-Tripwire/

Home   Sign Up!   Browse   Community   Submit

   All     Art     Craft     Food     Games     Green     Home     Kids     Life     Music     Offbeat     Outdoors     Pets     Photo     Ride     Science     Tech

Another Arduino Laser Tripwireby Jonathan Robson on February 27, 2009

Table of Contents

Another Arduino Laser Tripwire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro:   Another Arduino Laser Tripwire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1:   Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2:   Build the Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3:   Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4:   The Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Page 2: Another Arduino Laser Tripwire

http://www.instructables.com/id/Another-Arduino-Laser-Tripwire/

Author:Jonathan Robson    author's websiteFish farmer, stagehand, ballet shoe maker, theatre production manager, science museum exhibit design and fabrication manager, project manager and artdirector of the Beijing Aquarium rainforest exhibit, film extra, architecture tour guide and urban planning researcher.

Intro:  Another Arduino Laser TripwireThis is my version of login258's laser tripwire at http://www.instructables.com/id/Arduino_Laser_Tripwire/

I've made a couple of modifications: the laser is now independent from the Arduino so that it can be placed anywhere in the room and I've changed the LED to a buzzer.

LASERS ARE DANGEROUS AND CAN DAMAGE THE EYES. IF CHILDREN ARE USING THIS INSTRUCTABLE ENSURE THEY ARE SUPERVISED BY ARESPONSIBLE ADULT AT ALL TIMES.

Image Notes1. Arduino controlled "mine"2. Laser emitter unit

Step 1: PartsYou will need:

Laser emiter, 3v battery and on/off switch OR Laser pointer and electrical tape

ArduinoPhotocell (a big one because it makes an easier target)2 10k resistorspeizo buzzerBattery to power the arduino with a jackbreafboardVarious short jumpersElastic bandsBlu-tacBored kidsWet sunday afternoon

Page 3: Another Arduino Laser Tripwire

http://www.instructables.com/id/Another-Arduino-Laser-Tripwire/

Step 2: Build the CircuitConnect the peizo's positive wire to pin 11 via a 10k resistor and ground wire to ground on the breadboard.Connect one leg of the photocell to the 5v pin on the arduino.Connect the other leg to analog pin 0 AND to ground on the breadboard via the second 10k resitor.Connect ground on the breadboard to ground on the arduino.Plug the battery (I used 12v because that was what was to hand) into the arduino power jack when you want to use it away fronm the computer but to get it up andrunning it can take power through the USB for now.Strap it all together with an elastic band.

If using a laser emitter wire it to a 3v battery pack and add lots of blu-tac to make aiming it easier later on.

Image Notes1. power for the arduino2. Photocell3. Peizo buzzer

Step 3: CalibrationPhotocells differ so you need to calibrate yours to your laser. Run the following sketch from Login258 or use the one on the arduino website athttp://arduino.cc/en/Tutorial/Calibration

void setup() {pinMode(4, OUTPUT);Serial.begin(9600);}

void loop(){digitalWrite(4, HIGH);Serial.println(analogRead(0));}

With the sketch running press Serial Monitor on the arduino window and make a note of the numbers that appear in the bottom of the window with the laser on thephotocell and when it is off (ambient light).

Step 4: The CodeUpload the following sketch but adjust the value in the "if" statement to suit your photocell. Pick a number a bit above the ambient light number. This may need tweakinglater, or, just pull a curtain or shrpud the photocell to lower the ambient light in the room.

/*

Jonathan Robson Feb 09.Laser tripwire activates a buzzer. adapted fromhttp://www.instructables.com/id/Arduino_Laser_Tripwire/

*/

int buzzPin = 11; // buzzer connected to digital pin 11

void setup() {pinMode(buzzPin, OUTPUT); // sets the digital pin as output}

void loop(){if(analogRead(0) < 850){ // this number depends on calibration of the photocelldigitalWrite(buzzPin, HIGH); // turns buzzer ondelay(1000); // waits for 1 seconddigitalWrite(buzzPin, LOW); // turns buzzer off

} else{digitalWrite(buzzPin, LOW);

Page 4: Another Arduino Laser Tripwire

http://www.instructables.com/id/Another-Arduino-Laser-Tripwire/

}}

Related Instructables

Arduino LaserTripwire byAdum24

Arduino LaserTripwire byLogin258

Arduino LaserSecurity Shieldby Bitline

Twittering LaserTripwire withWebcamCapture byaction_owl

laser tripwireNerf sentrybomb bydoby162

DIY Laser Djwith Arduino(video) bydragunov89

Comments

17 comments Add Comment

 jm1820 says:  Mar 4, 2010. 6:01 PM  REPLYThanks for the very helpful instructable.Just wondering, if I could seperate the photocell and Arduino board, by about 20 metres (using wire) ?Its just that I want to have the photocell at the top of my driveway, and the buzzer inside my house.I have no idea, if a length of wire, would affect the voltage output of the photocell - anyone have a clue ?

 dodich says:  Aug 25, 2010. 12:23 PM  REPLYWhy not place a reflector 20[m] away and keep all the electronics together. Just a thought.

 TOCO says:  Feb 20, 2010. 11:39 AM  REPLYis there a way to make the buzzer turn off when someone crosses back through the trip wire. That way if it is used for security it wouldn't turn off until theperson leaves.

 gaurangb says:  Jul 21, 2009. 4:21 AM  REPLYdear from where i will get circuit for install photosell and buzzer to dedtect beam braking conditions. [email protected]

 james.mcglashan says:  Apr 4, 2009. 10:59 PM  REPLYdid u get the arduino at the maker shed or some were else and did u kno u can get an arduino mega it is so good i want 1.

 helloworld1 says:  May 28, 2009. 7:26 AM  REPLYwhat are the benefits from the arduno mega to the denou...(dont know its name)

 james.mcglashan says:  May 29, 2009. 12:43 AM  REPLYit has many more pins and has more other pinsim not an exbert so goto http://makezine.com.com/ for more info

p.s u need to look in the podcasts to find the 1 a little tricky to find

 helloworld1 says:  May 29, 2009. 8:49 AM  REPLYoh right did not know that thanks

 james.mcglashan says:  May 30, 2009. 5:06 PM  REPLYa lot more info on this page http://www.makershed.com/ProductDetails.asp?ProductCode=MKSP5

 james.mcglashan says:  May 30, 2009. 5:08 PM  REPLYthere is evan a vidio lol

 Login258 says:  Feb 28, 2009. 7:50 PM  REPLYThanks for the credit! I'm glad my Instructable actually made some sort of impact. Someone commented on mine and said that two photoresistors wouldwork well, one for ambient light and one for the laser, so that's a good suggestion for you .

Page 5: Another Arduino Laser Tripwire

http://www.instructables.com/id/Another-Arduino-Laser-Tripwire/

 GreyGriff says:  Mar 17, 2009. 9:47 PM  REPLYMr Login258......I just stumbled onto your little experiment. I have a need and I figured you seemed a lot smarter than I and could tell me if it is possible,how small could the devices be and how much would each cost? I want a laser beam that goes between 20" - 36" or maybe even 48" and when brokenmakes a noise. I need small....maybe the laser in one section and the "guts" in another place? Cost......are we talking $5, $10, $25 or $50? How dolasers perform outside; wind and sun? My email is [email protected] on me if you can help.

 Login258 says:  Mar 18, 2009. 7:14 PM  REPLYYou could make one pretty cheap. Well really, it depends. For the first one it might cost $50 total, but after that each would be less than $10. Onlybecause the tools needed to program the microcontroller are a bit pricey. Distance isn't a problem, and it could be about the size of a thick cellphone(receiver) with a completely separate battery powered laser unit. And dinner definitely isn't required for my help.

 Jonathan Robson says:  Mar 18, 2009. 1:37 AM  REPLYBeats me. I live in Shanghai. I get them for about 3 dollars at the electronics market down the road. Wind doesn't affect lasers. Sunlight does. At nightI lose sight of it after about 3 blocks.

 inventorjack says:  Feb 28, 2009. 10:45 PM  REPLYAnother thought is that since this is probably going into a case of some sort, drill a hole in the case for the photoresistor, and recess is into the case a bitso that ambient light is less of a factor.

 Jonathan Robson says:  Mar 18, 2009. 1:38 AM  REPLYYes, recessing makes it a lot more flexible as to where you can place it.

 amando96 says:  Mar 7, 2009. 8:32 AM  REPLYi placed a thermistor instead of the LDR, now i have a very sensitive temperature diference measurer :D next step, get an LCD, and make thermometer :D