Smart Home Smart Shower Project

You can read my research and thoughts on smart showers but, this project shows how I have retrospectively implemented a very smart shower in our current home and one that is fully integrated into my contextual smart home.

Design

Rather than develop or modify the shower hardware myself, I've taken an approach that works with our existing shower controls and ensures that the user experience is simple, familiar and intuitive. There is no technology to play with and nothing new to learn. The shower just works as it did before but everything around it works better. This is good because there is nothing to confuse visiting guests.

Shower PCB

To hugely simplify the connection of all the required sensors it made a lot of sense to design a bespoke PCB, using Autodesk Eagle. This board connects to an Arduino processor using our standard 10-Way DIL connector.

It exposes connections for the following:

Build

Arduino Mega 2560

The Arduino Mega 2560 is well suited for this kind of project, with loads of IO capability and plenty of memory for code and data storage. With an Ethernet shield it can easily become part of the smart home.

Arduino Shield

As part of my smart home building blocks approach to the smart home, I have developed my own Smartisant Arduino Shield SHLD1, to enable me to prototype and build new smart home services and features quickly and reliably. This is described in a lot more detail here.

This enables easy connection of:

Shower PCB

This is the custom shower PCB built up with components. I've actually used this board in other projects as it has proved really useful.

Occupancy / Distance Sensor

In the ceiling above the shower, I initially mounted this JSN-SR04T water-proof ultrasonic distance sensor. When the shower is unoccupied, it 'pings' every 2 seconds to spot for a person in the shower. If spotted, occupancy is assumed and it then only 'pings' every 10 seconds. If it hasn't seen anyone after 60 seconds, it assumes the shower is no longer occupied.

Note:  Testing showed this sensor to be too sensitive and it would falsely trigger, even with some careful algorithms. I have now replaced it with a Sharp 2Y0A21 infra-red distance sensor, which also uses a clever algorithm and it doesn't trigger falsely.

The 'Shower' is a zone within the 'Bathroom' zone, within the 'Upstairs' zone, within the 'House' zone. Whilst shower occupancy looks like something relatively insignificant and local to the shower, it is part of the much wider context model and can have a big impact on the way my contextual smart home operates.

Shower Tray Leak Sensor

I've installed on of my Smartisant Flood & Leak Sensor FLD1 under the shower tray. This is quite inaccessible and this type of installation is exactly why I developed my own wired sensor (with no batteries) with a 25+ year life time.

Shower Lighting

The shower lighting and fan are all part of one overhead unit. The existing system was a ceiling fan vent with an integrated MR16 12V bulb.

The replacement for this is a custom 3D printed housing that utilises the existing hole in the ceiling and the existing 100mm pipe to the in-line extractor fan. The middle circle houses a standard MR12 LED bulb and my dynamic smart lighting.

To get really good light levels in the shower, I'm using a 12V dc LED MR16 dimmable bulb and this is a natural white colour (not warm white or cool white). It's a 7W bulb with very good light output.

The Arduino can't drive loads this powerful, so I'm using another of my smart home building blocks, a high current, low voltage MOSFET output module.

For the dynamic smart lighting I'm using a Adafruit NeoPixel Ring 24 and this sits around the MR16 bulb. This is a ring of 24 5050 RGB individually addressable LEDs with integrated drivers and it allows me to do some really powerful effects.

This is controlled directly by the Arduino but it requires a local, high current 5V dc power supply.

After a 9 hour print job, this is the shower light and extractor printed.

Both of these lighting elements sit behind a 75mm diameter frosted opal Perspex disc, which looks nicer and also protects them from moisture.

A conical enclosure covers the back and also protects the lights from moisture.

Shower Extractor Fan

My shower controller does intelligent extractor fan control based on current humidity and temperature. It also uses a rolling average over 9 hours, to create a baseline humidity against which the current humidity can be compared. This is an example of a virtual sensor.

The controller also allows my Home Control System to control the extractor fan too. For example, if it needs to get fresh air into the bathroom.

Bathroom Towel Rail

One of the great things about Arduino devices being used in this way, is that it can basically be many smart things at once. Another one of the many things supported is our bathroom towel rail, which has a mains voltage electrical heating element within it. The Arduino directly controls this via a Solid State Relay (SSR).

Smart Home Integration

Over my many years doing smart home (I started in 2004), I have developed my own library of code for Arduino processors and this includes functions to integrate it into my distributed Home Control System and connect numerous types of sensors. These 'slave processors' can then do clever stuff like local control, self-monitoring of performance, local signal conditioning and rate limiting, send warnings and errors, or host some functions locally.

This maximises reuse across my many smart home projects, making it very quick and easy to develop and test new smart home capabilities. My smart home also employs the concepts of technology abstraction, meaning my smart home is also technology agnostic. This allows old technologies or broken sensors and devices to be swapped out with new ones, with minimal effort and zero reconfiguration.

Most of the Arduino processors installed in my smart home use an Ethernet IP network interface, to enable them to send and receive events with my Home Control System, using my unified communications protocol. Wired networks ensure very low latency and hence a great user experience, though occasionally I will use Wi-Fi.

Adding sensors and devices to my Home Control System is simply a matter of adding one line of JSON for each one, to the main configuration file. This defines the name, zone, object type and also the details of the slave processor it is hosted or controlled by. All the intelligence is within my Home Control System, which receives and sends encrypted events using my unified communications protocol. It sends events to update my smart home on things like the temperature, humidity, fan state, appliance and lighting state changes, occupancy, etc.

There is a lot of bespoke code to this project though, to basically create a smart shower controller. The dynamic smart lighting code is now a reusable library that can be used to create dynamic smart lighting in other form factors.

The shower controller can initiate effects locally but it can also receive events/requests from my Home Control System, to start effects.

Testing

Distance Sensor

The distance sensor has a defined range and this can be limited by the timeout set. I want it to detect people between 10cm and 140cm from the sensor. A timeout of 8730 equates to a maximum detected distance of about 150cm.

Note:  People are relatively soft targets and ultrasonic distance sensors don't work as well with people as they do with hard surfaces. The detection is not brilliant and this is why I use a range of techniques to detect people in the shower. The best of these is water flow as it is persistent occupancy. I'm looking at better ways of detecting people in the shower I'm currently designing a reflective reflective beam break sensor.

Fan Run Time

With so many things driving the extractor fan (occupancy, humidity, user interaction, etc.), the fan can often switch on and off with quite short durations and this is not a bad user experience but, it just feels a bit wrong. To rectify this, my software basically enforces that the fan runs for a minimum of 5 minutes (300 seconds) and once off, it will stay off for 3 minutes (180 seconds). This is easily adjustable in software, so I'm going to experiement with different durations, to see which works best.

Some kind of fan 'over run' is essential because just because the fan has cleared the damp air in close proximity to the sensor, this doesn't mean all the damp air has gone out of the bathroom. This is one reason why I'm experimenting with a variable speed fan.

Use Case & Examples

This example tweet from our @smartest_home shows how it monitors the shower air temperature. This is used to accurately measure relative humidity and this is used to intelligently control the extractor fan.

This example tweet from our @smartest_home shows how it monitors the shower water temperature. This is used as an input into the dynamic smart lighting.

This example tweet from my @smartest_home and shows the extractor fans under full smart home control, providing a zero touch user experience.

Summary

This project is all about a great user experience and making everything as close to a zero touch user experience as much as possible. This then provides a feel of luxury. As with all my projects, this is also about providing the most reliable experience possible. Another important element with things like a smart shower is protection of privacy. My contextual smart home resides within my home and keeps all data private and within my home.

This project is quite a big undertaking in terms of the hardware and software required but, the use of reusable smart home building blocks and my own software library makes it much quicker and easier. It's a no compromise approach, to deliver the best possible user experience. The distributed architecture means that all the important elements of this smart shower will continue to work, even if the Home Control System is not available. Most importantly, the basic shower function also has no dependency on the technology deployed by this project.

This project also demonstrates how a cheap Arduino processor can cheaply enable a large number of highly integrated smart home sensors, devices and appliances, that would cost a lot of money if bought as separate smart home products. This level of integration also provides a much better and more coherent user experience, whilst also contributing to the wider whole home context of my contextual smart home.

My goal with my smart home is to deliver "intelligent assisted living for all" and this is a good example where dynamic smart lighting can provide visual notifications that work for everyone but are particularly useful for in noisy environments or for people with hearing impairments.

Further Reading