Well system monitoring... Use Teensy?

Status
Not open for further replies.
Thanks,

Johnnyfp - I was curious to get an idea about the price. Also was wondering if they sold the sensor. The closest to it I saw was one by Omega for $579 So probably won't go that route.

I am thinking of maybe trying something like the Sparkfun single point level sensor, but so far have not seen anything that says it is safe for potable water systems. If something like it would work, could maybe mount on bottom of a water pipe that I extend to maybe mid point in the tank. That way I could setup alarm condition that says tank is half full...

My first steps I think will be to try measuring current. As I mentioned in previous post, I can maybe deduce the tank is full from how the current turns off. I also can probably get that information directly from the top float. It runs on it's own circuit, which when on I believe throws big relays, that allow power to go the two wells...

Yesterday I ordered two more T3.2s plus a couple of RFM69s from Sparkfun, to try. As a secondary option I also ordered a couple of the Adafruit Feather M0 with LoRa, just out of curiosity. They talk about 1.2m line of sight, so hopefully 100-200 feet maybe through a wall/window... they will be able to communicate.

The X2's look interesting, if some of the other approaches don't work may have to try them.
 
I can't help you with the wireless portion, but I have had a great experience with this water sensor for my humidifier: https://www.amazon.com/gp/product/B00Z9NUJWW/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
This thing is great, easy to interface (see Humidifier article) and solid state. Nothing to break, easy to clean (if necessary), and you can use a couple of these to monitor the water level. That said, the eTape will certainly give you better resolution. Along the same lines, you can also consider the Aquaplumb: https://www.vegetronix.com/Products/AquaPlumb/ I have it in my cistern, but have not activated it yet.

As for current monitoring, I am not a fan of using something like an ACS711 for high-amp, continuous loads. IMO, that's asking for trouble. Instead, consider a current transformer like the Current Magnetics 8348. For $8 you get a revenue-grade CT, galvanic isolation, etc. http://www.crmagnetics.com/high-frequency-current-transformers/pcb-board-mount/cr8348 They are carried by Digikey.

One more thing... try to isolate everything. From the sounds of it, your pump house may be subject to stray currents, be it lightning, the house plumbing being used as a GND, etc. That would help explain the repeated issues out there. Accordingly, put some isolation between any direct electrical connections and your sensing gear. Ideally, 5kV Optos. I don't ever expect to have stray currents in my home (too many rods outside and no tie-in between plumbing and electrical) but I still used optos to connect my system to the local HVAC units and also used optos to isolate the fan speed controller.
 
Last edited:
Thanks, interesting sensors. The Aquaplumb system looks interesting. Have question out to them asking if safe for potable water.

Actually the water system issues have been by a whole set of different issues.

The first few times it was because the buried 2 inch pipe going from the well house to the house and Barn has a splice, that failed twice (or was it 3 times). Luckily when the contractor who put in this part of the system was not going to be available for a few days, the one I called into fix it, really fixed it within a couple of hours.

Next failure mouse built nest in pressure switch. Replaced switch and fixed area where they were getting in.

Next Issue: Truck hit guide wire of how power line several miles away, and somehow the wire wrapped around the high tension line and the whole area had a surge like you would not believe.... Had to replace maybe 8 GFI circuit breakers, septic system main board, coffee pot, ... Now have surge protectors on all main power breaker boxes.
...

I believe this last failure was because for several years, our main water filter unit had a pressure relieve valve off the top that kept leaking water. So the inside of this building was always wet. The water people tried to fix it a few times. The main guy who put it in retired and his replacement finally replaced the valve which no longer leaks and the building is finally dry. However there was lots of corrosion... Which is why when we knew that one board was bad, and the other was configured strangely, we replaced both of them (The people who installed the wells 10 years ago also retired) so again used new company.

Keeping my fingers crossed.
 
Here's current transformer I'm using (5A for gas dryer on/off and same for washer). 1V peak to peak sine wave at full load. Resistor divider on one leg of signal to bias up to mid-range of ADC. Other lead from transformer goes to ADC or GPIO. Current transformer clips over one lead of extension cord to appliance. No mod to appliance power cable. I don't use hall effect PCB for current sensing due to safety/fire risk of exposed wiring, and need to cut the mains conductor.

http://www.ebay.com/itm/5A-SCT-013-...054755?hash=item3f39b443a3:g:mt4AAOSwI~VTx0Aq
see also the higher amperage versions of this.

I did a liquid water level sensor using a reed switch/magnet float switch plus firmware to avoid rapid retriggers due to motion of water, etc.
http://www.ebay.com/itm/Tank-Pool-W...719818?hash=item41a090d24a:g:9qoAAOSwt6ZWVSKp
 
