Close
0%
0%

The Moteino Framework

Automation framework based on wireless Moteino nodes.

Similar projects worth following
The Moteino automation system is a decoupled framework of internet connected things designed to add convenience, monitoring, security and safety to a residence, living space and beyond. It is powered by a range of devices that are based on the Moteino wireless Arduino compatible development board. The small size and versatility enable you to build low power nodes that gather environmental data, or devices that control things in your home.

Overview video

Interface overview

This interface is maintained here.

Demo video (old interface)

Introduction and mission statement

I have long wanted to build my own automation framework for my residence. All existing solutions were either expensive, poorly designed, underperformant, bulky or not versatile enough for what I needed. So I created the Moteino, a low power wireless Arduino compatible based on the popular Atmega328p chip, that accepts RFM69W/HW/CW or RFM12B transceivers on reverse, is of SD card size, is wirelessly programmable and can fit in very small enclosures.

Among other things, I wanted this system to be:

  • Open source
  • Easy to build/replicate by those with some Arduino experience
  • Easily extensible and customizable
  • Inexpensive compared to other systems like Z-wave and Zigbee
  • Use common parts/sensors that are easy to source
  • Main components should have a very simple design, no exotic or complex frameworks/compilers
  • Easy to scale and hardware build with manufacturability in mind

Sample integrated devices

Once I tested a few revisions of the Moteino and I had a robust revision, I started conceptualizing several devices that would make it easy to monitor or control certain things like:

  • Mailbox via MailboxNotifier (aka MailboxAlert or MailMote). This little sensor box can run for many months on a small LiPoly battery and reports back motion detected at the mailbox, battery level, and the last time the mailbox was opened. It became one of the most loved Moteino based devices at our house, and very popular blog project. The love for this device grows more with every Michigan winter storm. Thank you MailboxAlert!
  • Garage door via GarageMote. This device can detect the garage doors position (open, closed, unknown), and trigger an open/close action. Very useful on those stressful days when you wonder if you closed the garage.
  • The sump pump mote via an ultrasonic sensor. Going on vacation? If your sump pump fails you could come home to a few feet of water, so better safe than sorry.
  • Motion via the MotionMote. Care to know when there's motion in your house when there shouldn't be any? Me too!
  • Lights via SwitchMote. Swap your current mechanical light switches with SwitchMotes and control your lights wirelessly in addition to the new push button. They work at 120-250V but are designed to fit US electrical boxes.
  • Water meter via a photo reflective sensor. Useful to monitor water usage for potential pipe breaks or water leakage.

System design

Artistic diagram

Self imposed requirements

To make it truly useful, flexible and secure, I imposed several critical requirements for my Moteino automation framework:

  • Remote SSL secured control. The RaspberryPi gateway computer can relay a SSL secured web interface to the internet allowing the owner to check status and take actions from anywhere on the internet.
  • Real time updates. Secure sockets allow the remote interface to receive real time updates from the Pi gateway. No more boring browser refreshes.
  • Wireless over-the-air programming of critical devices or those enclosed in difficult locations (especially the SwitchMote which is wired to mains and attached in electric boxes behind covers).
  • Use the RFM69's hardware AES128bit encryption for secure wireless communication
  • Allow Email/SMS/Pushover notifications
  • The central Moteino+RaspberryPi gateway computer has to survive a power outage and continue to receive critical messages from battery operated nodes such as MotionMote.
  • Components have to be easy to source, manufacture and system easy to scale. The network can be extended with new Moteino based devices at any time without changing the topology or disturbing existing devices.

RFM69 library

I've spent several weeks developing the RFM69 library which I made free and open source, is now widely used in RFM69 based projects, and now also forked/used in several other THP entries. I'm very happy others found my work useful and I applaud project such as the Reactron Overdrive and PlantFriends which used Moteinos (or clones) and...

