Author Topic: A fun little project for the house  (Read 1832 times)

0 Members and 1 Guest are viewing this topic.

Offline Ground_LoopTopic starter

  • Frequent Contributor
  • **
  • Posts: 666
  • Country: us
A fun little project for the house
« on: February 06, 2021, 06:52:49 pm »
I thought I would share something partially inspired by this community.
After numerous issues with my water line I decided to get ahead of it a bit.  I developed a device I’m calling Water Guard.  The water line to my house is 1000 feet long and enters at street pressure, 150psi.  Just inside the crawlspace is an isolation valve, pressure reducer, pressure gauge, and another isolation valve.  Over the years I have suffered broken water lines, fouled reducer valve seats, internal slow leaks and billing issues. So, with a bit of occasional help from you folks I have created a monitor system which consists of a PIC18F27Q10-controlled instrument assembly and a PIC24FV32KA302-controlled user interface.

The Instrument package is a analog street pressure sensor, flow meter with pulse-per-gallon output, analog house pressure sensor, and crawlspace temperature sensor.  The instrument controller performs the following:

1.   Read in analog street and house pressure.
2.   Read One-Wire temperature.
3.   Accumulate water flow pulses in gallons up to 32 bit, good for several decades.
4.   Store in flash memory gallons every 100 gallons as a power outage guard.
5.   Transmit pressure, temperature and flow to the user interface.
6.   Allow for power on reset of stored gallons if desired.

The water line instruments almost ready to cut in.
1166840-0

Instrument controller still on the proto board.  I noticed that the Bluetooth module didn't like the soft start of my bench supply so i had to put in a delayed start SCR to turn on power.  The two pots are simulating the pressure sensors and water flow is simulated with a pulse generator.  Temperature is the actual temperature sensor.  The little buck power supply is backed up with a 9V battery through steering diodes. Both packages have a minimally intrusive breathing LED life indicator.
1166844-1

The default view of the UI.  Pressure, total recorded flow, date and time
1166848-2

Usage compare view.  Begin and end dates are entered with the pushbuttons and data is pulled from the EEPROM.  Usage is the difference between the two dates.  Temperature also displayed.
1166852-3

Hourly use review.  Up an Down pushbuttons cycle through each of the last 24 hours to display hourly water usage.
1166856-4

Data is transmitted to the UI over a married pair of Bluetooth modules using a UART channel on both ends.  Marrying the Bluetooth modules was challenging in the sense that it was done through a terminal program with issues of its own and a TTL-RS232 converter I put together just for the occasion.  The other challenge for me on the instrument end was the One-Wire protocol for the temperature probe.  This is the most ridiculous and annoying thing I think I’ve ever dealt with.  I ended up successfully creating a driver for the PIC.  The One Wire takes so long that I had to pulse stretch the flow pulse to ensure it was never missed.

On to the user interface.  The UI receives data from the instrument package:
1.   displays relevant information on a 20x4 LCD
2.   Allows monitoring of the last 24 hours of water flow (leak detection)
3.   Allows comparing water flow for two selected dates.  (billing accuracy check)
4.   Stores water usage at the end of each day in a 64K serial EEPROM
5.   Sets alarms for:
  a.   House pressure too high (reducer failure)
  b.   Street pressure too low (possible broken line)
  c.   Crawlspace temperature too low (possible freeze hazard)
  d.   Positive flow recorded for each of the last 24 hours (internal house leak)

Time and date are maintained by a battery backed clock module.  The UI utilizes 2 channels of I2C, one for the clock module and one for the EEPROM.  I realize both could be one a single channel, but troubleshooting is simplified with dedicated channels.  The LCD display is driven by a 16bit shift register on SPI.  Bluetooth is on a UART channel.  User inputs are NO pushbuttons with interrupt driven debouncing.

Pictures are as of today.  I am collecting enclosure components and will update when fully installed.

I have dabbled in electronics my whole life, but my career centered on developing large scale industrial control systems and project management.  Until a couple years ago I have never programmed anything in C and only a couple occasions programming microcontrollers in assembly.  Thanks to all that helped.  This has been fun and educational.

The pics did not insert in-line, but they are in order below.


« Last Edit: February 06, 2021, 07:05:02 pm by Ground_Loop »
There's no point getting old if you don't have stories.
 
The following users thanked this post: edavid, Syntax Error

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1201
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: A fun little project for the house
« Reply #1 on: February 06, 2021, 07:29:58 pm »
Great idea   :)

In the UK our water meters have a little magnet on the pointer so long ago I put a reed switch down the hole with it and a display in the house that gives Litres/day, week & month. Useful for checking your bills BUT also saved me a ton of money when our underground pipe sprang a leak as I picked it up in a few hours rather than when the next bill arrived months later  :)

Thank god my normal water pressure is nowhere near 150psi, but I do wonder if a pulse is what split the plastic pipe that turned out to be a good 4ft down.

I hope your Bluetooth modules still work over the desired distance, my reed switch is connected by wire and I am always catching it in the hedge cutter, wireless would be nice but that means batteries  :-//
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: A fun little project for the house
« Reply #2 on: February 06, 2021, 08:46:47 pm »
I don' need no stinking flow meter. ;)
I just check the level of my 20 gallon tank.
I'll let you do the math: 1/2 a 20 gallon tank in 10 days...
 

Offline Skashkash

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
Re: A fun little project for the house
« Reply #3 on: February 06, 2021, 08:56:06 pm »
That's pretty neat. I have a buddy that wants to do something similar on his water supply.

  Do you have a link or any info on the analog pressure sensors you selected and how you plan to read / calibrate them?
 
 Thanks.
 

Offline Ground_LoopTopic starter

  • Frequent Contributor
  • **
  • Posts: 666
  • Country: us
Re: A fun little project for the house
« Reply #4 on: February 06, 2021, 09:08:50 pm »
I bought the sensors and water meter off Amazon. Sensors cannot be calibrated. But if it really bothered me I could compare against a known standard and develop a calibration curve. As it is they are close enough. Range for both is 0.5-4.5VDC 0psi-full scale.  The high pressure sensor is 0-150psi and the other is 0-100psi.   Fittings are ⅛ MIP.
There's no point getting old if you don't have stories.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13119
Re: A fun little project for the house
« Reply #5 on: February 06, 2021, 09:34:16 pm »
1Wire protocol is a *LOT* easier to handle if you have a free UART.
See https://www.maximintegrated.com/en/design/technical-documents/tutorials/2/214.html
It can be entirely non-blocking and handled by a background ISR.

You may wish to consider changing to a PIC with two UARTs so you can eliminate the flow pulse pulsestretcher.

Also, why not use one of the PIC's hardware counters to accumulate the flow pulse, or at the very least an external interrupt?
 

Offline Ground_LoopTopic starter

  • Frequent Contributor
  • **
  • Posts: 666
  • Country: us
Re: A fun little project for the house
« Reply #6 on: February 06, 2021, 10:37:16 pm »
Thanks for the suggestions Ian.  Now that I have both ends operating reliably I'm reluctant to make any changes. Nonetheless, things to consider for the next projects.
There's no point getting old if you don't have stories.
 

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 822
  • Country: de
  • Old analog audio hand - No voodoo.
Re: A fun little project for the house
« Reply #7 on: February 07, 2021, 07:42:37 am »
My non-invasive solution with a reflex light barrier:





Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter, UT216C AC/DC Clamp Meter
 

Offline Ground_LoopTopic starter

  • Frequent Contributor
  • **
  • Posts: 666
  • Country: us
Re: A fun little project for the house
« Reply #8 on: February 07, 2021, 01:27:29 pm »
I don' need no stinking flow meter. ;)
I just check the level of my 20 gallon tank.
I'll let you do the math: 1/2 a 20 gallon tank in 10 days...

You use 1 gallon per day?  Our house averages about 200 per day.
There's no point getting old if you don't have stories.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: A fun little project for the house
« Reply #9 on: February 07, 2021, 02:08:46 pm »
You use 1 gallon per day?
Yup. :o

Our house averages about 200 per day.
I'd have to fill up 10 times a day for that!
 

Offline Ground_LoopTopic starter

  • Frequent Contributor
  • **
  • Posts: 666
  • Country: us
Re: A fun little project for the house
« Reply #10 on: March 07, 2021, 06:00:05 pm »
1188668-0Got it in an enclosure and leak checked the instruments.
1188550-1
Left to right, User Interface, sensor interface, sensor junction box.
I got the UI faceplate from Front Panel Express. Next step is inserting the sensor assembly in the water line.

« Last Edit: March 07, 2021, 10:37:35 pm by Ground_Loop »
There's no point getting old if you don't have stories.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1460
  • Country: us
Re: A fun little project for the house
« Reply #11 on: March 07, 2021, 10:03:39 pm »
That all looks very nice!

The main front panel came out well.
I like the two other boxes with a bit of gasket? and the screw inserts.
I'm too used to boxes with self-tapping screws.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf