Go Down

Topic: Buttons, RF, and GUI; Oh my! (Read 610 times) previous topic - next topic

Donalitu

Jan 29, 2013, 12:48 am Last Edit: Jan 29, 2013, 02:06 am by Donalitu Reason: 1
Hello Arduino Community,

I am an actor/designer at a haunted attraction and I am trying to design an actor security system that will utilize wireless functionality. I originally was looking into multi-channel relays (there are about 30 rooms to cover) but, found them to be extremely expensive. Then a coworker steered me towards Arduino. After some preliminary research I have formulated a setup i believe will give us a (relatively) simple solution.



FIG. 1 (The Setup)

The Switches:
Lighted Toggle Switch
Large Momentary Switch
Arduino
RF Transmitter for Arduino

The Computer:
USB RF Receiver
GUI program
String based variable library

Each switch will be coded to have a unique room ID; this will allow for two variables to be generated from each location (ie sw_Attic_Actor and sw_Attic_Alert). These variable will correspond to the two switches and affect the Computer's GUI.

FIG. 2 (Actor Switch)

When the Lighted Toggle Switch for a room is pressed (signifying that an actor is active in a room) it will light up and change the string value in the Computer to "sw_Room_Actor = True". The GUI's graphic lights the room informing security of its status.

FIG. 3 (Emergency Alert)

When the Large Momentary Switch is pressed (actor needs to alert security) the Computer string value will change to "sw_Room_Alert = True" and begin the GUI's Emergency Alert Program. Once an emergency is cleared the GUI will send a reset order to the switch OR (depending on library structure) just change the string value back to "sw_Room_Alert =  False".

FIG. 4 (The Pipedream)

If it is at all possible, I would also like to have an MP3 broadcast to our security teams' radios in the event of an emergency. Allowing for faster response times.


I have a pretty good idea of what i need to get the hardware portion of this project up and running. The main part that has stalled me is how to approach the coding. I'm not sure if it would be better to have the string variables stored strictly on the Computer and have the Arduinos callback for values OR to have them stored and referenced from the Arduinos. I would appreciate any help in getting the serial communication set up for this project.

wildbill

It sounds as though the serial communications can be done with bit twiddling operations on a single byte; you need a room id and an indication of the state of each switch. The room id can be stored in 5 or 6 bits and the two switch states consume a bit apiece. I'd suggest that you only transmit when the state of a switch changes, but send several times in case there was a collision with another transmitter. Alternatively, keep transmitting periodically until the PC tells you it got the message.

liudr

Random thought:
If someone walks in uninvited with an RF jammer that broadcasts wide spectrum of noise, your system will fail. Does each room have an ethernet socket? You can use ethernet shield with arduino. Unless they get to your router, it seems safer. You can also avoid wireless radio interfering with each other with ethernet.

Go Up