Cheap way to measure tempeature and humidity

I have another setup, which is slightly different.

I’m using a Arduino ATmega328 Pro Mini 3.3V, you don’t have to include a DC-DC step-up. The 8 Mhz has reduced power usage versus 16Mhz. The pro mini 3.3V accepts any input voltage between 3V and 12V. To write the sketch you of course need a FTDI programmer to connect with the pins on the pro mini. I connected a motion sensor, light sensor, humidity and temperature. I also included some code and resistors to measure the battery level.
All communication is done via the MySensors gateway that I have installed on my RPi (you only need to connect a NRF23L01 Wireless receiver to the RPi. The gateway sends the sensor input via the MQTT protocol and openHAB picks it up.

Great project to tinker around.

The nano also has an onboard dcdc from 5v to 5v and 5v to 3.3v and accepts any input between 3v and 12v, but i wanted to suck all the juice out of my batteries (down to under 1v) - and i only wanted 2xAA == 3V to fit in that case - that’s why i use this “external” dcdc… i don’t feed the nano through VIN but directly through 5V, so only the 5V to 3.3V dcdc onboard is used…
I also disconnected any LEDs!

I’m measuring the voltage before the dcdc with an analog pin as well to calculate a battery level.

That makes absolute sense. When I’m home I’ll post a picture, it looks horrendous in a plastic Ferrero Rocher case :smile: but good enough for the proof of concept haha. I’ll have to come up with a cool case later.

I have KNX and so i have 24V on all places around the house.

If i use a Step-Down converter to get 5V from this 24V - will this Step-Down converter get warm or hot? If i mount it nearby a temp-sensor, i will get wrong values?

What kind of battery lifetime are you looking at with this setup?

That’s the question… theoretically it should be over a year, but i will just try it out… i use used batteries right now for evaluating the percentage calculation, then i will use new “Varta Industrial” batteries and take the measurement…

I have a arduino based solution

New member, here. I’m using a PineA64 with the GPIO pins hardwired to a DHT22 temp and humidity sensor costing pennies. Also have other things (outlets, lights, relays, etc.) wired in (I haven’t gotten into wireless, yet). I have programmed and wired a thermostat function fully functional this way, but it is in CLI (command line interface) Linux because I never heard of OpenHAB before. (I stumbled upon this OpenHAB just now.) I am hoping to “import”, so to speak, my thermostat functionality from CLI to OpenHAB. I’d appreciate any advice, if you’ve done something like that. Of course, Linux CLI deals with controlling GPIO pins by number and scripting/programming the functionality beyond that. I’ll post my progress, if anyone is interrested. Right at this moment, my microSD card has failed, so I’ll be spending the next day or so getting the Pine board to run from thumb drive, hopefully. So it’ll be just a little while before I can begin experimenting with OpenHAB…


If I understood well you will be probably interested to know that there is a gpio binding for openhab although i think you can get only ON / OFF statuses out of it.


Thank you for the great tip! My current sensors are probably too low level
for analogging them into gpio’s, but I’ll do the best I can with what it’ll
give me.

I Use this as the most compact DIY formfactor. But please remember that you still have to build some powersupply arraound and maybe print a Casing.
For those who like the ESP just google for “ESP8266 230V I/O Modul” from Luani. There is a many electonic fans ohf him who can provide you an 99% ready to use module. Just Flash (or let flash) MQTT Firmware, put the DHT22 and change 2 configurations. Voila you see the %. (Same for temperature and many other sensors)

I’m using several (good looking and pretty cheap!) Xiaomi Thermometer LYWSD03MMC devices using custom firmware (github repo), and an esp32 (patched with esphome) to catch the BLE advertisements and to publish these values to MQTT.

I would not recommend anymore this solution as the first approach,
As suggested by Duiffie you can find now cheap BLE sensors with an interesting battery life that you can integrate to OpenHAB easily.

An ESP32 can be uploaded from the web with OpenMQTTGateway, once done, you connect to the wifi AP , enter the wifi and broker credentials and you will get the information on your MQTT broker.

After you can add your things or leverage the auto discovery.

Did I understand it right, that the BLE sensors only talk to the ES32?
Do you have a short Image-Galery how there signals will be mapped by the gateway?

ESP8266 doesn’t have a BLE chip. ESP32 does. But you could also use any other BLE enabled device (USB stick for example) to receive the advertisements. A RaspberryPI (>2) should also be able to do the job. I don’t have any experience with the OpenMQTTGateway, but in ESPHome you’re able to specify the ‘base’ topic under which the specific subtopics will be generated (<base topic>/sensor/<sensor name>)

Yes they only talk to an ESP32, to an ESP8266 + HM10 or to a raspberry pi with BLE.

I will share a flow later on.

Not totally topic, but In an ideal world I would like so have a ver tiny hardware with PoE (no wifi) and integrated BLE chip. Than I can easily extend my BLE whereever I have Ethernet (I have it 8times each room)

[I know Wifi is nice too, but sometimes I want to disable some APs and it would be a mess if that would influence my SmartHome]

Is there something smaller on the market?

The BLE device (ESP32/RaspberryPI/USB stick/something else) is only meant to receive the advertisements that the BLE sensors send. I guess that size doesn’t really matter in this case, because you can hide that receiving device somewhere under a couch, in a closet or behind a curtain. So if you want to use an ethernet cable instead of wifi, then RaspberryPI is probably the way to go. 1 RPI may actually be sufficient, depending on the size of your house and the (strategic/central) placement of that RPI.

The WT32-ETH01 is more compact but doesn’t have POE unfortunately.

One criterion to take into account is the presence of an external antenna if you need to have an extended range.

Here is how a message sent to the broker look like:

1 Like