Read more »

  • 2 × Moteino The heart of the "Moteino Framework". A little SD-card sized breadboard friendly, wireless equipped, atmega328p based development board. Would need at least 2 to make a framework of things. Also a USB version is available and the new MoteinoMEGA for larger more memory intense projects. https://lowpowerlab.com/Moteino
  • 1 × RaspberryPi This is my choice for this framework and was used to develop the central gateway that communicates with the rest of the Moteino Framework and also delivers secure websockets and live updates to internet clients. http://www.adafruit.com/product/998
  • 1 × MotionMote and MailboxNotifier Itself a kit of several components, makes up a truly wireless low power motion sensor. https://lowpowerlab.com/motion
  • 1 × SwitchMote Kit Use a few of these to replace your traditional light switches and sync your lights or control them from the internet. https://lowpowerlab.com/SwitchMote
  • 1 × GarageMote Kit Install one on your garage door, add a Moteino and your garage is on the internet! https://lowpowerlab.com/GarageMote

View all 7 components

  • Moteino M0 & add-ons

    Felix Rusu08/03/2018 at 15:24 0 comments

    If you’ve watched the forum, it’s been suggested to develop a new Moteino board featuring new/more powerful/more flexible or even ARM microcontrollers. Mentioned candidates were the Atmega328PB, STM32, SAMD from Microchip and perhaps others were mentioned over time as well.

    Say hello to MoteinoM0 – it features the popular SAMD21G ARM Cortex M0+ 32bit processor (48Mhz, 256kb FLASH, 32kb SRAM). It’s quite an awesome bit of silicon brains and after months of playing with it, tweaking libraries and sketches, testing peripherals and designing add-ons for it, and developing an Arduino package for it that is oriented on LowPowerLab‘s most important points of interest, it is now available to the public.

    But SAMD21 has been offered by others for years you say. How is this exciting and why did this take so long? I didn’t want to spam the market with a new clone and claim this is the best thing since Arduino Zero. Here are a few highlights that I think will make MoteinoM0 different and interesting:

    • long range wireless programming enabled just like all the other current AVR Moteinos!
    • Got low power? You bet! How about 6µA in standby sleep? MoteinoM0 yields the real low power mode achievable by the SAMD21, 7µA in watchdog periodic sleep, +1µA for the external 4MBIT FLASH-MEM chip and radio module
    • supports RFM69HCW and LoRa radios, plus secondary radios and add-ons, see below
    • a modular design enables compact platform for I2C/SPI/GPIO add-ons, just a few examples to mention:
      • SD-card logger ( with “zero” power control)
      • weather node
      • multi DOF accelerometer/gyroscope/magnetometer
      • secondary RFM transceiver (say you want an FSK and LoRa Gateway to listen concurrently or combine different concurrent frequencies)
    • break out as many useful and Arduino supported pins as possible in a symmetric and compact board layout
    • ease of side castellated mounts allow these add-ons to be mounted directly flat on the PCB without additional headers, here’s a simple weather-node add-on board that only requires one sided soldering and can be easily removed and reused:

    With the release of MoteinoM0 I also wanted to make available a few boards specifically designed to mount flat on the M0 PCB for a super compact wireless sensor platform.

    The new boards include a BME280 Breakout featuring the same sensor as on the previous WeatherShield

    And there is an all new LSM9DS1 9DoF IMU Breakout featuring 3 sensors in 1 compact chip (acelerometer+gyroscope+magnetometer):

     And here’s a mini SD-Card Logger Breakout featuring a low power switch to keep that hungry SDCard off when not in use

    You don’t even need to use pins at all, just solder the castellated side mounts (aka half holes). You may later desolder these with hot-air or a wide chisel tip on your solder iron. You can of course use these on a breadboard or with any other Arduino/dev board. You can also stack all these on a single MoteinoM0 if you’d like, just need to get a little creative with stacking them to keep pins connected correctly:

    The latest details and sample code are found added to the guide page.

  • Transceiver & Dipole videos

    Felix Rusu08/03/2018 at 15:16 0 comments

    I prepared a video to cover all the basics of thevarious LoRa and RFM69 transceivers used on Moteino boards. I concentrated on the most common topics I've seen show up in the forum and in support emails. This should be a good primer for those getting started with using sub-Ghz transceivers with Arduino or Moteino or even other compatible boards, since most principles apply the same way.

    I also made a video about the new PCB Dipole Antenna, a significant upgrade from the previous version. This has a nice VSWR of almost 1.0 at both 868Mhz (at default 78mm length), and 915Mhz (trimmed at 73.5mm). It could be trimmed anywhere down to 2.4Ghz but it will be a best performer for the wideband LoRa and FSK radios in the sub Ghz ranges. For more details and theory on dipoles be sure to check out the dipole section in the RF-Best-Practices Guide.

  • New Moteinos: trace antennas, LoRa radios

    Felix Rusu06/02/2016 at 18:48 0 comments

    With some help from an RF professional I've designed some Moteinos that have a trace antenna included on the PCB. Here is the regular and the MEGA variants, they accept any 868-915mhz RFM69W/CW/HW radios (they would also work with RFM12B):
    In addition, there are now MEGA variants with integrated USB which take LoRa radios but will also work with RFM69HCW. So now the Moteino family can accept any type of RFM69 radio, and also the RFM92-98 LoRa radios. Legacy radios include RFM12b and RFM22b which are also usable on these boards.

  • John's gateway deep-dive videos

    Felix Rusu06/02/2016 at 18:46 0 comments

    Check out these videos from John's DIY Playground who implemented a custom home automation system of his own, based on my gateway solution. He has implemented various nodes that control and monitor things around his house. He has also customized some of the gateway scripts and node sketches to achieve some nice variation and extra features (via metrics.js). For instance he mentioned something cool which I initially envisioned as a use case when I designed the hardware but never implemented this feature on my own SwitchMotes: using the unused status LEDs (and button?) of a SwitchMote to display the status of his GarageMote. Check out the video implementation of his utility room node and also the other videos where he covers configuration and setup of the gateway. This is a nice 3rd party overview of my hardware and gateway software. Thank you John for these videos and sharing your work!

    Utility room control/monitoring node:

    This is a getting-started with installing the prebuilt Gateway app image onto an SD card, and how to turn the RaspberryPi into a Moteino gateway via a MoteinoUSB (which is probably the easiest method).Here's the video covering configuration:

  • MightyHat buttons functional!

    Felix Rusu01/22/2016 at 21:13 0 comments

    I just added some sample functionality to the front panel buttons (sketch here). They allow the backlight intensity control and browsing through the last 10 RF messages. The large green button is the power button, currently GREEN because the Pi is powered up. In action:


  • Faster Wireless Programming!

    Felix Rusu01/22/2016 at 03:57 0 comments

    The Wireless Programming GUI app that I introduced in an earlier blog post is now at version 1.2 (get exe here). It features the ability to bundle up to 3 HEX file lines per RF packet (instead of the default 1), which yields a significant Moteino wireless programming speed increase. Let’s just do the TL;DR first and gaze at the results of transferring a compiled sketch of 13,858 bytes:

    • running with 1 line per packet (the same as before) yields 866 packets and ~43s OTA time:
    • running with 3 lines per packet yields 290 packets and ~18s OTA time:

    That’s an average 58% speed gain, not too bad!
    More details about this update can be found in this blog post.

  • Give your Pi a MightyHat!

    Felix Rusu01/08/2016 at 19:01 0 comments

    MightyHat is a Raspberry Pi Hat with that makes it easy to build a compact, robust, battery backed-up gateway for the internet of things. It accepts RFM69W/HW/HCW or LoRa transceivers and acts as a power controller and UPS for the RaspberryPi (when a LiPo battery is attached). It basically replaces the old way of wiring up several different boards to achieve the same thing, but produces a much more compact and more professional look:

    Check this page for detailed features of MightyHat.

  • WiFi thermostat automation

    Felix Rusu01/08/2016 at 18:53 0 comments

    I mentioned before that there’s added support for HTTP requests in the gateway interface. That allows using things like wi-fi thermostats, and this story is a review of how I did just that. See more details about this install in this blog post.

    I wanted to integrate the home thermostat into the Moteino IOT Framework Gateway and be able to control the thermostat remotely without hacking into it, building my own thermostat which would not look as good as a commercial one. I also want to avoid using the default cloud interface that comes with these thermostats. I don’t want the company to know my habits and datamine and profit from that, and also I want the thermostat to be integrated with my existing automation interface without having yet another app on my phone just for the thermostat.

    I researched for an open API WiFi thermostat and I found very few and they are typically expensive, except the RadioThermostat CT50 which was around $100 including shipping. If you know of a good open API thermostat let me know!

  • Sprinklers automated with IOShield

    Felix Rusu01/08/2016 at 18:46 0 comments

    Another node type is now available on the Gateway automation interface: a sprinkler controller. This is achievable through a board I designed to be able to control many outputs. I call this board IOShield and it features two 74HC595 serial to parallel shift registers.

    I had an old sprinkler controller which worked just fine. But I had a few things I could be improved:

    • The programming interface was not really intuitive, definitely not wife friendly
    • Every spring when it needs adjustment or sprinklers tested and fixes, it’s a pain to turn it on manually and then run in the far end of the yard to check/fix a sprinkler
    • Water is expensive and Michigan weather unpredictable. I need a finer control of the sprinklers and the ease of turning programs or zones ON/OFF remotely, or when I’m away from home

    More details about this addition are found in this blog post. Here's a video demo of the IOShield in action and control via the gateway interface:

    The RFM69 IOShield example skech for sprinkler control has been posted at Github. The latest Gateway image andsource files also contain the definition for the sprinkler node, just plug it in and it should pop right on the interface. Sample zones and events have been defined as well, you can easily define your own or make your own schedules in metrics.js. Graphing will show you which zone ran, for how long etc. Enjoy!

  • Gateway Dashboard Overview

    Felix Rusu04/17/2015 at 15:11 0 comments

    I've been talking about a new gateway interface for a while in the forum. I will release more details and the source code soon.

    This content will be updated and improved on the dedicated Moteino Gateway page where all the source code and details will be published as they become available.

    This is a work in progress and I encourage discussion, suggestions, bug reporting in the dedicated forum I created for this and all gateway related topics.

    UPDATE: code has been posted: http://lowpowerlab.com/gateway/#sourcecode

    Here's a video overview and some screenshots below with graphs and other available features:

    Here are some more screenshots:

    MAILBOX_DSC_7214DOORBELL_DSC_7220
    MOTION_DETAILSMOTION
    SWITCHMOTE_DETAILSWITCHMOTE_GRAPH
    GARAGE_DETAILGARAGE_GRAPH
    DOORBELL_DETAILSDOORBELL_GRAPH
    WATER_GRAPHSUMP_Graph2

