I created a demo recently to show off the security node I've been working on implementing using JeeNodes. This is not the final version (though the hardware is pretty close to final), eventually I want to use something like HouseAgent to control the entire system.
Hardware
Very rough model of my house with simulated doors, panic button, and motion sensor. The JeeNode is in the center. |
I decided to use this project as an excuse to try out Fritzing. I primarily wanted to try this since I thought it might be a decent tool to use to lay out the components on the protoboard, since I usually use EagleCAD but it doesn't allow you to work with protoboard. The breadboard view in Fritzing worked well for this but I still think I could have done it more quickly with pencil and paper. But at least now I have a decent (if messy) electronic version.
The interface is simple. The switches are wired directly to the digital inputs of the various JeeNode ports (also using some of the unused analog inputs as digital inputs). I use the ATMega328's internal pull-up resistors to save some components in the schematic. I used a 7805 voltage regulator to bring the 12 volt supply's voltage down to something more reasonable for the JeeNode. The 5V is regulated further to 3.3V by the JeeNode's on-board regulator.
I added a couple of transistors to the circuit to control power to the motion sensor and siren which both use 12 volts. I also inserted a switch in the siren circuit so there's a hardware way to turn the siren off just in case there is a software failure (the siren is REALLY loud). While I'm testing things out I'll probably only have the siren circuit enabled while I'm home so I can monitor things.
The firmware is pretty simple and has lots of room for improvement. It should be noted that I haven't done any work to improve the power usage of the firmware since this node will be wall-powered (the motion sensor and siren require way too much power to be battery powered). The sketch polls all of the inputs every 2 seconds and sends out a packet with the sensor readings. It also checks for received packets that contain one of two commands: to power up/down the motion sensor or to turn on/off the siren.
In the near future I will probably make this sketch event-based; it will only send sensor packets when one of the inputs changes value (or once when the node first powers up. I'll also probably make it handle a 3rd command to poll all of the inputs and return a packet with the data (force an event). Since this node will always be wall-powered I probably won't bother with using the power management functions available in JeeLib.
Host Software
I wrote the host software in LabVIEW. This is a prototype and will eventually be re-written to be a web-based interface (perhaps using HouseAgent). The VI monitors the serial port for messages from a gateway JeeNode running the standard RF12demo sketch. It then parses these messages and extracts the sensor value from them. Based on pressing buttons on the front panel the VI will also send messages to the node to turn on power to the motion sensor; it then starts a timeout to allow the motion sensor time to initialize after power up.
I used Sketchup to create a quick, not-to-scale, 3D floor plan of the first floor of my house. I think it spruces up the front panel nicely.
I wrote the host software in LabVIEW. This is a prototype and will eventually be re-written to be a web-based interface (perhaps using HouseAgent). The VI monitors the serial port for messages from a gateway JeeNode running the standard RF12demo sketch. It then parses these messages and extracts the sensor value from them. Based on pressing buttons on the front panel the VI will also send messages to the node to turn on power to the motion sensor; it then starts a timeout to allow the motion sensor time to initialize after power up.
I used Sketchup to create a quick, not-to-scale, 3D floor plan of the first floor of my house. I think it spruces up the front panel nicely.
Screenshot of the host-side UI |
The host including the host-side JeeNode connected via USB |