Halloween Forum banner

1 - 20 of 32 Posts

·
Registered
Joined
·
47 Posts
Discussion Starter #1
Hi guys, thought I'd post up a simple little project I've been working on over the last few days.
The aim is to make a laser trip wire trigger that is simple, cheap and can be used to trigger a variety of props (or even control a DIY prop itself for those of you who are more advanced with your programming).

I'm also happy to answer any questions at all so feel free to ask! I promise I won't bite your head off for a stupid question, we all had to start somewhere!

This project uses the following parts:
Arduino Nano - $3.00 USD: http://www.banggood.com/ATmega328P-Nano-V3-Controller-Board-Compatible-Arduino-p-940937.html
Laser receiver Module - $3.28 (for two): http://www.banggood.com/2Pcs-Laser-Receiver-Non-modulator-Tube-Sensor-Module-For-Arduino-p-944603.html
Laser module - $3.49 (for 3!): http://www.banggood.com/3Pcs-KY-008-Laser-Transmitter-Module-For-Arduino-AVR-PIC-p-943280.html
So a total cost of $5.80 each (not including wire or a project box).

You'll also need some thin wires, some sort of box for the project and a power supply (between 6-12v will be fine, most people would have an old "wall wart" type power supply lying around which should do the job just fine as long as the voltage is correct).


Now, for those of you who have never used an ardunio (or even programmed anything in your life) please don't be scared off by this project! This is a perfect project to start with as its extremely simple to set up and I'll provide the program for you at the end so all you've got to do is follow instructions :)

This is probably going to be a fairly lengthy tutorial so I'm going to stretch this out over a few posts so that I don't have to write it all at once.

Before we begin you will also need to install the Arduino software which is what we will use to program our arduino. There's no point in re-inventing the wheel so I won't bother explaining how to do that here just follow the instructions on this page and you should be fine: https://www.arduino.cc/en/Guide/Windows

Once you've installed Arduino open the software and from the "Tools/Board" menu select the option "Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328" to tell the program what type of Arduino board we will be connecting. Later you will need to select the correct serial port from the "Tools/Serial Port" menu but more on that when we are ready to program our Arduino.

I'll put the first step in the next post!

- Daniel

**EDIT**
Here's the download link for the code, so you don't have to go fishing through comments for it!
https://www.dropbox.com/s/9wqy5zzsbm1n1mj/Prop_Controller.ino?dl=0
 

·
Registered
Joined
·
47 Posts
Discussion Starter #2
Okay so lets start by looking at the 3 main items this project uses. This is an Arduino Nano (some of the clones may look slightly different, but the pins should be labelled the same and in much the same place).
Arduino-nano-pin-mapping.jpg
This is the brain of our project, it controls the laser and reads the sensor and makes the decisions based on those inputs/outputs. This tiny device has huge amounts of potential and can be used for just about anything that requires automation of some sort. Last year I used them in my smoke machine controllers to automate them and in all of my moving props (and even some DIY Strobe lights). It has 13 "digital" pins (which can be used as both an input or an output) and is a simple on/off signal. There's a lot more to them than that too, but we will only be using the digital pins in our project.

Screenshot 2016-08-29 18.06.41.jpg
This is our laser module, its an extremely simple device. The three pins in order from Left to Right are: Negative(-), Positive(+, 5V) and Signal. The first two pins are used to supply 5v to the module and the last pin is used to turn the laser on and off.

Screenshot 2016-08-29 18.06.02.jpg
And finally this is the laser sensor module. Again quite a simple device with just three pins in order from left to right: Positive (+, 5V, VCC), Negative (GND, -) and finally the signal pin again. Like the laser module the first two pins are used to supply the sensor with power whilst the third pin toggles between on and off when the laser (or any other light source) hits the sensor.

I'll do up a simple wiring diagram tonight and include it in the next post.

- Daniel
 

·
Registered
Joined
·
47 Posts
Discussion Starter #3
Please excuse the awful photoshop job, but this seemed like the easiest way to show you where to hook up your sensors. The block of 6 pins on the end (also known as the ICSP port) isn't really meant to be used like this but as it has an extra ground and 5v connection we can use it to simplify our wiring.

Arduino-nano-pin-mapping.jpg

I'd like to point out also that our sensor and laser signal wires can be connected to any one of the Digital pins (Labelled 1-13) however a line or two will need to be changed in the program to allow for the different pins in use.

Also worth noting that you don't actually need to use a laser module or even have it connected to the arduino at all. You could get away with just using a regular laser pointer if you'd prefer, the arduino module just provides a simple way to power the laser and not need to worry about any additional batteries on the night. It also gives us the benefit of being able to switch the laser on and off from the program or whatever you'd like really.

Next step will be the programming!
- Daniel
 

·
Registered
Joined
·
47 Posts
Discussion Starter #5
this is really cool will the program be posted
Hi mate, I'd pretty much forgotten about this! Yeah If you want to use it, I'll happily post some code for you. My arduino knowledge has increased dramatically since last year and I'm actually in the process of building a complete Maze control system based on arduino that I will eventually release when its finished. Feel free to PM me about what you want to control and I'll do the code for you.
 

·
Registered
Joined
·
47 Posts
Discussion Starter #7
I love the tutorial, by chance could you provide the programming part of this write up?

Thanks,
Sure mate, I've been helping a few people through PM but I'll try and get something up on here today for everyone to see.

- Daniel
 

·
Registered
Joined
·
47 Posts
Discussion Starter #8
Alright guys, sorry its taken this long. Work has been busy and with my own absurdly complicated Halloween maze slowly coming together I haven't had a heap of time for this tutorial but I'll do my best to finish it off ASAP.