View all 27 project logs

  • 1
    Step 1

    The Moteino Framework is made up of many different devices that have their own build instructions. Each device has been linked in the description and in the logs to their own page on my blog where you will find instructions, sources, guides. Most build instructions for the various projects can be found at http://www.lowpowerlab.com/guide/

    The Github repositories containing source code, eagle files, and any CAD/visual data are found here.

View all instructions

Enjoy this project?

Share

Discussions

mohammed.atta_elgammal wrote 06/18/2016 at 03:48 point

How open is the network of the devices?

https://goo.gl/Z0Deaw

  Are you sure? yes | no

anthony.webb wrote 09/28/2014 at 21:58 point
One of the real critical components to a project like this is the packet/msg design and how to identify devices and their properties on the network. This may be beyond the scope of the this HaD project, but have you given any thought on on the packet/msg protocol that the devices would use to share state, etc? I presume you have something you are using in your own project, is it something you would be willing to share?

  Are you sure? yes | no

Felix Rusu wrote 09/28/2014 at 23:56 point
That would be more of a transport/app layer, you can certainly do that. What I mainly provided was a network layer. You can implement a struct kept in EEPROM that describes the physical properties and description of a node that can then self publish. I did something like that for SwitchMote - see the SwitchMote config sketch: https://github.com/LowPowerLab/SwitchMote

  Are you sure? yes | no

