SparkFun H2OhNo! ATtiny Dev Board / Water Alarm

The SparkFun H2OhNo! is a water sensor alarm kit that you build yourself. When water is detected across the sense pins an alarm goes off and an LED starts blinking. If you’ve ever had a water heater explode or tried to create submersible electronics you know how important it is to be able to detect when water is around!

Underneath the default function of H2OhNo! is a small but powerful development board for the ATtiny85 microcontroller. The board includes a buzzer, LED, a coin cell battery, and the ability to detect analog and digital sensors. This mixture of parts creates a great low-cost tool to learn how to program and sense things!

This board can be re-programmed to be an Annoy-A-Tron (originally made by Think Geek). Please annoy respectfully, otherwise your board may get demolished.

Note: Please check the hookup guide below for helpful tips and assembly instructions.

Note: Due to the requirements of shipping the battery in this kit, orders may take longer to process and therefore do not qualify for same-day shipping. Additionally, these batteries can not be shipped via Ground or Economy methods to Alaska or Hawaii. Sorry for any inconvenience this may cause.

  • 1x H2OhNo! PCB
  • 1x ATtiny85 (Pre-Programmed)
  • 1x 20mm Coin Cell Battery Holder
  • 1x CR2032 Coin Cell Battery
  • 1x Slide Switch
  • 1x 2kHz Piezo Speaker
  • 1x 8-pin DIP Socket
  • 1x Super Bright Red LED
  • 2x Jumper Wire
  • 1x Capacitor 0.1uF
  • 22.86mm x 52.07mm (0.90" x 2.05")

SparkFun H2OhNo! ATtiny Dev Board / Water Alarm Product Help and Resources

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

2 Soldering

Skill Level: Rookie - The number of pins increases, and you will have to determine polarity of components and some of the components might be a bit trickier or close together. You might need solder wick or flux.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

