close-circle
Close
0%
0%

Leaky Faucet

This project's goal is to sense if there is a leak in a faucet and if so, to notify you over Bluetooth LE.

Similar projects worth following
close
I'm using the Atmega168 as the micro controller to sense water flow and to talk to the nRF8001 Adafruit BLE module. The cool thing is, instead of using Adafruit's Bluetooth over Serial libraries, I'm writing the Application Controller Interface in AVR assembly.

Here's the first run of the AVR code (this is setup to just broadcast an advertising packet with one byte of user data):

leaky_broadcast.asm

and the Objective-C code that discovers it:

AppDelegate.m

In the upcoming day's I'll try and log how I got to this point, and of course updates to the project as I get closer to finishing.

  • A better leak sensor

    Bob Burns01/17/2015 at 20:53 0 comments

    I was a little overwhelmed at all the variables involved in using a piezo buzzer for a vibration/leak sensor so I bought a raspberry pi and played around with it for a while. One of the coolest things you can do with it is make it a web server and control switching lights or whatever with your phone. I started getting into Flask, but after a while I started to miss the real low level programming.

    So I revisited the newLeak program and found a much better way to record the water flow and got way better results: 1floz per sec as opposed to 2 cups! It turns out I was using the interrupt pin as an interrupt and as input which gave me inaccurate readings. Here's the revised code: newLeak2.asm

    So I'm back in it and next up is integrating the leak code with the bluetooth code. :]

  • Water flow sensor code

    Bob Burns12/31/2014 at 18:52 0 comments

    This week I was able to test the water flow meter I got from Adafruit. Here's a link to the code if you want to check it out: newLeak.asm

    Unfortunately, the flow meter only starts registering at about 80 ticks per second, which I think is too much for a slow leak.

    So I decided to play around with sensing vibration from a leak using a piezo buzzer. Here is the code I adapted from Elliot Williams 'Foot Detector' program in AVR-Programming. piezoLeak.asm Interesting data to play with.

  • nRF8001 Bluefruit broadcasting!

    Bob Burns12/23/2014 at 23:50 0 comments

    Today I was able to successfully flash an atmega168 with an assembly program that sent setup commands and broadcasting commands to the Adafruit/Nordic Bluetooth module nRF8001. I wrote a quick Cocoa program to confirm the device was indeed broadcasting the right data. And sure enough, success!

    Super stoked so I started this web log to share my progress!

View all 3 project logs

  • 1
    Step 1

    I'm using an Arduino Micro as an isp programmer to flash the assembly code into the atmega168. Here is a good site that shows how: Arduino Micro as ISP Programmer

    If you're using a Mac you'll need gavrasm to compile the AVR Assembly code. Here's how: gavrasm

    Also, you'll need the avrdude toolchain, which is pretty easy to find.

    If you want to modify the setup data for the nRF8001 you'll need nRFgo studio which you can run on Mac with Wine. Here's a video shot by Tom Igoe: nRFGo for Mac

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates