This project is my homemade/DIY temperature/humidity multi-sensor, based on the NodeMCU ESP8266, and a DHT22 sensor. It uses a custom-made breakout board for the NodeMCU/DHT I designed in Eagle (available at Tindie: https://www.tindie.com/products/11677/). The breakout board allows me to easily connect things like an OLED screen (for local display), motion sensors or WS2812 RGB LED strings (for LED strip control). The NodeMCU itself runs code I wrote (or ESPEasy) to get the temp/humidty/motion inputs, and publish them via MQTT to my openHAB home automation system. This multi-sensor is really a platform for multiple home automation data gathering tools, and I intend to extend its functionality as time goes on.
This enclosure was designed in Fusion 360 to make the whole setup look more pleasing to the (wife's) eye, rather than having random PCBs out around the house.
Build Instructions:Print enclosure and cover
- Solder left/right inner headers onto the carrier board (15 pins each)
- Solder DHT22 sensor onto board, with opening facing out
- Stick NodeMCU board onto carrier board, USB connector facing opposite from DHT22
- De-pin OLED screen (cut the black plastic holding pins together, remove pins one by one) <- alternatively, you can use breadboard wires (http://amzn.to/2fDGqeJ) with connectors on each end if you don't want to de-pin, but you'll have to bend the OLED screen pins to the side.
- Cut seven (7) short (~2 inch) lengths of hook-up wire and strip on each end.
- Connect/solder OLED screen to carrier board as follows:
For SPI OLED (Not Recommended):
Board Wire Color OLED
- 3v3 Red VCC
- Gnd Black Gnd
- D10 Orange Res
- D9 Gray DC
- D8 White CS
- D7 Yellow D1
- D5 Brown D0
For I2C OLED:
Board Wire Color OLED
- 3v3 Red VCC
- Gnd Black Gnd
- D4 Yellow SCL
- D3 Brown SDA
Final Assembly:
- Stick OLED screen onto mounting posts (ensuring the screen is within the enclosure opening) and use a soldering iron to melt the posts over it.
- Put NodeMCU carrier board in, ensuring it fits snugly (DHT sensor is tightly within its opening, USB connector is visible)
- Put enclosure cover on, and secure with small screws (or glue in place)
- Program sensor
I've posted my code here: https://github.com/bkpsu/NodeMCU-Home-Automation-Sensor
IMPORTANT NOTE: I'm no longer updating this code, having moved my sensors to ESPEasy - I highly recommend moving to that platform, as it allows the use of many additional sensors that my code does not support.
- Configure openHAB to receive sensor data over MQTT and calibrate sensor
Comments