System schematic

In this post I will set out the basic structure of the first phase of the system, and provide a bit more detail on some of the electronic components that I’ll use in the build, and software processes that I’ll use to handle the data that is collected.

Broadly speaking the system can be split into two parts – the part that is in the greenhouse and the part that is in the house.

140929 PMG schematic

In the greenhouse

In the greenhouse there is the ‘environmental monitoring unit’ (EMU). This is the part of the system that will collect data on conditions in the greenhouse to send back to the data logger in the house. It will also have some basic 12VDC power control functionality, and perhaps a basic user interface.

The ‘brain’ of the EMU will be an Arduino Nano board, which is based on the Atmel ATmega328 microcontroller. These are fantastic for this sort of task – they are extraordinarily cheap on eBay, come pre-constructed with 0.1” header pins making it easy to test circuits with a solder-less breadboard, a USB port for loading programs, and the Arduino provide a very simple C-like programming environment that is not too daunting for someone whose coding skills are a little rusty! They can also be powered with up to 12VDC, supplying voltage to attached components at either 3.3VDC or 5VDC.

On the sensor front, I am planning to incorporate:

  • three temperature sensors: one for inside the EMU to monitor the temperature of the electronics, and two waterproof probes – one for inside the greenhouse, and one for the outside environment. All three will be DALLAS DS1820 as they offer good accuracy (±0.5°C) at a reasonable price;
  • one raindrop sensor for the greenhouse roof;
  • one PIR for detecting movement in the greenhouse; and
  • a light-level sensor.

In later phases I will be looking to incorporate soil moisture sensors, but I will need to consider whether to hook them up to the EMU, or if there will be enough of them to warrant a separate microcontroller.

To provide some basic power control, there will be two MOSFETs to allow the EMU to control some 12VDC powered devices. One of them will be used to control an LED strip mounted along the inside of the apex of the roof, to act as a welcome light when it is dark.

I am in two minds whether to incorporate a user interface into the EMU. If I do it will most likely have a simple LCD display (such as the 1602 LCD type) and a push-button rotary encoder to control a simple menu system. It may be useful for testing  and displaying diagnostic information but will come at a price of five pins on the microcontroller. I’ll give this some thought.

In the house

Environmental data from the greenhouse will be sent via a wireless link (see below) to a Raspberry Pi (Model B) computer in the house.There it will be placed into MySQL database for later querying and presentation on web-pages served up with a LAMP (Linux-Apache-MySQL-PHP) server connected to my home network.This will allow me to access readings and charts from around the house via WiFi with a simple user interface, and perhaps change some configuration settings for the watering system that will be added later.

The Raspberry Pi will be mounted in an Italtronic DIN Rail/ Wall Mountable Enclosure and tucked away in a discreet corner somewhere in the house. The advantage of using this enclosure for the project is that there is plenty of room inside to mount the card for the 2.4GHz wireless link without having wires poking out everywhere.

2.4GHz link

For the data-link between the greenhouse and the house I am using Nordic Semiconductor nRF24L01-based cards. These are widely available and very cheap (<£1 without antenna, <£4 with external antenna) – far cheaper than WiFi – and easily controllable with compatible libraries for both Arduino and Raspberry Pi. I’ll blog later with more details on setting up the data-link


What’s all this about?

To help set later posts in context, I thought I’d set down a basic description of what I am trying to achieve and how. This will hopefully help readers make sense of some of the choices I make on components / techniques etc later.

The overall aim is to create a system that can monitor the environment and adjust the growing conditions for the plants in the greenhouse without regular intervention from me. Ideally I’d like to get it to the point before next summer where I can leave it for a week or two having done nothing more than check there is sufficient water stored before I go. I’d also like to do it as cheaply as possible – money doesn’t grow on trees, even in a well maintained greenhouse.

I see the project developing in stages:

  • Initially I am concentrating just on the sensing aspects i.e. collecting, storing, and presenting data on the conditions in the greenhouse;
  • Next up will be watering – delivering the right amount of water and feed for the plants;
  • Then I’ll move on to the mechanical aspects for controlling ventilation– opening and shutting windows and doors, perhaps turning on fans; and
  • Finally, I’ll aim to get the system ‘off the grid’. I have mains power in the greenhouse, but it would be great if I could use the sun and/or the wind to power the system.

I have already made some progress on the first, and over the coming weeks will write a few blog entries on what I have gleaned about cheap and simple wireless data transmission, setting up the data logging system, using some of the sensors (temperature, rain, PIR), and controlling 12V devices with cheap electronics.



So, with this blog I’m going to keep track of my project to automate my greenhouse and garden care. I’ll post separately on the aims of the project, but first a few words about the blog itself.

As I have started work on the project I have found that, whilst the Internet is a great source of information on many of the computing and electronics aspects of it, I’ve found that the information:

  • is spread across many different sites,
  • often requires some prior knowledge of the technical terms and, if you’re a relative novice like me, it can take hours to hunt down what you need to know, and
  • is sometimes just plain wrong.

So what I am going to do here is try and plug some of those gaps and make it that little bit easier for others to take on similar projects. This is not going to be a complete guide to greenhouse automation, or electronics, or gardening, and what is presented here is inevitably going to be somewhat partial – but hopefully a few people will stumble across it and find it useful.

Finally a word about my level of experience in all of this – I have none. I started tinkering with basic electronics a few months ago, know very little about Linux and C++, which I’ll be using for some parts of it, and have no experience of blogging either. So I have no illusions about being an expert in all of this – there is every chance that the solutions I find can be improved upon.

Also I can offer no guarantee of the ongoing accuracy of the information and it should also be recognised that you follow any of the advice at your own risk – it is entirely your responsibility to ensure that you are comfortable that any of this will not damage you, your components or indeed anyone else.