element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Forget Me Not Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Forget Me Not Design Challenge
  • More
  • Cancel
Forget Me Not Design Challenge
Blog Inexpensive & Flexible Home Automation / Wireless Sensors
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: electronichamsters
  • Date Created: 31 Jul 2014 3:07 AM Date Created
  • Views 1774 views
  • Likes 2 likes
  • Comments 6 comments
  • forget_me_not
  • raspberry
  • mqtt
  • pi
  • enocean
  • flexible_home
  • iot
  • arduino
  • home
  • automation
Related
Recommended

Inexpensive & Flexible Home Automation / Wireless Sensors

electronichamsters
electronichamsters
31 Jul 2014
  1. [INDEX]
  2. Introduction and project description
  3. Sensor Node and Gateway Design
  4. How I use OpenHAB - audio notification and dashboards
  5. Design detail for wireless sensor nodes and gateway
  6. Uber Sensor - wireless sensor for fire, smoke, gas, barking, light, movement
  7. Diaper Box Sensor
  8. Laundry Room Sensor


Hello  image

 

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.

 

 

______________________________________________________________________________

 

 

 

image

 

 

 

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.



image

 

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.

 

image

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 image

 

 

 

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 image

 

 

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.


image


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.



image


Here's a picture of the gateway, along with the Raspberry Pi at the bottom.

image

 

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.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image


More detailed video explanation.


You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image



image


image


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.

image


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.


image


image


You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image





________________________________________________________________________





  • Sign in to reply
  • electronichamsters
    electronichamsters over 11 years ago in reply to mcb1

    Yes, Gammon's article one of the most useful ones I came across when researching.  In my mailbox sketch, I turn off the ADC before going to sleep, and then turn it on when it wakes up to read the battery voltage, then off again for sleep.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 11 years ago in reply to electronichamsters

    Eric

    I've sent you a PM but you might want to look at using Digispark which uses the ATtiny85 chip and a bootloader but you only need the chip without anything else.

    Yes the bootloader is a pain but easier to change code later.

     

    There is a very good article here by Nick Gammon, and surprisingly turning off the ADC gives the best result.

    he has gotten them down to 100nA (yes 100 nano amps, which as he says is below the self discharge of some batteries)

    http://www.gammon.com.au/forum/?id=11497

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • electronichamsters
    electronichamsters over 11 years ago in reply to mcb1

    Hi Mark,

    Yeah, I ended up building my own Arduino board for battery-powered sensors.  I'd like to find a commercial version of a 8MHz 3.3V Arduino without any power LEDs built in.  That would make battery-powered Arduino sensors much easier to use for everybody, especially those slow at soldering like me.  And burning the bootloader on raw ATMEGA328's is an extra step that doesn't really add much value to the project.

     

    The mailbox Arduino code is in the github link, as is the wiring schematic.

    https://github.com/homeautomationyay/OpenHab-RFM69/blob/master/Field_Node_Mailbox.ino

     

    It's a challenge measuring the current consumption when the Arduino is in Power_Down_Sleep.  I only have a cheap radio shack multimeter, and I think the current consumption is about 100uA, but there's times when I think the multimeter's burden voltage might be interfering with readings.  I keep meaning to do a discussion posting to ask for advice on how to measure low currents more accurately without having to shell out $80 for something like the uCurrent reader.  100uA is actually kind of high for the ATMEGA328P-PU and the RFM69HW.  Maybe there's some pull-up resistors on the IO that needs to be disabled and some other hidden settings.

     

    I'd welcome any suggestions on making battery powered Arduinos more efficient.  There's a couple different sleep libraries out there, I just picked the first one I found, so it may not be optimal.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 11 years ago

    Excellent projects.

    Will you be posting the code for you letterbox monitor, the sleep mode option sounds perfect for a couple of my other projects.

    Sorry missed the link https://github.com/homeautomationyay/OpenHab-RFM69/blob/master/Field_Node_Mailbox.ino

     

    I did discover that some versions of computer mice had a 3v3 thru hole with enough wire to reuse, so you may wish to look at your ewaste organisation, or someone throwing them out.

    It sounds like you almost need to build your own Arduino board and use the QFN version which seems to be so much cheaper.

     

    I've used Hackvana to make some boards and can recommend them on price and turnaround.

     

    mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • electronichamsters
    electronichamsters over 11 years ago in reply to DAB

    Thanks.  I'd be interested in hearing what other people are doing with IoT around the home.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube