The ground floor of the Queen City Yacht Club sits a foot or more below the high water levels of Lake Ontario. To protect our beloved 1920’s clubhouse, members created and shifted thousands of sandbags and actively pumped out thousands of gallons of lake water every day.

There was so much water in the yard we moved sandbags by canoe.

On several occasions the water broached the level of the sandbags and flooded the ground floor of the building. The water was also bubbling up from below as the water table rose threatening the foundations.

The water came over the sandbag walls and we pumped it back into the lake.

To track and follow the level of water beneath the clubhouse one member built an ingenious gauge from a toilet bowl float and a long rod running through a bright red paper disk with a yard stick attached. Although the scale was arbitrary, we calibrated it by roughly setting the low point and the high point of the red disk. Too low meant we were pumping out so much water from beneath the clubhouse that the foundations could be weakened as we also suck out the sand. Too high and the floors become flooded and we needed to immediately run additional pumps.

The water also flooded up through the entire boat yard which was under water for much of the season. Electric and gas pumps were turned on/off to keep the water from flooding all the way up the clubhouse.

Every two hours, around the clock without fail, a small but dedicated group called the “Pump Brigade” took shifts to check the entire yard and the building. Most of that time I volunteered for the 2am shift from Monday to Friday; every night I would get up, ride over to the clubhouse and do my rounds. And every night I thought there has to be a better way…

IoT

The Internet Of Things refers to using small devices that connect to the Internet. They often contain sensors and can be controlled and can control other things in the real world. It occurred to me I could use this concept to monitor water levels, send out alerts and even control the electric pumps around the club saving time and maybe even the building.

The Water Level Camera

I began with a simple idea of training a Raspberry Pi time-lapse camera on the water level float disk marker so that without leaving my home I could see what level the water was under the clubhouse. One day at around 2pm there was a fluke swell and the local harbour level rose a foot or more in a matter of minutes; it just seemed to come out of nowhere. By chance I was checking the float level camera and I saw the record high in real time. I rushed over to help at the club and Island homes along the north shoreline. The camera really worked well!

Flood Monitor

One day during the break between the Pump Brigade’s two hour shifts the water rose and flooded the clubhouse first floor with several inches of water. Unfortunately it happened at 5am or so and it was a full hour before someone was around to notice the emergency. I got a call at 6am and jumped out of bed to help but at that point it was just a cleanup crew.

It occurred to me that what we needed was a flood monitor on the floor to set off an alarm should the water enter again. Such a device could be very simple in fact and could connect to the Internet tracking and sending alerts; the “Flood Monitor” was born.

It was a simple box, mounted on the wall, with a micro-controller that had two long wires to provide contact with the floor. The device was connected to the IoT using wi-fi and it triggered an email and text alert when water made contact with the floor leads. It ran for several weeks but Internet connectivity issues caused the system to be spotty; not something you want in a critical system. The project did in fact work well when it worked.

A Mesh Network

Apart from wi-fi issues the other big challenge was distance. To have many devices scattered across a large boat yard initially meant using either a Bluetooth network of sorts or a wi-fi hotspot solution to allow the devices to communicate to a cloud based IoT server to display data and trigger events. Both solutions were not ideal.

Then I discovered the power of a mesh network. I began using Particle’s mesh boards as they allowed me to connect, in minutes, many devices to the cloud. In a mesh network each unit connects to either the hub or another unit while passing along the data and extending the range almost organically.

I then mapped out a plan to place several mesh units across the club grounds. All controllers would communicate through a main hub device that would send and receive data using a secure and solid Ethernet connection.

The QCYC Mesh Network Diagram

The gas pumps would have motion sensors to alert the Pump Brigade if it ran out fuel or simply failed. The House Level cameras and sensors would display and measure water levels below the building. The electric pumps would have controllers to turn the pump on and off automatically controlled by the water level sensors.

The mesh network solution turned out to be an easy, reliable and cost effective answer to connecting devices over a large area like a yacht club, its grounds and buildings.

Software

Plugging in wires and circuit boards are just a part of the challenge in building these units. The other component needed is software. Fortunately the language used to write the code is a common platform created by Arduino. There are many libraries and example code available to assist in the task. Particle.io also provides a community forum for developers which is a valuable resource.

As testing progressed, the code evolved and became more sophisticated.

Pump Float Switch

To me, one of the most interesting device I designed and built was also the simplest. It was a stand alone, multi level, electric pump float monitor and controller. Let me explain…

The walkway along the lagoon wall was always flooded. To reduce the ground water a member installed an electric sump pump in a milk crate and tried to pump the water out back into the lagoon. The pump worked vey well but there was an issue. Even the smallest electric pump was so powerful that it emptied the sump area in seconds to a float level manually setup on the pump. The water trickled back in quickly enough that the float switch clicked on and off every few seconds as the water was pumped out and flooded back in.

The solution was to build a small controller that would have two sensors at a low point and a high point. When the water hit the top sensor the controller would turn on the pump using a relay. When the water retreated to the low level the pump turned off. The controller would wait until the top level was sensed to start the process again. It resulted in longer pump times set farther apart. It was simple to build and implement and it worked so well I used to stare at it in amazement.

Powering The IoT

Each one of these remarkable devices have one thing in common – they require electricity. The clubhouse sensors and camera were powered by a USB adapter cable plugged into the wall. The Pump float Switch was also powered by 120V as it controlled the pump with a relay power supply box. The remote yard devices were powered by a small LiPo battery recharged by a solar panel mounted near the device.

The Emotional Side Of IoT

In building these tiny sensors and controllers I felt like I was doing something. A flood is not like a fire or earthquake. A flood creeps up on you relentlessly everyday eating away at your resolve. Building devices that provided data in real time and allowed control of the situation remotely was a small miracle. Information is powerful and IoT gives us a way to collect and act upon numerous small data points in the real world. I can’t imagine a flood without the IoT.

Conclusions

There were many challenges in building the QCYC Mesh Network. Lacking a basic reliable Internet connection was our first show stopper. I tried using an old Mac laptop as a hot spot but it was unstable over long periods. The Ethernet connected mesh network was a major improvement but serious testing never progressed beyond the clubhouse sensors. The Pump Monitors for the yard were later replaced with a cellular solution created for the City Parks Department.

Building devices was easy but building the political will to launch the IoT effort was not. Technology tends to baffle and scare old sailors and I didn’t count on the lack of support for the idea.

In the end it was a successful project with much to learn and work towards the next flood of the century.