Sensors Box for Greenhouse

Introduction: Sensors Box for Greenhouse

Hey. I want to present one more project of mine to the wide society.

The project aims to automate the greenhouse I have built in my backyard. This is the first step- creation of a complex of sensors for the greenhouse. Later in the future, based on data from sensors, I plan to automate irrigation and ventilation. The device is based on Wemos D1 mini Pro. Software for this project is written in MicroPython. Data from sensors flows to Domoticz server running on Raspberry Pi Zero.

Now let‘s go deeper into details.


For this project you need:

1. Wemos D1 mini Pro

2. Wemos trippler base

3. Power supply shield(Optional, you can power D1 via USB).

4. OLED display

5. DHT22 sensor

6. SOIL sensor

7. 18b20 temperature sensor

8. Housing

9. Dupont cables

10. Running Domoticz server ( I am using Raspberry Pi Zero)

11. Pyhon files. All files you will need are here.

Step 1: Firmware and Micropython Drivers

I will not delve into how firmware is installed on the device. The procedure is described in details in one of my previous posts here.

Although there is one thing you have to know about installing firmware on WemosD1 mini Pro. Normally when I am installing firmware I use the following command:

python esptool.exe --port COM5 --baud 460800 write_flash --flash_size=detect 0 C:\path_to_firmware\

But it doesn't work with D1 mini Pro version. It works with D1 mini, but not with Pro. After installing firmware in this way, D1 goes into infinite loop – it reboots constantly. Somewhere on the internet I found that it is necessary to describe flash memory size it will use. You have to use command below:

python esptool.exe -p COM8 write_flash -fs 4MB 0 C:\path_to_firmware\

So after you have installed firmware, upload files mentioned above in 11.) except, by using ampy for instance. You will need to edit later, so do not upload it now :).

Step 2: Connections

Connect all hardware.

1. Soil sensor:

Red wire ======> +3.3V

Black ======> GND

Yellow (data) ===> A0

2. OLED display:

GND ======> GND

VCC ======> +5V

SCL ======> D1

SDA ======> D2

3. ds18x20:

Red ======> +3.3V

Black ======> GND

White (data) ==> D6, also via pull up 4.7kOhm resistor connect to +3.3V

4. DHT22:

GND ======> GND

VCC ======> +3.3V

OUT ======> D3

Step 3: Add Sensors to Domoticz

Add sensors to your Domoticz server.

1. Select SETUP/HARDWARE to add hardware.

2. Add "Dummy" from drop-down menu.
When hardware is added, the overview of all defined hardware will be shown.

The new hardware should be in the list and there should be a button "Create Virtual Sensors".
Click this button. Choose type of the sensor you have created. Please note IDX number of your sensor.

Enter idx numbers for every sensor into file. You need it in your Python script to address data from sensors to virtual sensors.

To see the devices list, click on SETUP tab and then select DEVICES.

Also, enter the IP addressof you Domoticz server to file.

Now you can upload to Wemos D1 mini Pro.

Step 4: Result

Power on the device.

After ESP starts, find a new WiFi network called "Wifimanager". Connect to it with your PC or phone by using password: "tayfunulu", then go to IP address Here you can connect your ESP to local WiFi network. Choose WiFi network you are going to use, type in password, hit "Submit". If everything is correct, you will see message " ESP successfully connected to XXXX network". Your ESP now is connected to your WiFi network and ready. As soon as it connected to WiFi it will connect to Domoticz server and start to send data from sensors. You can track the process in "Setup"/"Log". Display newly created sensors by clicking "Temperature" tab. The sensor image will be shown.

Soil sensor will be shown under "Utility" tab.

Mark sensors like "favorite" by clicking the star sign, to see thme all on "Dashboard" tab.

Since the errors handling is implemented in the code, the device will not crash, but only reboot in case of an error.

So now you will know, what i going on in your Greenhouse.

Good luck :)

Step 5:

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • Big and Small Contest

      Big and Small Contest
    • For the Home Contest

      For the Home Contest



    3 years ago

    Dear,what about if i use a I2C type sensor.Do i need to write *.py file specific for the sensor?if so,how to learn to write those .py files?


    Reply 3 years ago

    Hi, the link you have provided, not working, so I can't see what sensor do you mean. If you can't find the library for your sensor, than yes you need to write it by yourself.
    I haven't ever tried to do this actually. All libraries I use in this project aren't mine.