Main Content


Infrastructure project to get a “smarter” home. Raspberry pi as mqtt-broker, as data collector & data transmitter. ESP8266 as mqtt-client.

The Story
The goal of the project is to install a infrastructure for IoT another projects at home.To verify the functionality, I have implemented a ESP8266 to measure the temperature and the humidity of my bedroom. The ESP8266 sends the collected data over MQTT to a raspberry pi which runs as MQTT broker.

On the raspberry pi runs also a application (data_collector) which subscribes on the topics from the ESP8266 and save the collected data in a mongodb.

To display the data I use the chart function of mongodb.

The Problem
I want to make my home smarter and for this I need a way to communicate between different microcontroller in different rooms. The infrastructure project should include the possibility to collect data and save it, so that I have a history of the data and also to send informations to remote microcontroller. So that I have the possibility to install a central controlling instance. Also I need a possibility to display the data in a comfortable way and for different types of data.

The Idea
I want to realize the communication over MQTT. For that I need a MQTT-broker, this could be also the central controlling unit. For that I use a raspberry pi. To save data for a long time and also have a fast access I need a database. I have chose the mongodb for this project, because of possibility to save documents in json format. For me this is the perfect database in interaction with MQTT. In order to use it easily on other systems later, I use docker for my applications.

To collect some data from different sensors in different rooms I need a microcontroller with a WiFi-module. In this case I use the cheap ESP8266.

As dashboard I use the mongodb charts, so I can display all kind of data in a fast way.”

Link to article