5

I'm starting to explore IoT in my home, the first step being to connect a raspberry pi 3 B+ to a DHT22 temp/humidity, record DHT readings in a database which I then surf via a node server running on the pi. All good.

I got help from e.g.: http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/

I'd like to broaden this now to add some cheap wireless temperature/humidity sensors, but most of the ones I've found appear to be locked to their manufacturer, e.g. Xiomi.

The answer to this question suggests connecting a RF module to the pi to receive data from sensors. This instructable also seems promising, suggesting purchasing these transmitter/receivers.

So maybe I'd be able to connect something like this sensor to such a setup?

Will using RF 433MHz be a good way for me to keep costs down?

3 Answers 3

5

My solution to this was to use ESP8266 boards with various temp sensors like a TMP102 or LM75A. The ESP chips then send their data using MQTT to a Pi which is running Home Assistant.

Here are some links that might help:

https://www.hackster.io/colinodell/mqtt-temperature-and-humidity-monitor-for-home-assistant-27b8d1

https://www.home-assistant.io/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/

5

I myself was just working on a similar project, so I may be of some help. The first thing that we need to consider is the budget. Since you mentioned cheap, I am going to try and keep the budget below $3.

For a project like this, I would recommend using a dedicated WiFi module and a dedicated humidity + temperature sensor. This way, the project is more flexible and the parts can be reused.

For the Humidity sensor, I would use this DHT11 on AliExpress for getting the relative humidity and temperature, especially since it costs less than $1.

The wireless part is a little more challenging, but isn't that complicated. I would use this kind of module ESP-01 on AliExpress to get it connected to the internet. This is very power efficient and even has a deep sleep mode. Programming these two is also easy, especially if you already have an Arduino lying around.

3
  • Thanks @Rohan, looks promising, and cheap! So, if I understand correctly, I need to 1) wire ESP-01 to my pi to save my wifi credentials, get ESP-01s ip address, set up DHT driver, set wake-up times, program sending of data to pi. 2) Detach ESP-01 from pi 3) Attach ESP-01 to DHT and a 3.3v battery. Is that the way to go?
    – minisaurus
    Nov 2, 2018 at 12:23
  • 1
    Great! Your steps are mostly correct, but you don't need to connect to the pi at all. You can program the esp8266 to connect to your WiFi by simply providing your WiFi credentials in the WiFi.begin() function, and you can program the ESP using the Arduino ( there are a ton of tutorials online on how to wire and upload code) and program it to send data to the server on your pi. Hope you have fun with this project. Nov 6, 2018 at 23:36
  • thanks @Rohan, fun I am having :) Just waiting for a FTDI USB to TTL to arrive ...
    – minisaurus
    Nov 7, 2018 at 15:31
3

As always with a wireless solution, the critical parameters for selecting a solution are required range and power consumption.

You might be able to identify a cheaper pair of sensors, or even find a MCU which is integrated with the sensors you need (and a radio) if you're lucky.

The sensors you found seem to simply broadcast digital data continuously, so whilst you could connect one of these to a 433 MHz transmitter, you will only get one channel.

A more standard approach would be to use a Wifi/BLE/ZigBee/ah-hoc wireless module which exposes a limited amount of spare processing power, and use the wireless module to control when to send data samples. These modules come in at $2-3 (wifi seems cheaper than BLE) and ought to be suitable for battery power applications. You will of course need to learn a new software/toolchain approach, but with luck your endpoint application is a simple example which you can just import with minimal modification.

Once you accept an MCU into your endpoint, you can use any sensor, using a 'single pin self timed', SPI/I2C digital interface, or even an analogue input if you find a device with a spare ADC input. In fact, there is a wide range of options which will allow you to try and compete with this pre-built ESP8266 implementation, but you will struggle to come in at better than the sort of prices that Xiomi are achieving. I guess that the device I linked there is 'open' to some extent, but need to wait and see.

5
  • Thanks @Sean Houliane, do you mean a solution something like this: tzapu.com/… ?
    – minisaurus
    Nov 1, 2018 at 18:50
  • Yes, although note there that it's identified that there are problems with trying to deep-sleep the device. Nov 1, 2018 at 19:02
  • Yes, lots of choice. Some trade offs in how much electronics/software you want to take on, and where your interest really lies. Nov 1, 2018 at 19:06
  • My interest is mostly hobby (even slightly study related), I also like that so far I've coded everything apart from the AdaFruit driver for the DHT22 - I was a C programmer in the '90s :) However my electronics skills are almost non-existent, but the soldering-up side of the tzapu thing looks like fun, but I'm a bit worried that I'd buy the wrong stuff!
    – minisaurus
    Nov 1, 2018 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.