Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
WeatherStation hardware
Last updated at 12:03 am UTC on 15 October 2023
There are two parts of the hardware to consider

The Pi

The installed Raspberry Pi box, high in the peak of the workshop roof-
WeatherPiBox.png
It looks pretty cool at night, little glowing lamps of computational effort lighting up the dark. With the lid opened to see the magic inside -
WeatherPi interior.png
Power and ethernet come in at the bottom via the POE link - which means I can reboot by going to my server room and just unplugging it and plugging it back in. The power lead goes straight to a 40 pin header on the Pi model A+. Ethernet goes via a very cheap and tacky lan->usb dongle/hub that I mangled a fair bit to a) make work and b) cut the cable down to a sensible length.
Also connected via the 40 pin header is the power and i2c link for the SDL Weather Board. Attached to said board are

Wiring connections

The simplest option for wiring is to use a 40 pin header that fits on the Pi and make just seven connections. The pin numbering on a Pi can be a bit confusing since the physical order is unrelated to the GPIO number and the various power and ground pins do no have GPIO numbers. The best thing is to take a look at https://pinout.xyz/pinout/i2c. For details of the weather board (including a map of where the assorted connections are) see http://www.switchdoc.com/wp-content/uploads/2016/07/WeatherBoard_CurrentSpecification.pdf
Pin Connect to
5v 5v power in from your PSU - in my case the POE dongle.
3v3 3.3v power from Pi to the weather board connector JP4/3; we probably ought not use this but it seems to handle the minor power needs to the sensors ok thus far.
Gnd ground from the PSU/POE and to the weather board connector JP4/4
GPIO 2 i2c clock, SCL on weatherboard connector JP4/1
GPIO 3 i2c data, SDA on the weather board connector JP4/2
GPIO 20 rain bucket 'tick' pin, connects to weather board pin JP2/2
GPIO26 anemometer 'tick' pin, connects to weather board pin JP2/3

The last two are set in the Python code as 'anemometerPin' and 'rainPin' shortly before they are used to initialise the weather board object with
weatherStation = SDL_Pi_WeatherRack.SDL_Pi_WeatherRack(anemometerPin, rainPin, 0,0, SDL_MODE_I2C_ADS1015)


The ADS1115 breakout board I got happens to have pins that exactly align with the weather board connector JP5. You could easily just use a strip of header pins to mount the ADS straight onto the weather board; I used short wires since I'd already soldered the pins on in a manner that made it a bit tricky. All the other connections for the rain/wind and AM2315 sensors are covered in the weather board doc referred to above.

Indoor sensors too

To add some extra fun I wanted indoor sensors for temperature and humidity to place around the house. You don't really want to use Raspberry Pi boards for this sort of thing since they are after all real computers and not microcontrollers. Most people would probably start jumping up and down chanting "Arduino! Arduino!" like fans at a feet ball joust but there is actually a rather better answer these days in the ESP8266 which provides a surprisingly high performance 32bit cpu, a modicum of RAM, some flash storage and built in wifi at prices in the USD$5 range. They can be programmed in a variety of ways but I used the Arduino IDE with suitable support modules loaded; this makes it really simple to install drivers for the assorted sensors and an mqtt client. Adding sensors is remarkably easy and indeed, the WeMOs.cc mini D1 pro version (latest version is a little different to those I used in 2017) has nice simple to attach daughter boards with suitable sensors. They are a little more expensive than run of the mill AliExpress clones but seem to be a bit better built and still cost less than USD$60 for 6 each of the main board and sensor shield, delivered quickly (that was 2017 - current - 2023- prices seem to be about half that). It wouldn't be at all hard to add other sensors to the mix; passive IR body-heat detectors, door-open switches, infra-red remote stuff, all the usual 'Smart House' stuff. At the price it isn't ridiculous to imagine dedicating one to telling you if a door is open. Slightly out of scope for my interests is the observation that a friend at my local MakerSpace has been able to send mp3 streams to an ESP and output the audio with good quality. Maybe a baby monitor?

My software for driving the ESP boards is here -
ESP8266-sensorsplus MQTT-tpr.zip
This includes versions for DHT22, SHT30, BMP280 & BME280 sensors.
Again, edit the WiFi network credentials and MQTT broker address. Substituting other kinds of sensor in the code is pretty simple. Note that this version makes the ESP go into deep sleep after completing a publish cycle; this requires connecting the D0 pin to the RST pin in order to actually wake up after the requested delay. It save power and perhaps more importantly stops the warmth of the cpu distorting the reported temperature.