Hey everyone,
I recently finished a project I had in mind for some years now, that I could finally complete thanks to the amount of time we've been confined at home as a result of the horrible but not surprising situation going on on Earth right now.
Note that I'm a total newbie in terms of coding and probably all the sketches can be improved by 100%.
The project hardware consists of:
- Arduino MEGA
- NodeMCU 1.0
- BME280 sensor
- CCS811 sensor
- CT-013-000 Current sensor
- ZMPT101B AC Voltage Sensor
- Raspberry pi Fan
- Nextion 4.3" Display Enhanced
I printed some little "boxes" for sensors and the NodeMCU and a bigger one that contains the Mega and the Nextion display. This modular approach looks hideous but it works just fine
-Schematics
I hooked up a 470µF as pointed by @PerryBebbington in this thread (best collection of posts related to Nextion diplays. Thank you!)
-Behaviour:
The Mega reads all data and send it over Serial1 to the Nextion display and over Serial2 to the NodeMCU that, at the same time sends the data over WiFi to an InfluxDB server, from where Grafana reads and displays all the data
I added the small 5v fan to the box of the CCS811 sensor connected to the 3v pin of the Mega, so it's super quiet. Maybe it is not necessary at all, but cause the sensor it's enclosed in a small box I thought that the readings wouldn't be accurate without a little air flow.
All the code and Nextion files can be found here (Github).
Feel free to contact me for questions, suggestions or insults