Jump to content

Tank Monitor Project at ECR


Nuke-E

Recommended Posts

It's getting pretty close to time for the ECR, and I think I have an approach reasonably well figured out for the tank monitor project seminar. I know some of you want to tinker with some of the hardware ahead of time, so I wanted to post a list of goodies here. I'd also like to try to get a feel for how many of you are planning to participate--I'll accommodate the whole group, but would obviously do things differently between a 5-person gig and if all of the 100+ rally attendees wanted in on the project. If you can, either send me a PM or e-mail letting me know that you'd like to participate, and whether or not you'll be bringing your own supplies.

 

For those of you who don't bring your own supplies, I'll coordinate with Carl to either have stuff added to what you pick up at check-in or get it to you directly over the first weekend. To make things run as smoothly as possible, there will be a quick "homework assignment" with the Photon microcontroller to get it online and associated with you as its owner. It's an easy process, but won't work well if we're trying to power on and claim a bunch of these boards at once.

 

To keep things cheap and simple, we'll start off with a variable resistor instead of a pressure transducer. This will let everyone get a board working, programmed, and making measurements without spending the money on a pressure sensor--total cost for everything should be right around $30.

 

Stuff to do before the seminar:

  • Install Particle smartphone app
  • Create/log in to Particle account (free)
  • Power on Photon board (microUSB cable to a laptop, USB charger, or portable battery is fine)
  • Search for Photon board from within app, and enter credentials to allow board on wireless network
  • Watch status LED as board initializes, connects to WiFi, and Particle servers. Get excited when status LED "breathes" a cyan color.

Goodies for the seminar (either bring your own or let me know so that I have a package for you):

  • Particle Photon http://particle.io ($19) with headers, Mini breadboard (like this which comes with some jumper wires ($6.89)), and microUSB cable (found in the junk drawer, or here in a 4-pack). Alternatively, order the Photon kit, which comes with a breadboard and USB cable for $29.
  • Variable resistor (here, though I'll bring enough for everyone, and they can be bought cheaper in smaller quantities)
  • Optional 0-5 psi range pressure transducer (eBay, $30). This will work as long as the full level of your tank and the line where you install it are within 7 feet in elevation of each other (should cover any normal RV setup).
  • Your laptop and charger. You could probably do everything with a tablet just fine with a separate power source for the photon, but since the programs are all text, you're probably not going to be too happy with just an on-screen keyboard.

 

Extra stuff you may want in order to use the tank sensor/pump controller in your rig:

  • If you want to be able to disable your water pump when the tank is empty, Relay Shield ($30, order with your Photon controller; one shield has 4 relays, so you can disable pump and control fill solenoid)
  • If you want to add the ability to automate filling your tank: solenoid valve ($29, eBay) and Relay Shield

The relay shield includes a section of perf board--so it's a good place to make the tank sensor connections permanent once you have everything working.

 

I know this list may sound long--I'll have plenty of extras on hand so that everyone should be able to leave with a working setup. I'll probably take a few minutes after the first happy hour to point out the hardware and make sure everyone knows where to find me. Just let me know if you have any questions, and help me to get a head count of who's participating and who's bringing their own stuff. If it's a big enough crowd, I may also look for a few volunteers that have tinkered a bit ahead of time to give me a hand. All of the vendors linked are pretty quick--shouldn't be more than 3 days to get any of the items. If you have any questions, if I goofed up any of the links, etc., let me know!

 

Above all, I hope it's both fun and informative. No skill required to participate!!**

 

**I may regret saying that. For some reason I can already hear Roger yelling Bingo! ;)

Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply

David,

I will be at the workshop. I ordered my Photon $29 kit on the 15th and received noticed that it shipped on the 16th. I thought shipping was expensive at over $9 for their cheapest way, so it might be cheaper if people combine their orders. I could not see anything that showed where they were located at so it could be coming from China or in my home state (they charged sales tax), so we will see how long it takes to get here.

 

We will use your resistors if that is OK and just pay for them at the rally.

 

For the pressure transducer, do we need any fittings to mount them to the tanks and will there be a special location to do that? Will these be simply "a water is at this level" switch or will it give you multiple indicators (or if you want multiple you need multiple transducers?), I assume if monitoring Grey or Black it will be mounted up near the top and if monitoring fresh water, it would be near the bottom, correct?

 

If you want to monitor multiple tanks, do you need multiple Photon kits?

 

Thank, Dave

Link to comment
Share on other sites

David,

I will be at the workshop. I ordered my Photon $29 kit on the 15th and received noticed that it shipped on the 16th. I thought shipping was expensive at over $9 for their cheapest way, so it might be cheaper if people combine their orders. I could not see anything that showed where they were located at so it could be coming from China or in my home state (they charged sales tax), so we will see how long it takes to get here.

 

