Skip to content
Stuart Ward edited this page Aug 29, 2021 · 10 revisions

Welcome to the readinghydro.com wiki!

This is where we are documenting the set up of the Reading Hydro server. The server is used to host:

  1. The readinghydro.org website
  2. The data API that provides the data for the performance charts on the website
  3. The PostgreSQL database that holds the history of data generated from the turbine activity
  4. The data collector app that subscribes to the data feeds from MQTT and stores the data in the database
  5. The MQTT broker that handles the pub/sub method of getting data out of the turbine building

Overview of the data feeds

We capture data from:

  • The control panel in the turbine building, every 10 minutes. This gives us power generation data, water levels, and a calculated flow rate, as well as information about how the turbine is performing - screw spin speeds, gearbox temperatures, etc.
  • An environment sensor in the turbine building, every 10 minutes. This gives us room temperature, humidity, light levels, and importantly from a security perspective it tells us if there is any movement inside the building.
  • A smoke detector.
  • A door sensor, which detects when the door has been opened or closed - useful for security.

Control panel

Diagram showing how data from the PLC is stored The control panel has been installed by Spaans and contains a Siemens S7-1500 PLC. This controls both generators, and there is a touch screen control which shows us how the system is performing if we are in the building.
We have installed a Raspberry Pi running Node Red, and this interrogates the PLC every 10 minutes, gathering the latest set of data. It then publishes this data to an MQTT broker.
On the readinghydro.org server we are running a program called hydro-collector, which subscribes to the MQTT feed and stores the data it receives from the Pi into our PostgreSQL database.

LoRaWAN sensors

Diagram showing how data from the LoRaWAN sensors is stored The environment sensor, smoke detector and door sensor are all LoRaWAN devices, and they use the Smart Berkshire LoRaWAN network - which is provided by Reading Borough Council and is free to use. It is a private instance of The Things Network.
The sensors transmit data from time to time. The door sensor sends messages whenever the front door is opened or closed. The smoke detector sends a message when smoke is detected. The environment sensor sends messages every 10 minutes.
Messages are received by any LoRaWAN gateways in the area (there is one on the turbine building) and forwarded onto the network server. The network server validates that the messages have come from a known sensor, decodes the message and publishes it on its MQTT broker.
On the readinghydro.org server we are running a program called hydro-collector, which subscribes to the MQTT feed and stores the data it receives from the Pi into our PostgreSQL database.

Data API

The data API is documented and kept up to date here: Data API definition for Reading Hydro and Reading Hydro Data API
TODO: At some point it would be a good idea to reformat this document and move it into this Wiki

Clone this wiki locally