- [INDEX]
- Introduction and project description
- Sensor Node and Gateway Design
- How I use OpenHAB - audio notification and dashboards
- Design detail for wireless sensor nodes and gateway
- Uber Sensor - wireless sensor for fire, smoke, gas, barking, light, movement
- Diaper Box Sensor
- Laundry Room Sensor
This is my first Element 14 contest. Thanks to Element 14 and sponsors for creating the Forget Me Not Challenge. I'm grateful to be one of the lucky five to receive the Raspberry Pi and EnOcean sensors. Thanks to EnOcean for providing the extra sensor kits!
I would like to present some ways of putting together electronics for various home automation tasks. In addition to utilizing EnOcean sensors, I will be using some Arduino-based wireless sensor nodes. When I get the EnOcean sensor pack, I'll replace the Arduino sensors with EnOcean sensors to show off EnOcean's energy harvesting technology and how EnOcean simplifies these projects.
As I develop the mini projects, I'll document everything on my Github. Special thanks to OpenHAB for making open source a priority. In the same vein, you're welcome to use anything I've created. I try to make my Github complete enough that you can replicate my examples.
Here's what I'm proposing, but there might be some slight changes due to budget. These mini projects are thematically related to The Challenge and related to IoT, and I've purposely made them varied to cover as wide range of the "internet of things" as possible...sort of my attempt at the "internet of anything". My scatter-shot approach might not be best for winning that coveted Tektronix oscilloscope, but my methods are fairly extensible.
______________________________________________________________________________
Mini Project 1: Mailbox Notifier [complete - see implementation and video at bottom]
A reed switch sensor sits under the postal mailbox. When the mailbox is opened, the sensor wirelessly notifies the Raspberry Pi, which then plays an audio alarm "you've got mail", as well as time stamping the event and changing an icon on the OpenHAB interface. OpenHAB also sends an email notifying you of mail delivery (or at least mailbox opening). Also on the OpenHAB interface is the mailbox opening count for that day so you know how many times the mailbox has been opened.
The Arduino version uses a battery, so I will also be sending the battery voltage along so you know when to change the battery. It sleeps most of the time, and uses the reed switch as an interrupt to wake up. I'm expecting a battery life of 1 year out of 4xAA batteries. The EnOcean version will use the energy harvesting magnetic switch, so no batteries needed.
Mini Project 2: DIY home security [ Complete - see uber sensor post]
Basically the same thing as the Mailbox Notifier above, but with a few interface changes on the OpenHAB end to facilitate operation as a home security system to monitor when doors/windows are opened, and sound alarm and send email notification. EnOcean makes a specific sensor for windows/doors, but I will be using the magnetic sensor that comes with the sensor kit.
For area presence monitoring, an EnOcean Occupancy Sensor can be used. I don't have that, so I will be using a simple PIR sensor in conjunction with an Arduino.
Besides using it as a security system, a series of window and door monitors would be useful in other context. I can have a dash board type screen to tell me if the doors and windows are closed for the night. Or if it starts raining (water sensor outside, or maybe use weather report) and windows opened, notify me via audio alarm.
Mini Project 3: Washer / Dryer Notifier [Complete]
The motivation for this is two fold. First, my daughter's room is right over the dryer, and the cycle complete buzzer is loud and not adjustable. The second problem is I wanted to know when the wash/dry cycle is done without having to go down to check.
Using a cheap shake sensor or sound sensor and an Arduino, monitor when a washer and dryer starts/stops. When it stops, the Raspberry Pi will make an audio announcement that the wash or dry cycle is complete (if that option is picked on OpenHAB), and the icon for the washer and dryer will change based on the status. I'll use a PIR sensor as a way of determining when the laundry is emptied from the washer/dryer, and make additional changes to icons on the interface. This allows me to move the audible alarm from the dryer to the living room, and I have full control over the volume, which can be adjusted dynamically based on time of day. It also saves me a trip down to check if the cycle is complete.
I haven't been able to come up with a good way of doing the sensing using EnOcean sensor products for this one. Any suggestions?
Mini Project 4: Water Leak Alarm
Get notified when water leaks happen! Use a simple water sensor ($4) and wireless battery powered Arduino to notify OpenHAB when water leaks happen. OpenHAB then plays alarm and sends email so you can do something about it before it causes damage.
I don't have the budget to integrate a solenoid shutoff valve, but I will endeavor to build a wall powered wireless Arduino w/ relay outputs that can respond to this water leak alarm automatically. Those who are interested in this will have to do their own piping work and solenoid valve installation.
Mini Project 5: Run-Away-Dog Notifier
A battery powered Arduino w/ a $10 GPS module is mounted inside a project box for a dog collar. The Arduino constantly transmits its position to OpenHAB on the Raspberry Pi. When the dog strays beyond a predefined perimeter, OpenHAB plays an audio alarm, and/or sends an email notification.
I hope to also make a hand-held mobile unit for helping you find the dog. It would have a small display and its own GPS unit and show you which direction the dog went if you're within about 700 feet of the transmitter.
OpenHAB can also collect sensor data, so I'll use a database with OpenHAB to record GPS data. Then later map the GPS data. If you leave your dog in the backyard, you can use the GPS data to see where you dog likes to hang out. I would like to find some kind of geo-location program that can give visualizations of how your dog spent the day in the back yard. Most likely, you'll just find out what you've always known, that your dog sleeps in the shade most of the day
Mini Project 6: Dog Barking Notifier (or loud noise notifier) [ Complete - see uber sensor post ]
I have a motorized webcam on the dog kennel, but I've often wanted to know if my dog barks during the day. I've always been afraid that something terrible happed at home and the dog is barking for a good reason but no one is home to do something about it. So with this notifier, I least get an emergency email and can open the webcam screen and take a look around.
I'll use an Arduino with a $4 sound sensor to notify me via email if my dog starts barking. I'll use OpenHAB to put some intelligence into this - only notify me if the dog barks for X minutes, with X being settable from OpenHAB. This might be useful for other things, like maybe monitoring smoke alarms.
Many of these projects use audio alarming or email notifications. OpenHAB will be used to control when audio alarms are allowed to happen, as well as change the volume of the audio based on time of day and urgency of alarm. And I'll add handy buttons on OpenHAB to control notifications.
Mini Project 7: Charts of Energy Use and Other Trends
My scatter-shot home automation ideas might stray a little from the central theme...but it would be nice to monitor your home electrical usage and watch for trends and abrupt changes in usage. It could be an indication that you've left something running, like maybe the refrigerator door is being left partially opened by your kids. Using a $10 current transformer, I'll monitor circuits in my house and trend the minute-averaged current usage on OpenHAB using MongoDB.
While I'm trending currents, I might as well trend whatever temperature sensors I've got reporting to OpenHAB
Mini Project 8: Kitchen Gas/Flame Watcher [ Complete - see uber sensor post ]
Another one of my fears is that the gas stove gets left on and everyone left the house. The dog might not be smart enough to bark if the gas is left on, so it would be nice to measure gas directly and tell me specifically that the gas was left on in the house. I'll use a MQ2 sensor to monitor indoor air for gas and smoke, and send a unique email notification if there is trouble. I'll also use an inexpensive $3 flame sensor to watch for fire directly.
All my code and configuration is available at my github:
Implementation Details
In order to integrate wireless Arduino sensors to OpenHAB, I first had to create a gateway to talk to OpenHAB. This is something I recently figured out, and forms the foundation of all my wireless Arduino nodes, both wall powered ones and battery powered ones. My method uses a pair of Arduinos to act as the wireless sensor gateway, and communicates with OpenHAB via ethernet using MQTT. I won't go over all the details, but the sketches are available on my github. Briefly, it looks like this.
I'm using RFM69HW, a $4 wireless transceiver. What makes my setup really useful is the wireless range. Below is a map I created using a battery powered Arduino, the RFM69HW, and a GPS module. The GPS Arduino sends the coordinates back to a stationary Arduino sitting at my computer collecting the GPS coordinates. As you can see, I get over 700 feet range, through several walls and even a house or two. Other Arduino users may choose to use the popular nRF24L01+, but will have to modify my gateway sketches a little to use that library.
Here's a picture of the gateway, along with the Raspberry Pi at the bottom.
So that's the ground work I'm using for these projects. I made the gateway sketches available on github so other Arduino users can do their own OpenHAB integration. From here on, I'll give some details and present the results of each mini project.
________________________________________________________________________________________
Mini Project 1: Mailbox Notifier
I've been working on this ever since the challenge was announced, so I have a working example to show. With a battery powered Arduino, I'm consuming 100uA in sleep. Although my video shows me using 3xAA, a set of 4xAA battery can be expected to last over a year with several transmissions per day. It was a lot of work to solder the Arduino together, so a EnOcean magnetic switch will definitely simplify the project. It would be great to not worry about battery life. See Github for sketches and configuration details.
Here's a video demo and the circuit diagram.
More detailed video explanation.
Here's a screen shot of the OpenHAB interface, showing the mailbox was opened at 6:22AM, and the battery voltage on the mailbox unit is 4.7V. You can manually press the OFF button to clear the mailbox status, but it will also automatically clear at 1AM using OpenHAB rules.
Although not originally part of my proposal, I'll include this for completeness. Below is my garage door monitoring sensor. This is a wall-powered sensor node. I'm using an ultrasonic sensor to determine the location of the garage door, then using OpenHAB to interpret the garage door status as Open or Closed. See this sketch in Github.
________________________________________________________________________