Sump Pump Project - General wiring diagram

Started by jlsimmo, December 13, 2014, 11:13:02 AM

jlsimmo

Hi Felix,

This is my first project with Raspberry Pi and Moteino.

I'm just wondering if you have any kind of sketch diagram of how to connect it all up?

I read the entire page at: http://lowpowerlab.com/blog/2013/04/25/sump-pump-alert-with-moteino-hc-sr04/

But didn't really manage to connect all the dots.

One other question... I need to enter my EMONcms code at some point - I assume that's the 'write' code and not the 'read' code - but let me know if I am wrong please.

Can you help?

Thanks,
John

TomWS

Felix,
I hadn't noticed this project before.  My question is, having learned that Sump wells are notoriously unhealthy places for electronics, if, after 1 1/2 years of running, is this still running reliably?

Tom

Felix

@jlsimmo: the wiring is very simple, as seen in the photo:
You need to power The Moteino from a 5V source. Then the HC-SR04 sensor is powered from the Moteino GND+VIN (5V), then ECHO=D3, TRIG=D4, that's it.
@TomWS: yes it's working, no problems.

TomWS

Quote from: Felix on December 13, 2014, 06:18:29 PM
<...snip>
@TomWS: yes it's working, no problems.
Cool! Thanks for the quick response!

My fear was that condensation, mold, etc, would build up on the ultrasonic transducer and affect, at a minimum, the calibration of the sensor.  I suppose, any build up would simply attenuate the signal.  The distance measurement is a function of the speed of sound - independent of any build up.  As long as you get enough signal back then the timing should be constant... (sorry, just thinking out loud)

Tom

Felix

Yep I see your points and they are valid. I have about 35% humidity in my basement, probably double that or more in the sump pump well. I had no issues with it though...

Prodigal

I did a similar project with a Raspberry Pi.  It consists of two bare wires in the crock but above the water.  My Pi sends a signal out one wire and looks for it to come back on the other wire.  When the water rises enough to connect the two wires, the Pi realizes that there is water.  It sends me an email, and turns on the power to a backup pump.  Its been in place for about a year and works great.

I will be adding Moteinos to this project to do more sensing.

The project page is here: http://wiki.milwaukeemakerspace.org/projects/home_environmental_sensor_array
The Instructable is here: http://www.instructables.com/id/Home-Environmental-Sensor-Array-Phase-1/
My blog entries are here: http://beckermaker.blogspot.com/search/label/Home%20environmental%20sensor%20array
Thanks,

Ken

Felix


Reck_law

I am doing the sump pump in reverse.  I am filling a barrel with reverse osmosis water and using the moteino to detect when full.  Has anyone else notices that ripples cause the hc-sr04 to occasionally miss read.  In my code I now read 5 times drop high and low then ace the remaining 3.  This stops my relay for constantly turning the water in on and off.

Felix

Yeah I would do several reads and averaging or make an algorithm to decide whether a read is bad (ie if the reads are too far off from each other).

jlsimmo

Hi,

I have now wired my Sump Pump monitor, run the code, and all seems to be working - with one exception - i cannot get anything written to EMONCMS.

In the code, the setup lines for EMONCMS are:

# EMONCMS Settings
EMONPOST = True
EMONAPIKEY = "your EmonCMS key HERE"
EMONHOST = "localhost"
EMONHOSTPORT = 80
SUMP_LVL_LIMIT = 20
SUMP_ALERT_LASTSENT = 0 # send an email every so often when SUMP pump is dangerously full (minutes)

I added my EMONCMS Key as a long string (32 characters) that is shown as my Write API Key when i log into my EMONCMS account.  Is this correct? It appears not, because i don't see anything being written to the EMONCMS account - when i look at Node, it's empty.

Any help would be appreciated.

Thanks,

John

jlsimmo

Hi,

I am also wondering if I need to edit the "Local Host" text too?

John

Felix

The key is obtained from EmonCMS itself, I think there are read/write keys, you would need the write access key.
The localhost doesn't need to be changed. If you want you can try replacing it with the IP of your Pi on your LAN, but you shouldn't have to.

jlsimmo

Thanks Felix.

I will look deeper into what is going on then.  The Gateway.py script runs in a terminal window, no problem there, but moving the sonar sensor does not result in any messages or any data to EMONCMS, so I will have to look at it and see what is going on.

jlsimmo

Hi,

I switched on the Debug option in the code and I found that the program is waiting for data:

Start - waiting for data on /dev/ttyAMA0 @ 115200 baud...

Any ideas why no data is being sent? Both moteino boards are flashing and I am as sure as I can be that i set everything up correctly.

Thanks again for your help,

John

Felix

You need to make sure your receiver/gateway moteino is receiving the data from the remote node, and that it will put out the received packets to the serial port. Have you verified that?