Raspberry Pi Hot Water Tank Leak Detector using SPI Modules

Published  December 22, 2016   0
S Staff
Author
Raspberry Pi Hot Water Tank Leak Detector using SPI Modules

Modules and shields are always handy when building some complex circuit, especially with Arduino and Raspberry Pi. These Modules reduce all the overhead of connecting each and every component in the circuit and act as plug and play devices, like LCD shield, Relay Module etc. Here we are sharing a very useful Hot Water Tank Leak Detector project, which can be built easily by using two SPi modules with Raspberry Pi.

First we should understand about SPI (Serial to Peripheral Interface). SPI is a synchronous and full duplex communication interface, primarily used in embedded system to control the peripheral devices using Microcontroller. SPI uses master-slave architecture where Microcontroller generally acts as Master. Advantage of the buses like SPI and I2C is that, you can connect many devices using few pins, like in case of SPI we can connect many peripheral devices just by using four pins where 3 pins is for data communication and one for selecting the Chip.

In Raspberry Pi we have 2-chip select pins to control 2 SPI devices and currently Raspberry Pi can only acts as Master. We can understand it by one simple example like if we want to connect 8 Relays with Raspberry Pi so we need 8 GPIO pins, but using 74HC595 shift register as SPI device we can connect 8 relays just by using 4 SPI pins of Raspberry Pi, hence we can save other GPIO pins for other functions. This is very useful in complex circuits.

 

Now back to our Hot Water Tank Leak Detector Project, widgetlords has created many useful Raspberry Pi building Blocks and SPI Modules, using which we can create many complex projects in much less time. In this Leak detection project, two modules have been used with Raspberry Pi which are Pi-SPi-8AI 8 channel analog input module and Pi-SPi-8KO 8 channel Relay module. Other than that, one Buzzer, 24v power supply, thermistors and Water leakage Sensor are used. Water Leak Sensor is built by fixing two stainless steel screws on a transparent plastic sheet.

Raspberry-pi-Hot_Water_Tank_Leak_Detector_using-SPI-modules

Whenever there is a leakage, Buzzer gets triggered by the Relay present on the 8 channel Relay board. It also measures the temperature of hot line and cold line using the Temperature Sensors and triggers the temperature alarm when hot water Line gets within 10% of the Cold Water Line temperature. This circuit can also be used as Water Conductivity Detector and for measuring Soil Humidity and water solid contents. You can find complete detail, circuits and Code for this Hot Water Tank Leak Detector on its project page. Below is the output monitoring screen on Terminal:

Raspberry-pi-Hot_Water_Tank_Leak_Detector-output

Here only 4 channels of Pi-SPi-8AI module and 3 channels of Pi-SPi-8KO module are used and other channels (out of 8) are still left unused. These unused channels can be used to add more functions in this project or can be used for handling completely different tasks. This is the power of SPI and these SPi modules that it can handle many tasks using one Microcontoller.

 

Widegetlords has series of many useful Pi-SPi-Modules and they are continuously adding more modules, you can check on their website. Each module has dual GPIO expansion port so that many modules can be connected in series as per requirement. And also has external power supply in each Module (24VDC) so that Raspberry Pi power supply doesn’t get overloaded.

Pi-SPi-Family-by-widgetlords