They ship Priority Mail from San Jose, CA. Because of where it is within the USPS system, it's 2 days to most locations. You're right about combining orders--the minimum cost for Priority Mail (after increases in January) is about $6, and goes up with distance and weight. I'd be glad to coordinate for those who aren't looking to tinker before the rally.

 

We will use your resistors if that is OK and just pay for them at the rally. Certainly! But don't worry about paying for those.

 

For the pressure transducer, do we need any fittings to mount them to the tanks and will there be a special location to do that? Will these be simply "a water is at this level" switch or will it give you multiple indicators (or if you want multiple you need multiple transducers?), I assume if monitoring Grey or Black it will be mounted up near the top and if monitoring fresh water, it would be near the bottom, correct?

 

I should have explained in more detail. It's an analog sensor measuring hydrostatic pressure, so you'll get a measurement proportional to water depth. The Photon has 12-bit analog inputs (4,096 possible readings), and will be able to read 0-3.3psi. That means 0.0008 psi resolution in theory, which translates to 0.02" H2O. In practice, that's not realistic and overkill at the same time, but I can tell you I can reliably fill my fresh water tank to where just a few drops leave the overflow tube before it stops. The sensor is 1/8" NPT, and just needs to be installed at a low point--for my fresh water, I installed a 1/2" NPT tee in the drain line, then used an adapter to 1/8" NPT. On the waste tanks, I drilled and tapped directly into the ABS drain lines just upstream of the valves.

 

If you want to monitor multiple tanks, do you need multiple Photon kits?

 

No, but it might make sense to. Each board has 8 analog inputs, but there may be configurations where it's easier to grab power and install another board when the sensors won't be in close proximity (i.e. one board for fresh water, another for grey and black).

 

Thank, Dave

 

One more thing I should add for those of you looking to make a permanent installation--you'll need reliable 5V power for the Photon. Make sure it's a good one; it should be rated at least 1A output--if you find the board randomly rebooting, it's quite likely that the power is suspect. A cigarette lighter type USB charger works fine if you have an outlet, but if you're having to run power wires to get to the board, I've been really happy with these for $12. Those of you following the lithium battery conversion will notice that it'll handle 8-50V, and the microUSB connector will plug directly into the Photon.

Link to comment
Share on other sites

Me too. And by that time it should be pretty polished.... :)

 

In fact I'll give you one of my seminar spots if needed.....

 

As long as it's after the one with all of the fire extinguishers!

 

I'm really hoping this proves useful. We'll see how well it works integrating a variety of skill/experience levels--I really don't want to leave anyone behind, but hope that it's still interesting enough for more experienced tinkerers.

Link to comment
Share on other sites

Hi David,

Using water pressure to monitor the tanks seems like such a no-brainer, compared to the unreliable methods more commonly used (contact resistance for discrete sensors, and capacitance for "through-the-wall" Seelevel systems).

What is your opinion as to why "standard" RVs don't already use the water-pressure approach?

One question (OK, tongue in cheek): does the conversion factor from PSI to inches-water-column need to be adjusted for altitude? Is the gravitational acceleration lower in Denver than in Miami?

I'm bummed I'm going to miss this seminar as we're not going to make the ECR this year; so doing it again in Hutchinson would be excellent!

 

Pete

Link to comment
Share on other sites

What is your opinion as to why "standard" RVs don't already use the water-pressure approach?

 

My guess is two things at the top of the list--cost and calibration. Calibration could easily be addressed with an analog-to-digital conversion integrated with the transducer (in other words, a factory-calibrated digital pressure measurement), but you'd still have different software for different tank configurations. Cost is tougher--4 screws and a PCB with a few LEDs and resistors is pretty cheap. For the volume end of the market, with holding tanks targeting not much more than a weekend, there's probably not much interest in another $5 for better readouts.

 

The waste tanks may still have longevity issues, though I'm optimistic that with the sensors in a drain line, fluid movement would help prevent crap (literally, I suppose) from building up. I'd bet the accuracy is affected by the ratio of #1 to #2 more than it is the altitude. At the very least, I'm pretty confident it will take quite a bit longer before they're reduced to the same resolution as the standard sensors (i.e. that one remaining LED that says "full" or "not full").

 

I have a set of capacitive tank sensors still in the box--I couldn't get a reading on my holding tanks which have a lot of steel around them. Depending on how well the project goes together, and what the group's experience is, I might consider a kit with the microcontroller and circuit board, display of some sort, and the sensors. Installation of the sensors was really (and would be for just about any RV), but I'd need to put together a controller with a non-volatile place to store calibration info without reflashing the board.

