Posts: 1
Joined: Fri May 10, 2019 9:55 pm

Automation of green house parameters control

Fri May 10, 2019 10:03 pm

Hi everyone,

I would like to use a PI as a automated climate controller. I want it to control the following parameters of a greenhouse: temperature, humidity, light schedule and smoke detection.

1. Temperature

— if the temperature is too high the PI would turn off the heater by turning off the power to the heater and increase the fan speed of the air extractor.
— if the temperature is too low the PI would set the extractor at a predefined rate (to be tested & determined) and turn off the heater.
— the heater would be controlled by a socket with PI-Mote
— the extractor is a bit tricky to control directly with the PI from what I've seen online so my idea would be to control a servo motor with the PI, the servo motor will be hooked up to the turning wheel of a fan speed controller that is made for that specific extractor.

For this purpose what I need is:

— the temperature & humidity sensor
— the Pi-Mote module & socket
— the servo motor

2. Humidity

— if the RH (relative humidity) value would be too big the dehumidifier would be turned on by controlling the power socket with PI-Mote.
— if the RH value would be too low the humidifier would be turned on.

For this purpose what I need is:

— the temperature & humidity sensor
— the Pi-Mote module & sockets

3. Light schedule.

— lights would be turned on & off by controlling the power socket with PI-Mote following a schedule.

For this purpose what I need is:

— the Pi-Mote module & sockets

4. The smoke detector.

— for this I would like to get an e-mail or something if there is a fire.

For this purpose what I need is:

— either a MQ2 sensor or a random smoke detector that I can maybe make it work with the PI

5. Extras

— An LCD screen to show the temperature, humidity & fan speed
— the ability to connect to my PI from anywhere for monitoring purposes (I guess this can be achieved SECURELY by using a VPN, I don't want to be hacked :))

So to resume what I need would be:

— raspberry PI (together with SD card, cables, etc)
— temp & humidity sensor
— Pi-mote module & sockets
— smoke sensor
— LCD screen
— servo motor

6. The builder :)

I am a tech savvy guy ( I work as a sys admin so I know my way around computers, servers, networking etc ) that likes to learn geeky stuff, I know some basic C++, BUT I never touched a raspberry PI before.

Do you think that this is achievable ? Feel free to criticize my plan.

Any kind of input, ideas or insults are welcomed :)

Posts: 5894
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Automation of green house parameters control

Sat May 11, 2019 9:39 am


I would say that will all be possible, the best way to tackle this would be to break it down in to smaller projects each covering on part of the project or one device/sensor.

There are lots of web pages out there covering the use of temperature and humidity sensors and servos on the pi.

For the smoke detector you may have to hack one to get a suitable output for the pi but I would think even that would be possible if you have some basic electrical knowledge ( stick with a battery power device for safety ).

I have never used a the Pi-Mote module & socket but if they exist there will be a web page about them some were no doubt.

And of course you can always come back here and ask for help if you hit a specific problem.
We want information… information… information no help
The use of crystal balls & mind reading are not supported

Posts: 2833
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Automation of green house parameters control

Sat May 11, 2019 1:03 pm

One thought is to have a look at some of the home automation systems - this link is a bit old but covers the main ones I’ve seen mentioned here

Take care with the humidity sensor - most of the DHT22 / AM 2320 are not worth the money - they fail and report very very odd data. Go up to the Bosch BME680 - more money but worth it.

For soil moisture look for a unit that is capacitive like ... -resistant. Again more money but the traditional ones oxidise and die quickly.

I have seen a project or two for hacking fire alarms - this is an old one ... alarm.aspx. Just remember to have a sounder and not rely on email to tell you it’s ablaze.

If you are switching power using the Pi-mote consider monitoring the device you switch to get confirmation the signal has been acted on. I lost count of the number of times I came home to a half dark house after the wireless signal failed to get to some of the lights. Ended up moving bits around and adding extra units to fix it. Note this was not the Pi Mote unit to be fair.

I would also add Node-Red to the project to either control the bits or act as a dashboard :D
Need Pi spray - these things are breeding in my house...

Posts: 1187
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Automation of green house parameters control

Sat May 11, 2019 2:32 pm

Lots of ways to accomplish your desired results, have fun with it.

I would suggest however you rethink the servo/stepper dial up heater control.. Perhaps use pwm and a Solid State Relay SSR to provide a variable/controllable power supply for the heating?
a 50% on pwm duty cycle is effectively half power etc.. ... elay-Setup

I do something similar but use a number of off the shelf products rather than DIY solutions (imho and ' my skill level its cheaper, quicker, and significantly better battery life in stand alone devices )

for switching mains devices i use smart switches reflashed with tasmota so they can be controlled by issuing commands via mqtt.

The Pi runs headless and communicates with smart switches and sensors via wifi/bluetooth.. Hosting Mosquito Mqtt broker and node red for data flow control.

Most 433 mhz alarms and sensors can be decoded with a sonoff rf bridge again reflashed with tasmota this simply turns the box into a wifi/mqtt repeater for 433mhz signals so water level alarms/buttons/smoke detectors etc can be included in your system very easily, just trigger the alarm/sensor and watch the devices output for the corresponding code issued as a mqtt topic/payload combo I have had 100% success with digoo brand 433mhz devices.
the sonoff rf bridge will only decode basic fixed code signals..

And finally Plant sensors as exploited in these projects ... n/17453/10 ... pberry-pi/

Node Red lets you subscribe to mqtt topics and start a dataflow off with receipt of the published data very simply.

so for example a simple flow to respond to a temperature measurement can issue a Mqtt heater on command if the temp is lower than a level ;)
and the contrib-xiaomi-ble-node makes querying a xiaomi ble sensor a doddle :) ... xiaomi-ble

other perhaps useful links ... Bridge-433

Return to “Automation, sensing and robotics”