Add static IP address to ethernet

Raspbian Jessie

sudo nano /etc/dhcpcd.conf
interface eth0

static ip_address=192.168.1.82/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.162

 

On Older Raspbian

sudo nano /etc/network/interfaces

address 192.168.1.67
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

So you want to record the temperature over time?

So you want to record temperature measurements over time?

I have used the Adafruit guides to teach myself how to log the weather.  They're fairly easy to follow and the guides are updated regularly.

See this Adafruit guide on how to publish temperature and humidity readings to Google docs - https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging

The Adafruit guide uses a DHT11 sensor that can measure temperature and humidity.  My advice is to use the slightly more expensive DHT22 sensor as it's more accurate, has higher and lower humidity sensing, and is more stable.

You can add multiple DHT sensors to a Pi but each sensor requires one dedicated pin on the pi (26 pins are usable of the 40 available).  You can also use DS18B20 1-Wire Temperature sensors to record the temperature.  These can be "networked" together requiring just one pin on the Pi.

Adafruit guide on DS18B20 temperature sensors - https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing

You might wish to record the ar pressure.  Adafruit again has a guide but it looks out of date - https://learn.adafruit.com/using-the-bmp085-with-raspberry-pi/using-the-adafruit-bmp085-python-library?view=all

My Setup

I have 2 Raspberry Pi's running 24 x 7 x 365 days a year measuring the weather.  The data is dumped to a MySQL database running on a website.

Pi 1 (at rear of property) - 2  DHT22 sensors (one inside, one outside), 20 DS18B20 temperature sensors, 2 Light sensors (inside and out), pressure sensor, Pi camera

Pi 2 (at front of property) - 2  DHT22 sensors (one inside, one outside), 5 DS18B20 temperature sensors, 2 Light sensors (inside and out), rain sensor, wind sensor, pressure sensor

 

Notes

Raspberry pi 3 chosen as it has built in wifi and low energy Bluetooth.  Cheaper older models are available but you'll have to buy Wifi adapter.  Most guides are written for Pi 3.  This would run on a Pi Zero (£5) but you then have extra problems with things like 1 usb port, soldering on the headers etc.

You can run a Raspberry Pi 3 from a normal USB power supply (mobile phone charger) as long as it can supply at least 2 amps.  The Pi will run on power adapters supplying less than 2 amps but you may run in to problems.

Sometimes you can buy higher capacity memory cards cheaper.  You need at least a 4gb memory card and I currently use 8gb cards.  I backup my cards every time I make a major change, so backing up 16gb card's would require more space.  The Pi supports up to 64gb micro SD cards.

Equipment Required (total about £60)

 

Optional

 

Other Stuff

Using Energenie Power Plugs

Forget Energenie's own sample.  See http://bennuttall.com/whats-new-gpio-zero-v1-2/

https://pypi.python.org/pypi/energenie

 

from energenie import switch_on, switch_off
from time import sleep

# turn all plug sockets on and off
switch_on()
switch_off()

# turn a plug socket on and off by number
switch_on(3)
switch_off(3)

sudo apt-get install python-pip
sudo pip install energenie

sudo apt-get install mysql-client python-mysqldb -y

 

 

 

General Update – 1st December 2015

I've produced version 2.1 of the WeatherPi and now have 4 in long term test.  They seem to be doing well.  It looks like the MCP23017 chip can't keep up with the wind speed detector, so that's sensor is now going through an arduino nano, and in to the pi via the serial connection.  If an Arduino Nano is being used, might as well use it for the analogue sensors as well.

Possible changes to the Weather Pi? Remove 2 x I2C Analogue converters and replace with an Arduino Nano. Add 2 headers dedicated to running servos direct from the pi for Pan and Tilt Camera. Add header for serial I/O. Possibly pre-route some GPIO ports to the breakout section of the board.

On a separate subject I've moved the 433mz receiver from a dedicated Pi to the Weather Display Pi.  This seems to be working well.

I've removed the aircraft tracking facility from Pi 7 as I never seemed to actually use the data.  I did have it feeding in to the Flight24 website but again they never seemed to use the data.

My test Pi is currently testing PL9823 RGB Addressable LED's which are similar to Neopoxles / WS2811 / WS2812.  Testing seems to be going well, although I can only get them displaying Red, Green, Blue, Yellow, Purple, Pink and White.  I can't get them to "dither" other colours.

I received a Pi Zero on the front cover of my Magpi Magazine, and at this stage not sure what I'll do with it.