Hello everyone.
Today’s double project is a very easy and effective weather station, made with few components and custom cut enclosures, which requires very minimum coding and it’s very reliable.
It’s made of two separate units, which can be individually used for your needs:
The weather station assembled:
And the remote display:
Part list:
1x 4x20 i2c LCD display (https://www.amazon.com/DAOKI-Yellow-Backlight-Character-Arduino/dp/B01EE4V0N8/ref=sr_1_9?dchild=1&keywords=arduino+display+20x4&qid=1595495428&sr=8-9)
2x Esp8266 modules, I used LUA NodeMCU (https://www.alibaba.com/product-detail/NodeMcu-V3-Lua-WiFi-Wireless-Module_60833809814.html?spm=a2700.galleryofferlist.0.0.72bd15ea2d8xRj&s=p)
1x PMS5003 laser particle sensor (https://www.alibaba.com/product-detail/PMS5003-plantower-high-precision-laser-PM2_60698686974.html?spm=a2700.galleryofferlist.0.0.79dd2a2eCGtYEo=
1x BME680 multisensor (https://www.alibaba.com/product-detail/Taidacent-Spi-I2c-Environmental-Indoor-Air_60126402391.html?spm=a2700.galleryofferlist.0.0.23435fdfwCsYco)
2x plastic enclosures.
Dupont cables female-female
Plastic tape
Tools used: soldering iron, hot glue gun, screwdrivers, dremel, cutting pliers, coffee
PART 1 - Sensor module
This is a modification of the great project from SuperhouseTV
For the initial details about: assembling, wiring of PMS5003, uploading Tasmota please refer to the first part of the article.
In addition I included a BME680 which will give these additional parameters:
Temperature
Humidity
Dew point
Volatile Organic gases (VOX)
To connect the BME380 to NodeMCU:
SCL pin ----- D1 (GPIO5)
SDA pin ----- D2 (GPIO6)
Vin ------------ 3.3V
GND---------- GND
Remember to setup your Tasmota with the correct WiFi network and MQTT broker
Last step is to enable the MQTT discovery on HA, therefore open the Tasmota console and write the following command:
setoption19 1
Once the machine is restarted you’ll have access to all the sensors values in real time:
If you made every step correctly the module will be correctly discovered by HA, and you can add to lovelace any favourite parameter:
PART 2 - LCD display
Here is a nice addition if you don’t want to bother opening your computer/mobile/toaster/whatever. The code is not mine, can’t give the right credit to the author because I forgot where it comes from, just applied few modifications.
Remember to change the code with your SSID name/pwd, and the MQTT broker parameters, all the necessary fields are written in the code with capital letters for your convenience.
Bonus: it’s possible to display any MQTT message on the display, you can use Node Red or simple automations, use the following topics to subscribe messages:
LCD01/Display/Linea1 (first line)
LCD01/Display/Linea2 (second line)
LCD01/Display/Linea3 (third line)
LCD01/Display/Linea4 (fourth line)
-
Upload the code from the following link to the NodeMCU:
http://www.fattimiei.it/mqttlcddisplay.txt -
Connect the LCD to the NodeMCD in this order:
SCL pin ----- Tx
SDA pin ----- Rx
Vin ------------ Vin (or any 5v source making sure having common ground with nodemcu)
GND---------- GND
And you’re done!
Here is a simple automation I made to display the main parameters used in the second picture:
- id: '1594119264897'
alias: temp display
description: ''
trigger:
- platform: time_pattern
seconds: '10'
condition: []
action:
- data:
payload_template: '{{ states(''sensor.tasmota_bme680_temperature'') }}C {{ states(''sensor.tasmota_bme680_humidity'')
}}% {{ states(''sensor.tasmota_bme680_pressure'') }}hp'
topic: LCD01/Display/Linea1
service: mqtt.publish
- data:
payload_template: 'PM1 : {{ states(''sensor.tasmota_pms5003_pm1'') }} PM2.5:
{{ states(''sensor.tasmota_pms5003_pm2_5'') }}'
topic: LCD01/Display/Linea2
service: mqtt.publish
- data:
payload_template: 'PM10: {{ states(''sensor.tasmota_pms5003_pm10'') }}'
topic: LCD01/Display/Linea3
service: mqtt.publish
- data:
payload_template: 'Organic Gas: {{ states(''sensor.tasmota_bme680_gas'') }}p'
topic: LCD01/Display/Linea4
service: mqtt.publish