Jump to content

Cellar Water Pump control system.


JavaLaurence

Recommended Posts

If you're like me, you like reading what other people are putting together (or trying to, in my case) with TinkerForge components. Here's my story.. hope it gets your creative juices going too.

 

At home we've got an old cellar which suffers from rising groundwater. Our cheap submerged pump has a flaky floating switch which sometimes doesn't switch on when the water level rises, and sometimes doesn't switch off when the pump has pumped every last drop out.

 

When I discovered TinkerForge.com (thanks Serge!), I started dreaming up a "high tech" solution: a sensor to detect rising water level, and a relay to switch the pump on/off. Provided the logic to drive these two components would run 24/24, I would never have a flooded cellar again, or worry about the pump burning itself out after hours of pumping air instead of water...

 

Looking deeper into TF's product catalog and documentation, I realised that my system would have to be connected to my PC wirelessly (USB cables don't reach from our top floor to the cellar, and my girlfriend would kill me if I tried to hook things up with wires). Secondly, no USB means an external power supply, which in turn means TF's Step-Down Power Supply.

 

So far, my solution therefore requires: 1x Master Brick, 1x Wifi Extension, 1x Step-Down Power Supply, 1x Distance IR, 1x Dual Relay. For good measure I also purchased the LCD20x4 display, so that the system could be monitored and interacted with (in the kitchen above the cellar).

 

Being a software guy with very little hardware experience, I set about coding before I even had my physical components. What I did was to create software equivalents of the Distance IR, Dual Relay and LCD. That way, I could start coding the core system logic and worry about the physical world later. Maybe one day I will virtualize the rest of the product catalog, and give you all my emulator platform ;-)

 

The result so far is that I've got my virtual LCD showing time, water level and pump status, and the pump activates above a certain water level, and deactivates below another. So I've got the guts of the system done and dusted, but I've yet to begin the physical installation.

 

So far the Wifi Extension and the Step-Down Power Supply are giving me problems. But I'll assume I can move beyond these with a bit of help from TF.

 

Once the whole thing is physically installed and working as intended I'll update this post here.

 

In the mean time, have fun!

 

Laurence

 

Link to comment
Share on other sites

I've done something similar with a grey water supply to my house. Works very well! Just one tip - when using the dual relay, put a varistor (or resistor/capacitor pair) in parallel with the pump to stop voltage spikes. These can interfere with the tf hardware and cause the master brick to stop responding. Not a problem with the hardware, just an inductance problem when using motors. Googling will advise you on the varistor you need.

I also advise using the monoflop time setting incase you lose comms. In your case it might be better to use the normally closed contact to connect the pump so that if the hardware/comms fail it will call the pump to run. Just update your code to call the relay on (ie stop pump) when the level is low. This will hopefully keep you dry!

Link to comment
Share on other sites

  • 3 weeks later...

Delighted to add that the system is now physically installed in my cellar, and works perfectly (so far). I didn't add any "inductive load problem" protection (mainly because I don't even have a soldering gun or components to add..), and luckily the stack doesn't suffer any issues. Took me a whole afternoon drilling walls and wood and generally hooking things up.. but worth it ! :-)

 

I haven't installed the physical LCD in the kitchen yet (I think my 2.0m TF cable won't even reach :-( ).. but I'm attaching a screenshot of my virtual LCD20x4 which is showing the status of my solution.

 

If you develop in Java, and you're interested in my code.. just give me a sign.

Screen_Shot_2013-02-16_at_Saturday_16_February_2013_1.png.7c417fe8d6a7a777c5b581e828510e77.png

Link to comment
Share on other sites

The Wifi module needed to be much closer to my AP than initially thought. With the AP in the living room on the ground floor, and the module in the cellar, there was no connectivity. I had to move the AP to within 3m of the module. Between the two there's a brick wall + cellar ceiling. Even this way, the received signal is poor. And that's with the big antenna. So yes, you could say I had Wifi issues. :-S

 

Another thing that happened last night is this:

 

 

Starting Cellar Water Pump Control System @ Wed Feb 20 20:55:46 CET 2013

Switching pump ON @ Wed Feb 20 21:46:23 CET 2013. Duration: 00:00:24

Switching pump ON @ Wed Feb 20 22:39:59 CET 2013. Duration: 00:00:26

Switching pump ON @ Wed Feb 20 23:35:33 CET 2013. Duration: 00:00:17

Switching pump ON @ Thu Feb 21 00:15:16 CET 2013. Duration: 00:00:17

Switching pump ON @ Thu Feb 21 00:57:13 CET 2013. Duration: 00:00:17

Switching pump ON @ Thu Feb 21 01:38:26 CET 2013. Duration: 00:00:17

Switching pump ON @ Thu Feb 21 02:24:57 CET 2013. Duration: 00:00:23

Switching pump ON @ Thu Feb 21 02:25:25 CET 2013. Duration: 00:00:01

Switching pump ON @ Thu Feb 21 03:18:48 CET 2013. Duration: 00:00:23

Switching pump ON @ Thu Feb 21 04:11:28 CET 2013. Duration: 00:00:36

Switching pump ON @ Thu Feb 21 05:14:14 CET 2013. Duration: 01:12:41

Switching pump ON @ Thu Feb 21 06:30:07 CET 2013. Duration: 00:00:18

 

So I need to enhance my logic with a timer override to switch off after a certain period (40 seconds, for example). No idea why the sensor didn't trigger a switching off.... maybe a spider installed itself right in front ? No idea.

Link to comment
Share on other sites

The LCD is not yet installed.. mainly because I haven't figured out how to embed it in some compact frame giving non-technical users (my girlfriend..) decent, fingertip-sized buttons. The 4 buttons on the LCD are ridiculously small, and at 90 degrees from what you would expect, and I'm not a great DIY person, so still struggling on that one.  :-[

 

But I also virtualized the LCD, and that version is installed: it is running on my Mac as I write. And I've got the emulated LCD output constantly saved as a file, and that file is embedded in a web page served by my Mac... so I can follow the system's basic status from anywhere in the house, and outside. But my intention is still to also have the physical LCD20x4 in the kitchen, which will probably force me to make my own 3-4m cable. Whether the signals will reliably carry this far, time will tell.

 

The Distance IR works, but I think I need to reposition it to be (a lot) further from the water surface. I bought the 1.5m sensor, and currently I've got it sensing the surface in the range 9cm-15cm, and that is giving me issues.

 

BTW, I also virtualized the Distance IR and Dual Relay bricklets.. and developed the control software before I even had the physical components  :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...