Link to comment
Share on other sites

Al,

 

With a smartphone or tablet, here's where to go to get started: https://docs.particle.io/guide/getting-started/start/photon/

 

Without a smartphone or tablet you can still claim the board and get it online by connecting it to a laptop with a USB cable. The instructions for that are here: https://docs.particle.io/guide/getting-started/connect/photon/

It's a little more lengthy this way--you can either go this route or we'll get you online using another phone/tablet to claim your board. Once the board is claimed, all you need is a web browser--tablet, phone, laptop, etc. will all do the job.

Link to comment
Share on other sites

Would like to state for those that don't want to "build" a board now, this will be a worthwhile project to observe and I'm sure David won't mind. He is "electrifying" just about everything in his Showhauler and think you will be amazed by his expertise.

 

Everyone is definitely welcome to observe, and I plan to have some extra parts on hand in case there are any last minute additions.

 

And in the process of electrifying everything, I've of course had a few screw-ups. But the screw-ups with these microcontrollers are pretty boring. I accidentally put 48V from the lithium battery to one of the 3.3V inputs on a Photon--no smoke, heat, or anything like that. But the status LED that "breathes" (their term, not mine) took its last breath. Things are progressing quickly this week with that project though--the seminar should have some good real-world experience to report, and I'll have to get the motorhome clean so I can let the group wander in and take a look.

Link to comment
Share on other sites

David

 

What are you using to display the tank level? LEDs? i2c LCDs? Something else? Maybe i missed it in a previous post.

 

Steve

 

Steve,

 

When I first started, I was using an I2C LCD with an Arduino. That worked just fine, and you could also do an I2C display with the Photon, and with 8 digital outputs, you could easily power a 7-segment LED or bar graph. If you wanted to keep it small, there are some I2C OLED displays that are <$5 and about an inch square, where you can do graphics and a couple of colors (blue and yellow I think).

 

For this first seminar, the focus is going to be on the "cloud" part of talking to the board, since it doesn't require any more hardware. I'm going to cover the URL format for reading from the Photon, and the Particle.publish command that allows you to log and chart data. Here's a raw example of what comes back on the board that's monitoring my freshwater tank:

{  "cmd": "VarReturn",  "name": "result",  "result": "{\"data1\":1310,\"tnk1\":99.259257}",  "coreInfo": {    "last_app": "",    "last_heard": "2016-03-18T17:33:56.011Z",    "connected": true,    "last_handshake_at": "2016-03-18T08:09:04.138Z",    "deviceID": "54ff65066678574927580267"  }}

The result line is what we care about--data1 is the raw sensor reading, which I used to calibrate the conversion to a percentage, in tnk1. That's getting retrieved by a script running on a Raspberry Pi 2, that I installed fairly recently with their new capacitive touch screen. It took a long time, but that product really made it so that a Pi can be used as a very sharp looking front end.

 

20160318_133610.jpg

Link to comment
Share on other sites

David, were these the I2C OLED Displays you were referring to:

 

http://www.amazon.com/gp/product/B00PQ30K06?keywords=I2C%20OLED&qid=1458403732&ref_=sr_1_4&sr=8-4

 

Or could we use something like this:

 

http://www.ebay.com/itm/10-Segments-Led-Bar-Graph-MULTICOLOR-5G-3Y-2R-Arduino/121562555733?_trksid=p2141725.c100338.m3726&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20150313114020%26meid%3D114d9a7bab1442b49d74ea47afe13255%26pid%3D100338%26rk%3D1%26rkt%3D8%26sd%3D121581107314

 

Do we need additional boards or equipment to drive these items?

 

Please note that some of us (at least me) are not very tech savy, so nice simple explanations will help! Basically yes, no or maybe it will work will usually do the job!

Link to comment
Share on other sites

David, are you displaying Volt battery info on that capacitive screen yet?

 

Yes. It's not pretty yet--just text and a few simple charts right now--but I'm able to track voltage and temperature interfacing with the BMS connector on top of the modules.

 

David, were these the I2C OLED Displays you were referring to:

 

http://www.amazon.com/gp/product/B00PQ30K06?keywords=I2C%20OLED&qid=1458403732&ref_=sr_1_4&sr=8-4

 

Or could we use something like this:

 

http://www.ebay.com/itm/10-Segments-Led-Bar-Graph-MULTICOLOR-5G-3Y-2R-Arduino/121562555733?_trksid=p2141725.c100338.m3726&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20150313114020%26meid%3D114d9a7bab1442b49d74ea47afe13255%26pid%3D100338%26rk%3D1%26rkt%3D8%26sd%3D121581107314

 