Now I've realised that most of you are probably just going to want to trigger stand alone hardware (CD players, existing props etc) so I think the best way to go about that would be with a relay board. Here's a link to a relay board that will work for this project, I've been buying most of my arduino stuff from these guys lately and have had good luck with all of it.
https://www.banggood.com/5Pcs-5V-Relay-5-12V-TTL-Signal-1-Channel-Module-High-Level-Expansion-Board-For-Arduino-p-1178210.html?rmmds=search

You'll need to wire that relay up to the arduino in a similar way to the other sensor, just double up the 5v and GND connections with one of the other sensors since we are going to run out of pins otherwise. Hook the signal wire in to pin 4 on the board. You can now wire that relay in line with your prop to use as a simple switch or you can put it inline with input power for your prop if the prop doesn't have a trigger button.

I'll put some code in the next post later tonight, once I've had a chance to set up my test arduino and make sure its all working properly. I'm including a post-trigger delay, a reset delay and a trigger length setting which can all be changed fairly easily. Let me know if you think of any specific requirements you have and I'll try and write it in. Keep in mind, I'm trying to keep this fairly generic so if you need anything more specific it might be best to PM me.

- Daniel
 

·
Registered
Joined
·
47 Posts
Discussion Starter #10
Okay, code tested and ready to go! Here's the download link: https://www.dropbox.com/s/9wqy5zzsbm1n1mj/Prop_Controller.ino?dl=0
You'll need to open that file in the arduino IDE, connect your arduino to the computer and select the correct serial port for it. Then, press the little arrow button towards the top left of the screen (upload) and the program will then compile and upload. And that's it! If your wiring is done, it should all work just fine.
Make sure you read the notes in the file so you understand how the program works and so you can configure the length of the delays.
Let me know if you have trouble and I'll try and help!

- Daniel
 

·
Registered
Joined
·
4 Posts
hey Daniel
I set up the trigger today and used the code you made with a couple of value changes and
it works great

Thanks again
 

·
Registered
Joined
·
47 Posts
Discussion Starter #13
Quick update guys!
Added the option to send status updates to the Serial Port for debugging. If debugging is enabled the Arduino's onboard LED will also come on when the Relay is activated. If you don't wish to use these functions, set the value for enableDebug to equal false instead as its enabled by default.
The file in the link has been updated and I've also added the link to the first post in this thread to make it easier to find.
 

·
Registered
Joined
·
46 Posts
OK. First this is great, thanks for putting all this information here for us!

I don't know much about all the technical aspects of this project (like 0), but I have managed to build the laser trigger. I have purchased the relay that you talked about and am having issues figuring out how to connect it like you posted. Is there a way you could post another diagram of that? Anyone? Thanks!

(I have also built a four banger controller following precise directions, down the road i will probably need more help to actually connect devices/props to the relays but in haven't got that far yet)
 

·
Registered
Joined
·
47 Posts
Discussion Starter #17
OK. First this is great, thanks for putting all this information here for us!

I don't know much about all the technical aspects of this project (like 0), but I have managed to build the laser trigger. I have purchased the relay that you talked about and am having issues figuring out how to connect it like you posted. Is there a way you could post another diagram of that? Anyone? Thanks!

(I have also built a four banger controller following precise directions, down the road i will probably need more help to actually connect devices/props to the relays but in haven't got that far yet)
Hi mate, can definitely post a picture if you need once I have time to draw it up. What part of the wiring for the relay are you struggling with? There should only be 3 wires connected to the arduino, +5v, gnd and a signal wire. You then hook the two wires from whatever you're trying to trigger into the screw terminals on the relay board (one to GND and the other wire to either NC or NO depending on if you want the relay to be normally open or closed). For most professional Halloween props I've seen with a trigger button you'll want to use the NO terminal.
 

·
Registered
Joined
·
46 Posts
Hi mate, can definitely post a picture if you need once I have time to draw it up. What part of the wiring for the relay are you struggling with? There should only be 3 wires connected to the arduino, +5v, gnd and a signal wire. You then hook the two wires from whatever you're trying to trigger into the screw terminals on the relay board (one to GND and the other wire to either NC or NO depending on if you want the relay to be normally open or closed). For most professional Halloween props I've seen with a trigger button you'll want to use the NO terminal.
Hello! Thanks for the response!
OK so solder pin 4 on the board (signal wire). I found another spot labeled gnd not being used second spot over with spot labeled vin to the right of it, I will solder a pin there (gnd). Finally splice into the 5v line going to the laser sensor (5v). ???
Like below?
Arduino-nano-pin-mappingRELAY.jpg
 

·
Registered
Joined
·
47 Posts
Discussion Starter #19
Hi mate, can definitely post a picture if you need once I have time to draw it up. What part of the wiring for the relay are you struggling with? There should only be 3 wires connected to the arduino, +5v, gnd and a signal wire. You then hook the two wires from whatever you're trying to trigger into the screw terminals on the relay board (one to GND and the other wire to either NC or NO depending on if you want the relay to be normally open or closed). For most professional Halloween props I've seen with a trigger button you'll want to use the NO terminal.
Hello! Thanks for the response!
OK so solder pin 4 on the board (signal wire). I found another spot labeled gnd not being used second spot over with spot labeled vin to the right of it, I will solder a pin there (gnd). Finally splice into the 5v line going to the laser sensor (5v). ???
Like below?
[iurl="http://www.halloweenforum.com/attachment.php?attachmentid=536242&stc=1&d=1518293690"]
[/iurl]
Looks good to me!
 

·
Registered
Joined
·
46 Posts
I was thinking that using a 5 volt battery would be the best option to power this device. Which 2 pins would I connect the battery connectors to?

battery onnector.jpg
 
1 - 20 of 32 Posts
Top