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
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
@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.
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
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...
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 (http://wiki.milwaukeemakerspace.org/projects/home_environmental_sensor_array)
The Instructable is here: http://www.instructables.com/id/Home-Environmental-Sensor-Array-Phase-1/ (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 (http://beckermaker.blogspot.com/search/label/Home%20environmental%20sensor%20array)
Ken, nice tutorials and blog :)
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.
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).
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
Hi,
I am also wondering if I need to edit the "Local Host" text too?
John
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.
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.
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
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?
Hi - OK sounds good... but how do I do that?
You test them, take baby steps. Load them with Node and Gateway sketches in the examples, make sure all the settings are good, set the HW, frequency, node and network IDs. Once those work well, you make your changes for your own sketches, and test those. It helps to have both nodes attached to the same computer to see debugging info at the same time. Then when everything works install them in your Pi and remote locations etc.
Hi Felix,
I'm so sorry, I really am a newbie to this stuff. Do you have a link to a step by step process that I can use to set the two Moteino's up and get them talking? I probably need step by step instructions, but I looked at your site and couldn't find anything - maybe it would be helpful for others too?
Thank you so much,
John
Please visit lowpowerlab.com/programming
That's a guide to programming/uploading to the boards rather than how to code. And it's codebender focused but you can do the same thing in the Arduino IDE. I don't really have a step by step line by line guide for programming, it's beyond the scope of this website. But that should help at least a little and the code is pretty decently documented with comments and instructions so any person who has coded before should be able to get around fairly easily. The code contains setting sections that you need to understand and change accordingly to your specific hardware (transceiver type) in order to get them working as expected. If you've never coded before then that's a challenge and again unfortunately it's not the scope of this website to teach c++/programming, mostly because of lacking the time/resources to do so.