Do we need additional boards or equipment to drive these items?

 

Please note that some of us (at least me) are not very tech savy, so nice simple explanations will help! Basically yes, no or maybe it will work will usually do the job!

 

Dave,

 

Either one could be used. The OLED screen is a simpler hardware setup (power, ground, and 2 data pins that would connect to Photon outputs), and the software to drive it could be anything from a simple character display using existing libraries to something graphical. The LED bar would be really simple in terms of the software, but you'd have a lot more wires and resistors (to drop from 3.3V to 2.1V on each bar) to connect. I'd probably lean toward the OLED display--just because it'll be easier to modify if you decide you want to display additional info (e.g. multiple tanks at once, temperature/humidity, a counter of how many days it's been since you filled/emptied tanks, etc.).

 

You might also take a look at the Particle.publish command in the Photon documentation. You can log data from the Photon there and retrieve it anywhere you can get online.

Link to comment
Share on other sites

David, i am interested in a complete tank sensor system . Can you list the parts that would be needed for the total system. Readout could be graphic, bar graph or segment display...the simpler the better. I have ordered the 0-5 psi pressure transducers. Thanks, Charlie.

Link to comment
Share on other sites

Hi Charlie,

 

This list is somewhat off the top of my head, so it's entirely possible I'm forgetting something. I'm including links where possible, but at least for the plumbing stuff you'll probably get better prices at Lowe's/Home Depot.

 

Plumbing for Fresh Water

This assumes you're tying in to 1/2" PEX drain line or pump supply line.

Plumbing for Waste Tanks

This may be a little less conventional, but it's working for me and seemed to be the easiest--I just drilled into the ABS drain lines upstream of the gate valves and used a 1/8" pipe thread tap to thread the hole. This seemed a lot easier than trying to install a tee and adapt all the way down to 1/8".

 

Wiring

Each pressure sensor is 3 wires--power, ground, and signal. 18-22AWG wire should be fine, ideally in a 3-wire cable to make it easy. Here's an example. Note that's a 4-wire version--assuming you're connecting to 2 waste tanks in close proximity, you could run just one of these down to that location (power and ground split to both transducers, and one signal wire for each). If you go that route, there are connectors on 0.1" spacing to match the breadboard and perfboard.

 

For power to the photon, transducers, and display, the power supply I posted earlier is an easy way to go.

 

For a display, the simplest route is probably a 2-line character display like this one. You could probably fit readouts for 4 tanks on there at once, or set it up to cycle through them one at a time with a more descriptive title and bar graph readout. It's a little hard to tell in pictures, but it's considerably bigger than the little OLED displays, so it's probably better suited to easy reading when mounted on a wall somewhere. Four wires will run between this and the Photon board--the same 4-wire cable will work fine.

 

What got me started on this whole thing was wanting to fill my tank without getting the whole campsite wet. If you've gotten this far, it wouldn't be much extra work to incorporate control of a fill valve and run-dry logic for the water pump. You'd need the relay board, and enough wire (probably 16 AWG) to run from the pump to the relay board and back.

 

Speak up if this doesn't make sense. I wasn't planning on covering too much of the display/interface this time around, but if time permits we certainly can.

Link to comment
Share on other sites

 

Everyone is definitely welcome to observe, and I plan to have some extra parts on hand in case there are any last minute additions.

 

And in the process of electrifying everything, I've of course had a few screw-ups. But the screw-ups with these microcontrollers are pretty boring. I accidentally put 48V from the lithium battery to one of the 3.3V inputs on a Photon--no smoke, heat, or anything like that. But the status LED that "breathes" (their term, not mine) took its last breath. Things are progressing quickly this week with that project though--the seminar should have some good real-world experience to report, and I'll have to get the motorhome clean so I can let the group wander in and take a look.

 

I would very much like to observe. Haven't had the coach long enough to know what level sensing I have yet, but am interested in what is available if I run into problems, or am looking for an improvement

Link to comment
Share on other sites

David,

I received the kit within two working days.

 

First, I would recommend using a mobile app if you can get one but I am not a smart phone user so I went the Windows USB route. The Windows setup was not easy. I set it up using a laptop via a USB port. I had trouble getting it on my WIFI until I used Putty terminal. Even though my WIFI was set to use WAP2, the Photon would not link until I set it to use WAP. ??? If someone needs help, I can help.

 

I could not find a Windows app that looked anything like the Particle mobile app. I had to borrow my wife's tablet. Accessing the Photon was very simple. I went through the "Tinker" routine without any issues.

 

We will arrive at Deer Run early (Monday) as we have to be in Nashville for another event. I will be available to assist in any setup or crowd control that may be necessary.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...