Sigfox based wireless water leak sensor

Roughly a year ago I have experienced the fatal error on my house plumbing system which turned my house into swimming pool. All ground floor was covered with 10cm of water and the total volume of water leaked from a broken pipe was more than 7 m3.  At that time I  hadn’t installed any water leak alarm in my house what was the epic mistake. Currently, I have installed some cheap solution from eBay but it is rubbish. So I got an idea to build my own nice one based on Sigfox network.

 

Requirements

  • long battery life
  • wireless
  • battery status check
  • push notification to my phones + acoustic loud alarm
  • high WAL (wife acceptance level) – no “ugly” boxes in bathroom premises allowed 🙁

 

Concept

IMG_1674

Schematic diagram in HandCAD

The core of gadget is Telecom Design T1208 Sigfox module. The code is written directly in the module so no external module is used. Water is sensed easily by one of GPIO port via NPN transistor utilizing of water resistance. There are two LEDs flashing periodically to show alive status (or just because it is cool). Each LED is controlled individually so during alarm they blinking alternately. One LED is used also as status LED for FW upgrade (TIM2 port). An ordinary piezo buzzer is used for acoustic alarm controlled by one of GPIO ports via NPN transistor because buzzer requires 30-50mA which GPIO can’t handle.

 

For push notification, I am using Pushover app (Android, iOS) because it works great and it has very simple API and group support. The alarm has the highest priority so it is automatically repeated every minute is killed by a user. Pushover is also used for low battery alarm and regular keep a life status messages (with low priority without sound and display notification). I using a small piece of PHP code as middleware between Sigfox backend and Pushover REST API.

Everything is packed in 3D printed turtle which I found on Thingiverse. I modified model slightly to fit my goal.

In the future, I want also indicate low battery level by LEDs and use one master unit as a Sigfox gateway and some slave devices within proprietary TD_LAN network (low range network implemented in all TD modules)

 

Construction

 

All components on small piece of protoboard

All components on small piece of protoboard

IMG_1582

I have used 1/2 AA 3.6V lithium battery. Wires are inside “tunnels” which I made in 3D model.

Core of water sensing mechanism :-)

Core of water sensing mechanism 🙂

IMG_1585

All fitted together. I have used helicoil antenna from eBay.

IMG_1584

Final product.

IMG_1583

Dead turtle resurrection :-). Poor contact on battery caused FW upload fail so I had to use SWO to repair bootloader.

Code

The code for the module is very simple so will not describe it too much. The main part is interrupt on rising edge of GPIO set as input which is triggering sending Sigfox message. I have implemented simple mechanism to download basic setting via Sigfox network for the frequency of blinking and keepalive message which actually downlink request itself.

 

 

 

Backend and application setup

Format of downlink message is

  • 6bytes-zeros
  • 1byte frequency of download requests in hours
  • 1byte frequency of LED blinks in seconds
2016-07-31 21_14_55-Device type WaterLeak - Edition

Direct downlink message setup

Callback setup.

Callback setup

 

Php Code

I have used neat PHP library for Pushover from https://github.com/cschalenborgh/php-pushover

 

Pushover

Pushover setting is really easy so It isn’t needed to describe it here. https://pushover.net/

 

Notification from Pushover

Notification from Pushover

David

David is a innovation professional at TelcCo business, open-minded technological enthusiast who would like to taste everything new. In his free time, David loves to make own DIY projects and exploring word of technology. Any ideas presented here are independent and this page is not sponsored by anyone 🙂

More Posts

Follow Me:
Twitter

2 thoughts on “Sigfox based wireless water leak sensor

  1. JORDI FABREGAT says:

    Hello David.
    I am new to the world sigfox, I have done some tests and it seems perfect.
    I would like to find a step by step guide to program the modules (td 1208), and to be able to master the system. It would pay for the information or the tutorial.
    Could you tell me how I can do it, or if you would be willing to give me the information (tell me the price and we can reach an agreement).
    I would like to learn it in a short time, because I have a sensor network with xbee and I would like to replace it with sigfox modules, specifically the td1208R.
    Thank you for your attention.
    Jordi.

    1. David says:

      Hallo, I think the best is to contact guys from TD-Next directly. I am sure they will help you. I am just amateur in terms of coding of microcontrollers but TD-Next modules are based on EFM32 micro so you can use available knowledge base available on internet. TD-Next provides a bunch of libraries for their modules in SDK which makes coding very easy. If you want to know more about Sigfox, I suggest to you to start here: http://makers.sigfox.com/ Thank you for you offer but I am so busy that I am not even able to write posts to this block :-/ But I am sure you will manage it easily.

Leave a Reply

Your email address will not be published. Required fields are marked *