2 Electrical Prototyping

Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #722843 / about 7 years ago / 1

    i can't find the dimensions for the board?

  • Member #798593 / about 7 years ago / 1

    Can this connect to a WIFI network?

    • Short answer is 'Sure!!', long answer is it would require a bit of work. The ATtiny in this kit is doing all the work but if you want a Wifi water detector it would be easier to use an ESP32 or ESP8266 and do the water detection directly on that micro rather than getting the ATtiny to connect to a micro that then connects to wifi.

  • Luis Gonzalez / about 9 years ago / 4

    The SparkFun H2OhNo! Kit re-purposed as a music player. https://www.youtube.com/watch?v=SIP61vUAwGc Another video playing LFT's hardware chiptune project: https://www.youtube.com/watch?v=cUA_KCS0cw0

  • Member #435083 / about 10 years ago / 2

    I am planning using this as a Xmas tree stand no-water alarm, although disabling the buzzer because I don't feel the need to add water my tree at 2am. I was planning on re-programming the firmware to set off the alarm when there is no water versus the way it was designed to set off the alarm when there is water. I was pleasantly surprised that the current firmware works for both scenarios. It just depends on whether the sensor is already in water or not when the device first starts up and calibrates. Nice.

    How long can you make the sensor leads and not have a problem? The instructions say to keep them under 3 inches, but I probably need 6 inches to make it work for me. What problems will I run into if they are too long?

    Looking at the code and realizing that the ADC reading is about 1000 in air, under 600 in water and the alarm is set to go off with a difference over 100, why not just program it to alarm at 750 for no-water? Seems simpler because there is no initial calibration needed, but is not flexible in both water and no-water alarm modes if that was the intention.

    The comments in the code mention that you need to configure the ATtiny for 8Mhz so that so that serial and other parts of the code work correctly. What other parts besides SoftwareSerial wouldn't work properly? Serial is not used by the Ohno device, but I assume this is in the firmware for troubleshooting if you can figure out how to get serial from the ATtiny. I assume if you are re-programming the chip you can choose 8Mhz off of the menu when programming.

    Just curious, how exactly does the sensor, internal pullup resistor circuit work to provide a different voltage the ADC can read when the sensor is in and out of water?

    • I started a very similar project last night! Trying to get it to play jingle bells instead of annoying noises :)

      How long can you make the sensor leads and not have a problem?

      I haven't tried feet of length yet but my sensor leads will be about 6" to go up and over the lip of the basin with the H2OhNo magnetically adhered to the outside of the basin.

      why not just program it to alarm at 750 for no-water?

      That might work. Give it a try! For me, the ADC differs enough between ATtinys that I'm going to stay away from hard-coded numbers.

      What other parts besides SoftwareSerial wouldn’t work properly?

      If you assemble the kit and use the chip as it ships it will be 1MHz. Everything will work fine but the delayMicroseconds() and delay() will be wrong if you select the 8MHz ATtiny under Arduino IDE.

      how exactly does the sensor, internal pullup resistor circuit work to provide a different voltage the ADC can read when the sensor is in and out of water?

      The internal pull up is ~60k if my memory serves me. Out of water the ADC will read a weak 3V (because of the internal pull up). You are seeing this as ~1000 on the ADC (VCC would be 1023 but I'm not surprised it's not exact). When you expose the analog pin to water next to a GND pin the water weakly shorts them together. The conductivity of the water is a big discussion but for the sake of discussion the conductivity of the water will be greater than the conductivity of the internal 60k pullup. The ADC should read around zero when the pin is connected to ground but instead we see the ADC report ~600 under water because the conductivity of the water is not as good as say copper.

  • 172pilot / about 10 years ago / 2

    How long will this thing last on the button cell? AND.. for someone who has only programmed commercial arduinos, how hard is it to reprogram this thing? Ironically, I want it to do almost the EXACT opposite of what it does now - I want to mount it in a toilet, and if there is NOT water in the tank for more than 30-60 seconds, I want it to start alarming, to tell me that the toilet is running. Is it easy to get this chip working in the Arduino IDE?

    • The hookup guide should give you all you need to know. It's pretty easy to re-program the ATtiny using a Tiny AVR Programmer. The example code will demonstrate how to get the ATtiny to last for about half a year with a CR2032. Longer if you reduce the rate at which it checks for water. The example firmware checks once per second, you could probably get away with once every 8 seconds.

    • chartle / about 10 years ago / 1

      Just found this which is a lot easier to use. Its a float switch.

      http://usd.dx.com/product/nut-shape-pp-floating-water-level-switch-cable-white-35cm-901203037#.UqCuZtJDtJs

      You could make your own with a reed switch sealed in tube and a magnet on a float. Actually any switch out of the water where a float can hit it would work.

    • jrshell / about 10 years ago / 1

      The whole setup would ultimately be more expensive, but would you be better off using one of these hooked up to a an Arduino or Pi? Seems like it would allow more flexibility in the future too.

    • chartle / about 10 years ago * / 1

      Now that have thought about this using probes like these may not work. I've been researching water level detectors for the last couple of years for use as a Xmas tree water level monitor. As I recall the small amount of current will cause electrolysis and after not too much time the probes get gunked up.

      The best way to do is to use capacitance sense that uses two metal plates.

      Google "capacitance sensor arduino water level"

      Here is one page http://hacks.ayars.org/2011/12/christmas-tree-water-level-alert.html

    • doobie / about 10 years ago / 1

      The source code is available, that should be pretty easy to do. On the if statement to see if there is water and alarm, just invert it.. Of course it will likely go off every-time you flush, so you may need to add a timer to the code to give it time to drain/refill the tank before the alarm.

      • 172pilot / about 10 years ago / 1

        Yeah.. the timer is why I said "almost" the opposite.. :-) Although, it might be fun to scare the wife and kids.. I think I'm going to have to pick up a couple of these and try it.. We've got a bad well, and every once in a while, a running toilet will ruin our morning, after emptying all the water from the well..

        "Version 2" will have to radio out after 5 minutes to shut down the well pump!

        Still curious how long I can expect this thing to run on that little button cell.. Are we talking days, weeks, months? Would it be better with a couple of AA cells? (There'd be plenty of space for it, I just don't want something that needs to be plugged in!!)

        • The source code has the ATtiny running in super low power mode and will last about 150 days on a new coin cell. If you throw two AAs at it, it should last about 6x (2.5 years) longer.

          My math:

          • CR2032 = ~250mA @ 3V
          • AA = ~1500mA @ 1.5V

          1500/250 = 6. 150 days * 6 = 900 days.

        • rjimenez / about 10 years ago / 1

          I did something similar to this a few years ago. Feel free to read my blog posts on it (http://www.modelesis.com/embeddedbliss/2010/09/toilet-tank-alarm/). Do let us know it goes! :)

    • Nxtmind / about 10 years ago / 1

      Look at this site. http://hlt.media.mit.edu/?p=1695 I just bought a Attiny84 from sparkfun and got it hooked up with some charlieplexing stuff the instruction on this site works like a charm!

    • chartle / about 10 years ago / 1

      I'm still very much a novice in Arduinos and ATtiny 85's.

      But anyway there are a lot of websites on programing the ATtiny85 using another arduino and after working through them all I got the Tiny AVR programer here, PGM-11460. It should be listed in the related products below.

  • bambuino / about 9 years ago / 1

    Am using this design in capturing A/C condenser water, by transfilling gallon milk jugs from holding bucket with sensor probes. When ADC senses drop across probe, a TIP120 is tripped for 90 sec duration, removing water to jugs via small tabletop water display pump. Powered by 6-AA NiMhs and PV overhead. Sensor probes are 18AWG solid Cu 3 ft in length. I just use the water around the house, watering plants, &c. Given this is crudely distilled water, the sensing is spot on, I suppose ion solutes are carried off the corrosion of the condenser coils. With minor tweaks appropriate to my application, the code works perfect. Thank you Sparkfun for providing this.

  • nanogear / about 9 years ago / 1

    Do you have the eagle library for this coin cell battery?

    • Kamiquasi / about 9 years ago / 1

      I doubt there's a part for the battery - but if you're referring to the battery holder, it appears to be SparkFun-Electromechanical, device: BATTERY/BATTERY20PTH, package: BATTCOM_20MM_PTH

  • Member #335615 / about 10 years ago / 1

    A 3D printed case is available in thingiverse. http://www.thingiverse.com/thing:395404

  • otrab / about 10 years ago / 1

    why there is no resistance for the LED? The ATTINY85 can power a led without resistance? There is also missing resistance 10k for the Reset pin. Is not it necessary?

    • Member #485140 / about 10 years ago / 1

      The coin cell battery is giving 3v which is low enough to power the led without resistance, unlike the 5v you may be used to with many other electronics.

  • MFindley / about 10 years ago * / 1

    ... just ordered one of these and am interested in tinkering with it.

    I would think that something like presence/absence of water would be something that could be handled as digital input and not analog, so I was surprised to see the firmware relies on the analog signal into the ADC to detect water. I guess since water doesn't have a well defined conductance (depends things like salt content), there is no guarantee that the water's short circuit will result in a signal that conforms to the MCU logic levels?

    Has anyone implemented something like this in the digital domain? Perhaps the presence/absence of water could throw an external interrupt and eliminate the need the periodic wake/sample routine. The device could remain in low power until the external interrupt fires and possibly extend deployment times further. hmmm...

    I see a "citizen-scientist" water quality monitoring application for this H2OhNo kit. http://www.epa.gov/eerd/methods/HISSmanual_full.pdf#page=51

  • bdahlem / about 10 years ago / 1

    Another use for these… they work well with the MQ-4 Methane sensor if you leave out the supplied battery and hook up to a 5 volt source instead. The alarm will go off for a few seconds until the sensor's heater warms up, but new firmware could fix that.

  • I'm thinking about using this in a behind the wall basement application. I have a few questions: How long can the probes be? And since this might be a situation where only a little water is on the basement floor will the probes work if sandwiched between two gauze pads or similar, something that will take up the water? Thanks. Go Cyber Monday!

    • Interesting question. The board is doing AtoD conversion on one probe compared to the GND probe. It takes an average reading at power on and marks this as the baseline. Once the analog voltage on the probe changes from the baseline the alarm sounds. So I'm going to wager a guess that the probes can be a few feet long and still function. Let us know if you get a chance to test it out!

      • Well I have one on the way, as well as a humidity sensor breakout board. I'll be testing before I install it behind the wall so I'll report back. The plan is to also have some Xbees involved. Probably overkill but fun.

Customer Reviews

4 out of 5

Based on 1 ratings:

Currently viewing all customer reviews.

Works great on my CNC machine!

I left off the buzzer, battery, and LED. Then added a transistor and 5vdc water pump where the led was and powered it by a 2A usb phone charger. Then changed the original program to just run the pump when the coolant was detected and shut off when there was none. It pumps cool mist coolant from the drip pan under my CNC machine back to the reservoir.