Skip to content

Controlling the Rain by Arduino

This past January I was biking home in the rain when this thought hit me. I was stopped at a red light looking at the pools of water on the ground wondering if it would be possible to calculate the density of rainfall. I thought, even when they’re giving weather reports they never really tell you if it will be a hard rain, soft rain, or a mist. They just say “rain is in the forecast.”

Looking at the pools of water it seemed apparent that you could shine a spotlight on a puddle and perform some motion detection code on the ripples to locate the centre of a drop. You would only need a short sample in order to determine the average drops per minute or hour.

This is all fine a cool, but what would you do with the data? The traffic light turned green.

If you could calculate density of the water, you could no doubt calculate the distance between drops. It would be fascinating to generate an algorithm which predicts a path based on the least amount of rain drops. Does one exist? Could you find a pattern where I’m fairly certain none exists? All of these thoughts are purely hypothetical, and probably wouldn’t work in real life, but given a 20/20 hindsight it would be something to brag about, coming home after biking in a rainstorm, completely dry.

Another red light.

What if you could build a machine that rains, but when you walked underneath you never got wet? This was where the Rain Aversion project began.

Example of a solenoidFirst, I’d need the rain. If I produced a mechanism which controlled the flow of water out of some pipes, I could cause the device to pour rain in a controlled manner. Ideally I’d like to collect the fallen water and pump it back into a reservoir so as to not waste liquid. But that would require a much more involved development cycle, so part of that was pushed out of the prototype phase. To begin I’d just attach a hose and feed it off the water supply.

Second I’d need a controller. Something to activate and deactivate each pipe as a sensor detects an object underneath. Having recently received an Arduino it was the controller of choice.

So I had several pieces of technology at my disposal. An Arduino, a webcam, some solenoids, and some Flash and Processing skills. Ignoring the dead ends the prototype phases lead me through, the project is set up as such:

  • Arduino is loaded with the Firmata Protocol enabling it to communicate through a serial connection to the host computer.
  • Protolab’s Arduino2Flash Java serial proxy stood in for serproxy when it wouldn’t communicate properly.
  • AS3Glue handles the Serial Events as they are broadcasted to and from the Arduino.
  • Joa Ebert’s ImageProcessing library manages the Web Cam manipulations such as the pixel averaging and threshold detection.
  • Transistor ConnectionsThe Arduino sends signals to a high voltage circuit through a series of transistors, the schematic can be found on the Arduino Tutorials page.
  • SolenoidsWater Solenoids (I used 9 to produce a 3x3 matrix)
  • Each of the solenoids is connected to a 19V power supply. (This underperforms on the amperage side of things when all solenoids are firing at the same time, but seems to do the trick)
  • The solenoids are also connected to a hose feeding the water, with a series of copper splitters to divide the flow.

I needed a sensor to detect where someone stood so I could disable the stream of water. There’s several alternatives here, but I’ve chosen to go the webcam route. Flash was chosen over Processing due to my inexperience with the latter. I have no doubt that I could entice Processing to work faster than Flash in future renditions of the code.

The copper piping and feeds are simple plumbing supplies. Flexible hosing was used so I could reconfigure the setup if needed. This was the most costly side of the project aside from the solenoids.

The final result is a ~$200 apparatus which leaks, but in just the right places. And it won’t leak on you. I’m still assembling some final videos of the device in action, but in the meantime I have some demonstrations of an earlier protoype in action:

Solenoid Controller #3 from Eightlines on Vimeo.

Additional videos are available here. Photos of the process are available here.

In the next couple posts I’ll detail the final assembly of the project, and also discuss some of the future possibilities of the device. The whole setup has massive potential.

One Comment

  1. Diana wrote:

    This is wet Brent, really wet.

    You sure think deep thoughts while riding your bike. No wonder Gracie is so bright.

    When do I get to try this apparatus? I’ll wear my bathing suit just in case!

    Friday, May 2, 2008 at 8:40 am | Permalink

One Trackback/Pingback

  1. Eightlines Creations › Xbee Thoughts and Ideas on Monday, May 19, 2008 at 7:24 pm

    […] and ideas. Part of me is thinking that some of these ideas are far more interesting than the Solenoid project I’m currently working on. I have to keep reminding myself that I should really finish one […]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*