Hardware Choices in Monitoring a Greenhouse
Tags: rasberrypi, hardware, offgrid, solar
Published: 2019-06-09 00:06:10

---
series: Greenhouse Telemetry 
title: Hardware Choices in Monitoring a Greenhouse
published: true
description: My journey into monitoring (and perhaps controlling) my greenhouse
tags: #rasberrypi #hardware #offgrid #solar
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sjrlj7bgwdzcxp3lruiy.jpeg
---

### What do we need?

A power system for an off-grid, greenhouse telemetry Raspberry Pi setup.  Turns out it's actually pretty easy, even for a power layman like myself.

#### We need power

First, make the Pi efficient.  I'm controlling my Pi via VNC remote desktop but I'll move it to headless soon.  I wont be using the HDMI so disabling that circuitry makes sense, let's save the 25mA that it uses:

```
/user/bin/tvservice -o
```

Then I don't need flashing lights, so another 10mA (5mA each) saved:

```
echo 0 | sudo tee /sys/class/leds/led0/brightness
echo 0 | sudo tee /sys/class/leds/led1/brightness
```

I've seen Pi power estimates (HDMI and lights are turned off) as high as 2 Watts per hour.  I want extra power though to allow later expansions and because I don't trust any data based on Scottish weather.  So let's just see how much bang we can get for our buck running it 24 hours.  

#### Can we power off grid?

Using [European Commission Data](http://re.jrc.ec.europa.eu/pvgis/apps4/pvest.php) we can see that in summer (April-September) using a [50W solar panel](https://www.amazon.co.uk/gp/product/B01FKJUNFC/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1), we can hope to generate between 130-200Wh per day with a yearly low of 40Wh (E<sub>d</sub> in the table below).  My position is a little awkward (east facing with a shadow cut off point) so I'll be somewhere below that figure. 

![Figures in kWh](https://thepracticaldev.s3.amazonaws.com/i/0suebwl0v3mcxjxzcssx.png)

So I could almost run this system throughout winter.  If solar generation was spread out over 24 hours, which we know it isn't.  A bonus with my chosen panel is that it comes with a controller to save me messing with electronics and making a mess of the power circuits.

#### So we need power at night

We need 48Wh to power the Pi (2Wh over 24h) and we're getting 130+ in a short time frame then nothing for the rest.  We need to spread that out.  So a battery. Something that will:

 - Give us room to grow
 - Will support plenty of discharging/recharging

So, lets say [80AH](https://www.tayna.co.uk/leisure-batteries/hankook/dc24/?gclid=EAIaIQobChMIy4Csj7nU6wIVOYBQBh12wQHGEAQYASABEgIQQPD_BwE), that looks about as expensive as I'm willing to pay.  This equates to 960wH (80Ah x 12V) or 20 Raspberry Pi days straight.
It's also a deep cycle (meaning it'll run pretty low, safely) so has quite a large buffer area for power issues and loads of extra power for expansion.

### And that's it

It works, it's been running for 3 days straight in my home, 1 in my greenhouse.  I get way more active solar charging time than I expected being east facing so I have more power than I know what to do with. 

Now to think of something else to do with it all.

![The greenhouse](https://thepracticaldev.s3.amazonaws.com/i/hlbvtvoaj7rw0g048gln.jpeg)

### Next

I'm also looking at products or techniques to allow me to monitor and log incoming solar charge and consumed battery.