DIY Wireless Temp & Humidity Sensor for Smart Greenhouses

by sGardilyan in Circuits > Arduino

282 Views, 0 Favorites, 0 Comments

DIY Wireless Temp & Humidity Sensor for Smart Greenhouses

1.JPG
33.JPG
IMG_5205.gif
Screen Shot 2023-11-22 at 15.59.50.png
Screen Shot 2023-11-22 at 16.00.23.png
2.JPG
IMG_5204.jpg

Welcome to my latest project, a vital component of a larger endeavor: creating a fully automated smart greenhouse. This journey began with a simple yet critical need – to accurately monitor and control temperature and humidity in my greenhouse, ensuring optimal conditions for plant growth. My solution? A DIY wireless temperature and humidity sensor, designed to seamlessly integrate with my smart greenhouse system.

At the heart of this sensor system lies the versatile ESP01 microcontroller, chosen for its Wi-Fi capabilities and compact size. Alongside it, I've utilized an array of reliable temperature and humidity sensors, including models like SHT85/31/21 and AHT21/20/10, catering to diverse requirements and precision levels. Powering this setup is a DC-DC step-down converter, ensuring efficient energy use.

The sensor's primary role is to constantly gather environmental data and transmit this information to an MQTT broker. In my setup, this broker is hosted on a Raspberry Pi, although the system is flexible enough to work with any MQTT broker. This project is not just about the hardware; it involves careful programming of the ESP to ensure reliable data capture and transmission.

I encountered a significant challenge: the accuracy of the environmental sensors was compromised by direct sunlight and the humid conditions of the greenhouse. Direct sunlight caused the sensors to overheat, leading to erroneous temperature readings, while the high humidity levels posed a risk of damaging both the sensors and the PCBs. To overcome these obstacles, I turned to custom designing in SolidWorks. My solution was a specialized sensor case, equipped with a 12V fan to ensure consistent air circulation. This design effectively shields the sensor from direct heat impact and mitigates humidity concerns, allowing for precise and reliable measurements of the greenhouse climate. This innovation not only enhanced the performance of the sensors but also significantly increased the longevity and reliability of the entire system.

IMG_5208.jpg
IMG_5209.jpg
FEOQ9W0LP8CJE6E.png

The initial step in assembling our wireless sensor is printing the PCB (Printed Circuit Board). This process starts with finalizing the PCB layout, ensuring it includes all necessary components like the ESP01, sensors, and connections for the power and fan.

Once the design is complete, it's exported as a Gerber file, which serves as the blueprint for the PCB. This file is sent to a PCB manufacturer who turns the design into a physical board.

After receiving the printed PCBs, a careful inspection is conducted to ensure there are no manufacturing errors. With a well-printed PCB ready, we can move on to assembling and soldering the components.

IMG_5211.jpg
IMG_5213.jpg

Soldering

Screen Shot 2023-12-06 at 18.22.08.png
Screen Shot 2023-12-06 at 18.28.35.png
Screen Shot 2023-12-06 at 18.35.02.png
Screen Shot 2023-12-06 at 18.37.34.png

First we need to configure our board and include the right libraries in the platformio.ini file. Next, update the WiFi SSID and password variables to match your network credentials. Don't forget to enter the correct IP address for your MQTT broker as well. Lastly, make sure to set up the SDA/SCL pins correctly for the AHT20 sensor by adjusting the parameters in aht20.begin(0, 2);. These steps lay the foundation for our sensor to communicate effectively with our network and MQTT broker."


Check the full code in https://github.com/SMB11/SmartCell/


44.JPG
Capture.JPG
sensorCell.JPG

3d Design and Printing

FBB76X4LP8CJE6D.jpg
FN5ZPM3LP8CJE6A.gif

Assembly