Skip to content

External hardware

Nigel Johnson edited this page Dec 28, 2019 · 4 revisions

If you want to see the difference between the temperature sensors, see the sensors section below.

Version 2.0

Assuming you have a Pi Zero WH, with the correct power supply and SD card, you only need some wire and connectors to suit your purposes, plus the specialised parts below. You can also use an extension cable and splice the Solid State Relay into the live wire. Lights, Heaters etc are not listed either.

  • OLED screen. ~£6. Uses the I2C bus and expects to be 128x64 pixels.
  • Momentary push button. ~£1.
  • DS18B20 for waterproofed temperature only (It's also faster and more accurate). ~£2
  • DHT22 for temperature and humidity. ~£5. (A DHT11 can be substituted if you like ~£3)
  • MH-Z19B if you want to measure CO2 levels. ~£17.
  • CX240D5 Solid State Relay for each trigger you want to control. ~£13 x3 for example.

For an approximate total of under £70 for parts (which could be cheaper if you don't order via amazon prime) plus £30 for the controller bits plus cables, connectors and extensions, you can have a really cool hydroponics setup in your 4'x4' grow tent (assuming you already have the tent, heat, lights and fans) with CO2 triggered venting. For £30 less you get a nice reptile vivarium controller (assuming you already have the reptile and vivarium) or Deep Water Culture controller (assuming you already have the bucket, air pump, etc) or succulent care station or germination station (assuming you alrea... well you get the picture).

Version 1.0

This is quite a list if you want to get into the nitty-gritty. But if you have 20AWG for the 240v side and optionally 24AWG for the 5v side, ferrules if you're using them, as well as all the tools (soldering iron etc), then there is less to work out. You will need to substitute parts below if you live outside the UK... and you can if you want to reduce cost and can get things outside of Amazon Prime for example. I have also built my own custom PCB to route wires, but I'll outline where things are plugged in so you can do this in your favourite way.

Senors explained

What are the differences between the different sensors used? well, let's take a look.

The DHT11/22 temperature and humidity

The DHT11 has been a reliable sensor in hobby electronics for years. The upgraded DHT22 is more accurate, less prone to spurious outliers but a little slower (refresh rates of 2 seconds as opposed to 1 second for the DHT11). Both of these are fine for our purposes as we only poll the sensor every 5 seconds anyway, and they do provide a humidity reading. The problem with these sensors is that they are very 'noisy' in that the values between readings can fluctuate a fair bit. Also, an occasional way out of range value is possible despite checking the CRC and handling failures with retries as required. A typical temperature graph would look something like this:

DHT22 temperature graph

You can see the outliers circled, and this was a good test run. I was getting -7 degrees and 45 degrees in some readings. The banding you can see is just because of the resolution of the sensor.

Here is a humidity graph for the same period, with the outliers circled. There were generally less of those.

DHT22 humidity graph

DS18B20 temperature only sensor

This sensor is probably the best option if you only want a temperature reading. It is fast, accurate and comes in a waterproof housing option. In terms of accuracy, you can see how smooth the graph below is and the significant lack of outliers.

DS18B20 temperature graph

MH-Z19 and MH-Z19B carbon dioxide and temperature sensor

This sensor is still in testing so I don't yet know a lot about it, but it is an air based sensor. The MH-Z19B is an upgraded version, but they are both serial devices and both seem reasonably accurate at this point. The older - non-B version - is a little cheaper.