[deleted]

[this comment has been deleted]

Felix Rusu wrote 09/28/2014 at 01:01 point
Thank you sir, I appreciate your comments :)
My best wishes to you as well!

  Are you sure? yes | no

David Cook wrote 09/19/2014 at 04:30 point
Hey Felix,

Thanks for including LoFi in your architecture log posting (I see its distinctive yellow pigtail poking into one of your pictures). I appreciate all of the hard work you’ve put into Moteino over the years, including the many revisions, and extensive support. I hope it is selling well for you.

Even though we are competitors in this event, we obviously share the same passion. If you are ever in Chicago, drop me a line so we can meet up.

Best of luck,

David

  Are you sure? yes | no

Felix Rusu wrote 09/20/2014 at 14:30 point
Hey David, thanks for your thoughts. You're actually far ahead in the competition (vote wise), and you've put a fair amount of work, congrats. It's about less than 1.5 years since I started making the first Moteinos so not very long. I love Chicago but we end up driving there only when we have friends over who've never been and they want to go with us. Thanks for the invitation :)

  Are you sure? yes | no

Richard Johnson wrote 09/13/2014 at 03:00 point
Nice project.
How open is the network of the devices?
Is it possible to be hacked? I don't like RF control systems for this reason.

  Are you sure? yes | no

