Project idea details
Creating a maker friendly DIY IoT home automation solution
Let’s dive into some details after the last post gave an overview of my project idea.
Sensor and Actor Nodes
All the sensor and actor nodes will be based on the Arduino open-source physical computing platform. They will use a nRF24L01+ ultra low power 2.4GHz transceiver to communicate over the wireless sensor area network. They will use MQTT-SN to publish the sensor data and subscribe to actor commands.
I will create two types of nodes:
-
Battery powered sensor nodes: They will be powered with two AAA batteries and they should run for more than six months without changing the batteries. I will use a ATmega328 running at 8MHz and operated with 3.3V. They will periodically read all the sensors, publish the data to the gateway and then sleep till the next read period, utilizing the MQTT-SN support of sleeping clients. I will create a custom PCB for a sensor node with a temperature & humidity sensor and a barometric pressure sensor.
-
Mains powered actor nodes: Since they have no power constrains I will use the ATmega328 running at 16MHz and operated with 5V. I will create an actor node with a relay that switches a mains socket.
The Gateway Node
The gateway will be built with a Raspberry Pi. It will use a nRF24L01+ 2.4GHz transceiver to communicate over the wireless sensor area network. There will be three main services on the gateway node:
-
A MQTT-SN gateway which gateways the MQTT-SN messages of the sensor area network to MQTT messages of the local area network. I will build a transparent MQTT-SN gateway with the help of the Kura framework and the Paho libraries.
-
A Mosquitto instance as a local MQTT Broker instance.
-
A Node-RED instance used to:
- Create the wiring and logic for the home automation.
- Forward the sensor data to cloud services.
- Create further API’s.
The wireless sensor area network
The wireless sensor area network will be built based on the nRF24L01+ ultra low power 2.4GHz transceivers. I will use them since the are very popular in the maker area, very inexpensive and widely available. The transceiver provides a link layer that features automatic packet assembly and timing, automatic acknowledgement and retransmissions of packets. On top of this a simple tree based sensor area network layer will be implemented on the sensor and actor nodes and on the gateway node. No fragmentation and reassembly will be implemented in the sensor area network layers, therefore the maximum packet size is restricted and so is the the maximum length of a MQTT-SN message.
Recap
Hardware
- Raspberry Pi
- ATmega328 (Arduino UNO based)
- nRF24L01+ transivers
- …
Software
Protocols
enough about ideas … let’s go to work and have FUN