using a raspberry pi for environmental monitoring · using a raspberry pi for environmental...

8
Using a Raspberry Pi for Environmental Monitoring Colin Pegrum FieldSolutions and Department of Physics [email protected] Raspberry Pi Day University of Strathclyde, January 17 th 2015 [email protected]

Upload: vanquynh

Post on 19-Aug-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Using a Raspberry Pi for Environmental Monitoring

Colin Pegrum

FieldSolutions and Department of Physics

[email protected]

Raspberry Pi Day

University of Strathclyde, January 17th 2015

[email protected]

Motivation and Aims

● Need for a robust, economical and extendable system for measuring temperature, humidity, light, etc. in small-scale commercial horticulture, where system cost is an issue.

● Significant running-cost savings by monitoring and controlling temperature in winter – heating is expensive!

● Needs accurate (to within 1°C) and re-configurable temperature sensors, with lots of sensors distributed over a wide area.

● Data needs to be fully accessible remotely anywhere as a web page.

● The Raspberry Pi has proved to be ideal as the core of such a system.

Raspberry Pi Day 3

System outline

mains

24 volt power supply

24 V

router

Ethernet + power

POEcombiner

Ethernet cable

Ethernet cable

POE = Power Over Ethernet

Raspberry Pi

I2C, SPI & 1-wire interfacesReal-time clock (RTC)Pressure sensorSystem monitorsUSB data backup

One-wiresensors

S

S

S S

Up to eight radial sensor branches(three shown)

S

S

Twistedpair cabling

“One-wire” sensors use twisted-pair cabling, data and power on same line

Raspberry Pi Day 4

And the hardware...

Power over Ethernet injector

24 volt supply

IP67 ethernet connector

IP66 porous vent plug (for humidity control & pressure equalisation)

Cable glands or conduit fittings for sensor wiring

IP65 enclosure, lid removed

ESD and RFI protection

R Pi and interface circuitry

Sensor terminals

Up to 20m of Ethernet cable

Need to keepwater out!

Raspberry Pi Day 5

The Raspberry Pi and its interfaces

PoE power supply (LM2596)

Real-time clock (DS1307)

BMP085 sensor for barometric pressure

I2C, SPI and 1-wire interfaces on top.

Raspberry Pi is underneath.

8 channels for 1-wire sensors

Die-cast box

Raspberry Pi Day 6

Software overview

● Supports live addition or removal of sensors at any time● Handles missing or corrupt data; tolerates power outages and other upsets● Readings and 24-hour plots are updated every 10 minutes

User database(site-specific settings) *

Sensor database(name, type, location, etc.) *

Main program in CLooks for and reads sensors.Validates data.Generates HTML and graphs, dynamically.Archives data; recalls past data.

* User configuration data, managed remotely

Web serversApache and owhttpd

Javascripts

Librarieslibownet for 1-wire sensor protocollibwiringPi for GPIOlibploticus to plot graphs of datalibminIni reads configuration data

PHP and SQLite3(for data mining, under development)

Raspberry Pi Day 7

Some measurements ...

www.shrublandparknurseries.co.uk

spnelmsett.plus.com

See

and

Raspberry Pi Day 8

Greenhouse installation

Humidity

Temperature