![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
The theory behind my latest project is as follows:
An inexpensive fob (partially disassembled to save space) is hidden inside a prop gun. The trigger presses a given button on the fob, which sends a radio signal to a receiver.
In this case, the receiver is a rather generic device, intended to trigger almost anything with its relay (which can handle up to 10 amps) from garage doors to lighting. For our purposes here, it works just fine to pull an input line low.
The microcontrollers I've been testing with are all Arduino-compatible, so I'm able to take advantage of the dead-easy (for a programmer) development environment that is used for Arduino boards.
The first board I used was an Adafruit Trinket, a very small microcontroller with a miniscule five digital I/O pins, two of which I needed to use for the USB connection to the computer.
The second was a spare Arduino Leonardo that I have other designs on, though it works well enough for testing purposes.
(the nice thing about the process I'm using at this point is that it's all practically breadboarded, and everything can plug-in and unplug easily, so I haven't wasted any hardware doing testing just yet)
When the microcontroller detects that a relay has been activated, it acts as a generic USB keyboard and sends a key-pressed signal to the computer it's plugged into.
I spoke to the person who's in charge of running the sound-effects for the theatre company I'm involved with, and was told that two channels are the best option at the moment.
Anything more than two just gets confusing, and can be easily handled with gunshots mixed into an audio file and played in the background.
On the whole, it's a very simple process, but the programming for the microcontroller can be tricky if you haven't figured out how to separate the two channels effectively.
In that case, you must figure out how to handle press/release and key-down/key-up properly, and without putting the processor into a locked state while waiting for a release event.
I'm pretty sure I have enough code done to do a good enough job, I just need to do a more thorough testing.
Theoretically I should have enough of the project together to be able to demonstrate the project to my director friend so she can get a good idea of how it will perform, though there's still the issue of supplying power.
Under most conditions, I'd be able to draw all the power necessary from the USB cable.
Unfortunately, it only supplies 5V of power, and the wireless relays I'm using require a bare minimum of 9V, though the documentation states that it requires a 12V supply.
I'd like to stay well away from batteries for this, as they're going to have a hard enough time trying to find replacement 12V batteries for the fobs when they eventually run out, so I'll need to go with a "wall wart" style power adapter.
This also means that I need to find one of those things, along with a jack to plug it into...
An inexpensive fob (partially disassembled to save space) is hidden inside a prop gun. The trigger presses a given button on the fob, which sends a radio signal to a receiver.
In this case, the receiver is a rather generic device, intended to trigger almost anything with its relay (which can handle up to 10 amps) from garage doors to lighting. For our purposes here, it works just fine to pull an input line low.
The microcontrollers I've been testing with are all Arduino-compatible, so I'm able to take advantage of the dead-easy (for a programmer) development environment that is used for Arduino boards.
The first board I used was an Adafruit Trinket, a very small microcontroller with a miniscule five digital I/O pins, two of which I needed to use for the USB connection to the computer.
The second was a spare Arduino Leonardo that I have other designs on, though it works well enough for testing purposes.
(the nice thing about the process I'm using at this point is that it's all practically breadboarded, and everything can plug-in and unplug easily, so I haven't wasted any hardware doing testing just yet)
When the microcontroller detects that a relay has been activated, it acts as a generic USB keyboard and sends a key-pressed signal to the computer it's plugged into.
I spoke to the person who's in charge of running the sound-effects for the theatre company I'm involved with, and was told that two channels are the best option at the moment.
Anything more than two just gets confusing, and can be easily handled with gunshots mixed into an audio file and played in the background.
On the whole, it's a very simple process, but the programming for the microcontroller can be tricky if you haven't figured out how to separate the two channels effectively.
In that case, you must figure out how to handle press/release and key-down/key-up properly, and without putting the processor into a locked state while waiting for a release event.
I'm pretty sure I have enough code done to do a good enough job, I just need to do a more thorough testing.
Theoretically I should have enough of the project together to be able to demonstrate the project to my director friend so she can get a good idea of how it will perform, though there's still the issue of supplying power.
Under most conditions, I'd be able to draw all the power necessary from the USB cable.
Unfortunately, it only supplies 5V of power, and the wireless relays I'm using require a bare minimum of 9V, though the documentation states that it requires a 12V supply.
I'd like to stay well away from batteries for this, as they're going to have a hard enough time trying to find replacement 12V batteries for the fobs when they eventually run out, so I'll need to go with a "wall wart" style power adapter.
This also means that I need to find one of those things, along with a jack to plug it into...