How to make a temperature sensor using NodeMCU V3 and DHT 22

Hi!

I recently purchased NodeMCU V3 and DHT 22 sensor exact model number is AM2302.

Can anyone be kind enough to guide me on the Arduino code which i need to write on the Nodemcu so that i can connect and get the sensor reading via MQTT to openhab server

Regards,
Samir

Google is your friend there are quite a few solutions out there:
ESPeasy is one

here are some others

and there are many many more, some the with similar functions others not

Have fun!!

Thanks i went through most of them and i had already mentioned i am a nob and needed a code for sensor only the Bruh has multiple sensors so would it work even if only one sensor is connected ??

Yes it does, just ignore the responses from anything but your DHT22. If you use the BRUH software, please remember that it responds in JSON format that you will need to parse (via the JSON transform in OH2).
All the links above contain exactly what you are asking for: code for your ESP; you will still need to make yourself familiar with whatever platform you use to program your ESP (e.g, Arduino IDE or platform.io) but these come themselves with good instructions and forums

1 Like