Based on my humidifier testing, I cannot recommend using the Teensy as a water level sensor using the cap touch library. Too much potential for drift and interference. I was able to get it to behave somewhat if the whole rig was very well grounded, including the tank, etc. Not a good idea though in case there is stray current and it only works for plastic tanks.

For a non-contact solution, the ultrasonic systems are likely best if you need good resolution (i.e. Maxbotix, IIRC). However, I would still consider putting in a single optical "water LOW!!!" sensor to capture that state in case the ultrasonics are not working properly for some reason (i.e. spider nest). I like redundancy. I did the same thing in my humidifier, i.e. either a optical water low signal OR a ultrasonic emitter shutting off due to low water will trigger a refill (the emitter has its own water level sensor).

The first gen Xbee modules with a small whip antenna may very well work for this application and they only cost something like $20. Very easy to implement, I hear (i.e. transparent serial). That's where I am going, complete with RTS/CTS (which the Xbee modules support).
 
Last edited:
Thanks,

My tank is plastic and stays clean as the water is filtered before it enters the tank. Otherwise it would be a mess as our water before filtering looks like nonfat milk, with glacial silt.

Not sure which way I will go for level monitoring yet.

The Vegtronix liquid level sensor looked interesting, but was wondering if safe for potable water system, so I asked and their response was:
The Sensor is made from PVC - speaker wire, and has a urethane end cap.
It doesn't have any food certifications.
So not sure if I would trust it. Maybe OK, but maybe not.

I may roll my own ultrasonic sensor. Have seen several sites up on web on this.
There are also some pretty cheap wireless setups out there like: http://www.jaycar.us/Outdoors-&-Aut...-Tank-Level-Meter-with-Thermo-Sensor/p/XC0331

As I mentioned earlier, I probably don't need to be overly accurate here. I can deduce full, by either how the pumps turned off, or maybe more directly from the relays connected to the top float. In most cases I would probably find out most issues if for example my tank does not hit full mark within a day. Only if I have a major leak (like the two inch main coming apart), would I probably lose all water within a day. But I totally agree having a mid tank sensor makes a lot of sense.

I may try out the XBee series ones as you mentioned, I do have a few of them lying around, but my guess is I would probably need to use XBee pros, which I don't have right now.

Thanks again
Kurt
 
Project update:

I thought I might start playing some more with this. For now I decided to not add any sensors that actually go into the tank as I don't trust most of them as they do not mention being safe for potable systems...

Right now playing around with diptrace board designs for a circuit to go into the well house. So far I believe on this system I would like:

a) Setup for 4 current sensors, maybe monitor (2 well pumps, Buster pump, and heater).
b) Some more inputs and outputs ...
c) LoRa - communications - probably with external Antenna
d) Probably Touch some touch TFT display, maybe one I already have from Adafruit or maybe one from PJRC if they are back in stock soon.
e) Maybe some Neopixels, that show that devices are on, or if it thinks there are some issues.
f) Maybe Relay to be able to mount some blinking red light outside of Pump house saying the water level is low...
g) Probably an SDCard, so I can record raw data to look at later.
h) RTC
i) Maybe Lipo backup power, in case the power goes out. But maybe not important as if I have no power in pump house, then none of the pumps will run anyway...

I started laying this out using pattern For Feather pin out, so could choose to use the Feather M0 with the LoRa links, but also potentially could use Feather Teensy adapter as well. But still trying to decide if I should instead go with T3.2 layout, with some LoRa connected to it. Also trying to decide if I will layout one card which everything plugs into and maybe print my own box to hold it... Or since it is a one off project, simply do a few cheap boards and patch wire it.

Anyway should be fun.
 
Don't know if it's an issue for this application but there are low power MCUs that might be suitable like the STM32L4 (5 mA vs 35 mA for the Teensy 3.2), to which you would have to add your radio and memory peripherals. There is also the ESP8285 which has embedded wifi with power usage ~10 mA. And lastly there is the nRF52 with BLE. The STM32L4 and ESP8285 are programmable via the Arduino IDE, and all have open-source hardware designs available. You can also just buy dev boards for prototyping. No matter which MCU/radio choice you make, I would strongly recommend prototyping on the breadboard with off-the-shelf- modules before designing an integrated pcb.
 
moisture vaporators

I wonder if you have overlooked using a protocol droid that speaks the binary language of moisture vaporators.

Could be a simpler solution than your current line of thinking.
 
Thanks Onehorse,

Yep - I have done several Teensy boards (for my own use), but I am thinking of doing this with maybe a few boards...

Yesterday I was playing around some with the Feather M0s and one of them is now does not want to register on USB... Will probably figure it out, but decided I just plain prefer working with Teensy... So I did order some radios from Adafruit
(2 x Adafruit RFM95W LoRa Radio Transceiver Breakout - 868 or 915 MHz[ID:3072], plus Edge SMA connectors, plus Whip Ant...) so Can hook those up to main board with the Ant coming out of the box.

Will probably use the Adafruit 2.8" touch shield I already have. Could use the Sparkfun Breakout board to connect it, but then Hard to use other pins with shield plugged in, so will probably either use one of my existing boards, or modify one.

If I Need new board may add circuits to bottom of board for the plug ins for the Current sensors, or might do a simple board for this with the plug, plus load resistor and resistor divider. Could do real simple board with setup for one of these and then order a set of them, which all have to be mounted or could set it up with 4 plugs, plus the resistors and then only need 6 inputs (vcc, gnd, and 4 analog outputs)...

Adrian: yep, know where I can find any droids :lol:
 
The pump house will have no shortage of power unless dark - though when it does having battery backup to tell you might be nice if a breaker went or something even though power was up.

Sad the Feather M0 offline, hopefully it comes back. Teensy does seem nicely robust and they just work in spite of any simple abuse I've dished out.

Good to see you working with the RFM95's - I'm looking to see those I got run 500'ish feet where I will need to run batteries on the far end and change to charge as needed. That got pushed off a month now though.
 
Thanks,

My guess is I will get the feather working again. But as I said I just like working with Teensy. It may simply be that I have spent so much time with them, that I know where to find out information about what pin does what, where to find out in the code how things work. And I know that for the many things I don't know, there are people up here who can help!
 
Seriously now folks. I had a very similar problem with a feather M0. I had code in a class constructor that initialised pins and / or attempted to use the usb connection too soon (Serial.print .... my preferred debug method)... Basically, it was a timing issue / interrupt issue I am guessing . ... I didn't have the same problem with teensy (i.e. teensy had a more robust USB implementation), but by removing the offending code and placing it later in the app, I got the feather M0 to reconnect over USB ... I have the feather MO with the ble unit, and it also has a battery connect (I haven't used the battery connection yet).
 
Quick update: I was able to recover the Feather - In order to sort of force a Feather into the equivalent of the Teensy program mode. On Feather you need to do a program download and when it is failing to talk to Feather, you double click on their reset button... So now I have blink working again!

BUT: The RFM95's shipped yesterday so will probably continue to do project with Teensy. But who knows maybe will use the feathers to talk to something else, like maybe a monitor on the chicken coop...

Also played around some yesterday, with simple interface board to plug in the Sparkfun Current sensors (have phono plugs). So the board has a phono jack, the load resistor, plus voltage divider and a 3 pin connector, which I can use to plug into my Teensy boards. Currently they look like:
Well-Current-sensor-board.jpg

And I ordered a set of 4 of them from PCBs.io (Digistump) for about $2.50 for 4 of them...
 