Felix Rusu wrote 09/13/2014 at 16:20 point
You have a choice of AES128bit hardware encryption on the wireless transmissions. Then you can implement your own algorithms to avoid any potential replay attacks (which BTW would require a fairly high tech attacker).

  Are you sure? yes | no

Eric Tsai wrote 09/03/2014 at 18:28 point
Hi Felix. I'm a fan of your RFM69 library, and use it in my own Hackaday project. Glad to see you on here! I've been using your RFM library to integrate wireless sensors into another home automation platform called OpenHAB, and it's been really great.

  Are you sure? yes | no

Kenji Larsen wrote 08/25/2014 at 21:46 point
Congratulations, Felix, on being a THP semifinalist - you certainly deserve it!

  Are you sure? yes | no

hneiraf wrote 08/24/2014 at 04:55 point
Moteino is definitively the best RF integrated Arduino clone.
I've tried others, but moteino is far the best option.

  Are you sure? yes | no

Fernando Faria wrote 08/22/2014 at 13:21 point
Really nice project.

  Are you sure? yes | no

Don Oldridge wrote 08/08/2014 at 21:39 point
Great project, it looks like it will address a number of problems, and make it easy to add new types of sensors and automation. Kudos on a well-documented project that looks great.

  Are you sure? yes | no

Jasurbek wrote 08/05/2014 at 01:31 point
Very nice, can you measure the time of flight between two sensors ?

  Are you sure? yes | no

Saxx wrote 07/31/2014 at 06:54 point
I have bought about 8 Moteinos and now use them as temperature and mumidity sensors around the house. I have connected one as a gateway to my server that logs temperature, humidity, uptime (Moteino battery life), RSSI and battery voltage. The data is uploaded to a MySQL database using my own API.

You can read about my projects on my http://www.borngeek.net/ (Not updated in a while tho...)

Now I'm making v3 of the logging system with display and barometric pressure in addition to the above mentioned.

Thanks for the Moteino and expect more orders from me :-)

  Are you sure? yes | no

dickson wrote 07/30/2014 at 10:41 point
Rock star.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates