This instructable will show you how to construct a laser tripwire that can twitter and grab an image from a webcam, as well as execute any command you can put in a bash script.
This instructable is actually quite simple and is even suitable as a beginner arduino project. It requires a GNU/linux (or possibly Mac) operating system with the arduino IDE and Processing IDE working properly. This project could also be implemented in Windows if you created a more complex processing application.
Hardware Requirements
Arduino Board
Laser pointer/pen
Light Dependant Resistor
100Kohm Resistor
Optional:
Webcam
Breadboard
Software Requirements
Arduino IDE
Processing IDE
Linux OS (I'm using Arch Linux for this project)
Curl
Webcam (part of xawtv)
Other Stuff:
Mirror
Solder and Soldering Iron
Wire
Hot Glue Gun
Hacksaw/Knife
Straw or Ballpoint Pen
Remove these ads by
Signing UpStep 1: Connecting The LDR
I needed the LDR and the laser to be in a position where they would not move around so I connected my LDR and resistor directly to the Arduino without a breadboard, but you can do it however you like, below are the photos for soldering and bending them into shape I also included a simple diagram.
I cut the end off of a ballpoint pen so that I could slip it over the LDR to prevent ambient light from affecting the reading, you could also use a straw.











































Visit Our Store »
Go Pro Today »




P.s. Im am a complete new person to arduinos and programming so i have no idea!
open("/home/username/someplace/twitter.trip")
in the processing code with the location of your files. eg.
open("C:\Users\EngineeringChannel\Send.bat")
That is all that you have to modify from my instructable. Also, don't follow the instructions where it says that you have to hide it or make it run on startup. I hope that helps, Good Luck!
/home/your_username/" where do i find the /home/my-username? folder ? and which software i will use the arduino or processing to load the script thanks.
User SuperTweet.net instead. Youre still using curl but supertweet.net acts as a proxy between you and twitter, allowing you to use basic auth. Twitter now uses oAuth which is a pain. For the code below, use your SuperTweet username and password, it is separate from your twitter login.
#!/bin/bash
trip=$(date +'%A %n %d, %l:%M%p' )
stat="["$trip"] Door has been opened"
curl -u USERNAME:PASSWORD -d "status=$stat" http://api.supertweet.net/1/statuses/update.xml --insecure
fill(#36ff00) how could i fix this im running windows btw
Excellent project, but it appears now twitter does not support basic authentication when you run curl...what need to be changed in the bash script?
Thanks,
k
awesome 'ible
The laser will be powerful enough to activate it so any basic LDR/Photocell will work. Worst case scenario you may have to adjust the "int threshold=500;" line in the arduino.pde file.
do you have like a radioshack part number for the LDR?
And how many ohms is the resistor?
Are you planning on leaving it running?