In Norwich (UK), frequent rainfall and tidal surges often cause the river to overflow, resulting in significant problems across the city such as impassable walkways, cycle paths, and roads. It has been particularly severe this winter, see this article. Particularly effecting heavily travelled routes connecting residential areas to the city centre, forcing commuters, shoppers, and pedestrians to find alternative paths mid-journey. The severity of flooding is hard to gauge until well into the route, and the isolated nature of these paths often requires significant backtracking to find alternatives.
This device monitors river water levels to detect floods in real-time. By placing sensors in flood-prone areas, the device can send real-time data to the cloud and onto a website for users to access. This helps travellers avoid flooded routes and aids boaters in navigating under low bridges. Additionally, it assists the city council in managing river maintenance tasks more efficiently. The device's data can also be used for environmental research, offering insights into flood patterns and aiding predictive maintenance efforts. Currently, existing sensors upstream provide historical data, but they lack real-time updates and don't reflect local flooding conditions in the city.
System OverviewWe are using the AVR IoT Mini Cellular as the main board to handle sensor readings and transmit these values to Amazon Web Services, then presenting the data to a website. The water level sensing used is an interesting set-up. Originally, I planned on using a capacitive sensor array similar to those used in irrigation and plant-feeding systems. This fell through due to how unreliable these cheap sensors can be, and the scale of change they can detect. I was looking for the detection of change in the 30-60 cm range. Without significant 'jerry-rigging', this would not be possible with these types of moisture sensors. Therefore, an alternative contraption was thought up.
Using a small float or buoy, attached to a rail, I could track the change in water level by monitoring the float's position. To track this float, a small IR sensor was mounted to the top of the rail, pointing down at the top of the float. By measuring this distance, we can derive the water line and any changes.
The analogue sensor values are mapped to an integer from 0-30 (representing centimetres) and then sent to AWS to be displayed on the website. The data can be shown as a live graph, variance from the mean level or perhaps show the lows and highs of the day.
The system will be left by the river for a long time, without maintenance and must still produce accurate water level readings. Therefore, the instrument had to be robust and reliable.
The main mechanism is very simple. A large float was 3d printed that slides over an aluminium extrusion about 30cm long. This rail restricts the float to only move vertically with the water level, with a large tolerance left for the float to move freely up and down, guided by the rail. A bolt through the rail stops the float falling off the end.
The board and IR sensor will sit at the top of this rail, so a mount and housing were also designed and 3D printed. The IR points down the rail toward the float. I was not sure how to attach the device to the river bank, for now, a simple screw mount could work for installing it on a wooden beam along the embankment. The microcontroller housing, sensor and mount all attach via a bolt at the top of the rail. A 'bounce plate' was retrofitted to the top of the float to ensure the infrared light bounces back to the sensor by the float and is not lost refractively to the water.
A solder breadboard was used for this prototype as I was not sure what sort of IO would be used in the future and wanted to keep it fairly open to changes along the way. A half-size solderable breadboard keeps the device fairly strong but allows hardware changes and expansion. For now, the breadboard wiring is not very important as it just wires up to a 3-pin JST connector for the IR and another 3-pin JST for some status LEDs I plan to add. The IR sensor is a SHARP GP2Y0A21YK0F, which unfortunately did not arrive in time but I am familiar with this sensor so I was fairly certain it would be adequate for this system.
Here are some images to show the system design and components
I got the AVR IoT Mini Cellular set up to send the sensor data over MQTT to the AWS, this can be seen below as I have the MQTT test client open and subscribed to my device's 'sensor' topic, where the IoT device published the water level every 10 seconds.
So far I have:
- Designed in CAD the whole system including measuring instrument and housing.
- Printed the float system and tested the first functional prototype
- Soldered up the first version of the wiring for the IR sensor and LEDs
- provisioned the MCU for AWS
- Set up the MCU code to read and send off data via MQTT
- Received data via AWS
Currently, there are some things still left to complete due to issues getting components and a personal lack of time to indulge in this project.
- Set up AWS S3 cloud object storage for device data
- Set up a simple display website and retrieve data from the S3 bucket
- Explore what else the data can tell us
- Deploy for its first trial period of data collection, in the field!
This has been a very interesting project, with some unique problems to solve such as how to record significant water level change, designing for a low maintenance and robust system and getting familiar with flood analytics.
I am excited to develop this solution further. I can see great merit in its use across the city, perhaps extending the insight this little device can uncover. Consider, the detection of river traffic by sensing the waves from boats and watercraft as they pass, predicting water levels based on previous readings and forecasting flooding in advance. I can also see some machine learning applications, perhaps in training a model to differentiate types of activity of the river based on features of the water level data. I think this information could benefit a few different groups. Firstly, those who use flood-prone infrastructure, allowing for easier access to flood information, local to the area. Secondly, specialists interested in river traffic such as the city council or boat hire companies. Thirdly, environmental scientists may be interested in building larger datasets of local flood data for Norwich and the surrounding area. These datasets could be used to analyse patterns and understand tidal surge symptoms or behaviour. Finally, these devices could inform predictive maintenance efforts as they can show where areas are more flooded and when. This can tell the environmental agency workers when dredging or desilting may be needed while allowing for planning flood-related clear-up work.
Anyway! Hopefully, some of this will become a reality soon as I continue this project in my spare time over the next several months, and remember to come back for some updates and related posts.
Thanks for reading this! Maybe consider building your own, it's very fun! The code, CAD and other info are linked.
Comments