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.
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.
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