I may have a slight delay, as this morning, I tried the first of my Adafruit RFM95 LoRa breakout boards connected to a Teensy and I got the magic blue smoke :(

I then measured the resistance between VIN/GROUND on the board and it was dead short...
Magic-Smoke.jpg

Fried chip just above the CAP that is above VIN pin.
 
Now that the T3.5/3.6 Beta is over :D and the kickstarter boards have shipped, it may be time to start playing with this again.

I would like to make something like FrankB's flexboard for this project, except maybe pretty simple and will use LoRa instead of Wifi.

Started playing with a board and it currently looks like:
DipTrace-PCB---Teensy-3.jpg

Currently I still have some memory chips on bottom, but may remove as I don't need for this case as will you SDCard for storage if needed.
I have it using a simple sound chip connected up to DAC and instead of double row of connectors at top to replicate the main pins of the chip, I simply have double rows, so real short run for traces. May give a little more room between Teensy and these pins, also may add a few more pins to give access to some of the inside pins. Have PGM button showing at the bottom (which will actually be top) and battery holder on the bottom for clock.

One thing I would like to add back in is a multi-colored LED probably sticking out the bottom (TOP), which can show general status, like bright RED is something is wrong.

What I am trying to decide is do like some of my other boards and add a NEOPIXEL, like https://www.adafruit.com/products/1938
Note: I don't see any DotStar versions like this?

Question is, if I only want one of these on the board, should I do like the LC and some of my other boards I have experimented with and add something like a SN74LV1T125 to convert the 3.3v signal to 5V, or it safe enough for the one LED case to run 3.3V to it instead of 5V. I know this worked on another board that I screwed up on.

Or should go ahead and convert it and add connections on the board that if I change my mind and want to string other Neopixels, I can...

Or should I go somewhat simple and use a simple RGB led like: https://www.sparkfun.com/products/9264, which then probably requires
3 IO PWM pins...

Thoughts?

Also to be added once I make sure I know the right pins, are hookups for probably 4 current sensors (https://www.sparkfun.com/products/11005) using Audio jacks. Need to test this out again as my first quick and dirty hookup I had the CAPs in the wrong position and was not reading anything.

This may still take me awhile as I still have several non-computer/robotics projects that need to get done.
 
Ive got some of those neopixel leds. Want me to give them a try at 3.3v on a t3.6?

[UPDATE]Yeah it works on 3.3v at full colour brightness on each colour. If you just have the one on a pin then It should be ok[/UPDATE]

Neopixel.jpg
 
Last edited:
Thanks Johnnyfp,

On an earlier board of mine, I made the mistake of using +5v and straight IO pin, and most of the time it did not work properly, when Paul suggested trying connecting 3.3v to it that worked. So maybe I will rely on that for these boards to keep things simple.

Thanks again
 
I was thinking about trying to add the current sensors to my simple board, but I think I would be better off with a simple board, that just does that and then connections to my simple board. May order simple board soon, to start playing with it, but may try to do initial layout of the sensor board, such that maybe it can just plug into other board...

Again I am using some of the Current Sensors from Sparkfun

I screwed up my first mini board, so I want to breadboard some of it. The schematic for reading one, currently looks like:
Well-Current-Single-Sch.jpg

Things I need to verify, include what is the proper load resistor (R1) for this sensor with a 3.3v system. I currently have it here showing 18...

Resistors 2 and 3 (resister divider) and the 10uf Cap are setup that you pass half system voltage to one side of the sensor to scale the voltage up such that you don't go negative.

With my desired setup, I would like to have probably 4 of these sensors (Well 1, Well 2, Pressure Pump, Heater). So should I duplicate R2/R3/C1 for each of these sensors, or is it sufficient to pass the 1.67v signal to all 4 of the sensors? My first inclination is to duplicate them as maybe it would maybe reduce the output of one from maybe influencing an other? And should not hurt anything except space, a little extra cost, ...

Thoughts?
 
KurtE:

Not related with the current sensor stage you are dealing with right now, but I recently started trying to resolve a similar problem "playing" with pumps and well levels also, and would like to comment my findings on the RF stage.
Due to the fact that I faced a 2km distance between points it seemed a logic idea to start by choosing the right datalink for my project. Making the long story short I also ended picking up a Lora transceiver. I chose the one from Microchip (RN2903) working at 915 Mhz (the authorized band in Chile).

For my distance trials I programmed a very cheap PIC microcontroller I had at hand that sent the serial commands sequence Lora expects and a hex message every 10 seconds to the Tx port of the Lora transceiver and let both running off a 9V battery. 2000 meters uphill I started listening to the hex packets with another RN2903 module and I can say I never lost a single one. I am pretty sure I could achieve greater distances as the SNR is so good at that distance. I even tried an L/8 antenna (L sized antenna before) on the receiver end with the same results. There was line of sight between points but for a distance as short as 100 yards you will have no problem even if that is not the case. I just used Lora modulation in a point to point link, not FSK. For projects that require little data throughput this transceiver is worth looking at, and I am really impressed with this technology. It also uses little energy, so I think it's ideal for standalone sensor nodes with PV cells. Coincidentally, I bought some of STM32L4 MCUs that Onehorse produces (great board !) just for the low current consumption it features that would allow me to use little PV cells/MPTT/Supercaps as energy source. On the Tx end where pumps and wells are, I would choose a Teensy of course !

best regards, Juan
 
Thanks guys,

I have my board setup with the Lora chip like the one on the Adafruit boards. I purchased a couple of RFM95s from LowPowerLab Shop. Hopefully I can find them once I can get back into my office...

Anyway today I ordered a set of boards to try out. This time from OSHPark as for some reason digistump did not like my zip file (Liked the other other one). Also SeedStudio liked it...

Anyway the board currently looks like:
T36-Touch-disp-brd.jpg

I set it up with a couple of connectors toward the bottom, where i could plug in a daughter board that has hook ups for 4 current sensors. Decided to go with separate voltage dividers for each sensor, plus will go with probably lower resistance... Anyway the board looks sort of like:
T36-TDISP-Current_sensor.jpg
Note the phone plug connectors are on the other side of the board... Digistump liked this zip file, but decided to do as one order with OSHPark.
 
Status
Not open for further replies.
Back
Top