element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
John Wiltrout's Blog Automatic Water Shut Off Chapter 4 ( Frankensteining a Control Unit)
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jw0752
  • Date Created: 11 Jul 2016 5:02 AM Date Created
  • Views 1403 views
  • Likes 9 likes
  • Comments 14 comments
  • automatic_flood_protection
Related
Recommended

Automatic Water Shut Off Chapter 4 ( Frankensteining a Control Unit)

jw0752
jw0752
11 Jul 2016

Before I begin to show you how I put together the control unit for the Automatic Home Water Shut Off System here are links to the first three chapters of this series:

 

https://www.element14.com/community/people/jw0752/blog/2016/07/02/automatic-water-shut-off-system-for-the-home-chapter-i

https://www.element14.com/community/people/jw0752/blog/2016/07/05/water-shut-off-system-chapter-2-sensors

https://www.element14.com/community/people/jw0752/blog/2016/07/08/automatic-home-water-shut-off-chapter-3-turning-the-valve

 

Chapter one laid out some of the parameters for the power supply and control circuitry for the Automatic Water Shut Off. The system voltage was established at roughly 12 volts by virtue of the (2) 6 volt lead acid gel-cells that would be used for battery back up. The power supply of the control will be required to potentially recharge these batteries from a ground state to full charge as well as supply a sustaining trickle charge over long periods of time. The power supply also needs to be able to supply power to the sensor circuits, display circuits, and the trigger circuits that will fire the solenoid that releases the weight that closes the water valve.

 

I began by looking through my grave yard for a suitable sized enclosure and a suitably sized power supply. The unit that seemed most appropriate began life as a Dental Cure light. If you want more information on what exactly a Dental Cure Light is here is a link to a previous blog where I gave some background: ( You can skip back here after the brief preliminary explanation of what a cure light is.)

 

https://www.element14.com/community/people/jw0752/blog/2016/06/25/tsl-230-light-to-frequency-converter

 

Here is what the original control looks like without the power cord and light attachment:

image

 

Internally there is a reasonably sized transformer capable of 17 volts at 3.5 Amps. The rest of the circuit board is devoted to a crude power supply and other components needed to make the cure light function. Here is a peak inside the unit before we begin the modification.:

 

image

 

Now that I had a prospective candidate for housing the control for the Automatic Shut Off System Control I began to breadboard and design the power supply and the rest of the control circuitry. The first project was the power supply. I decided to use a design the was introduced on the Forum a year or so ago by one of our Experts, Robert Peter Oakes . The design uses a full wave bridge from the transformer secondary to provide input to a MOSFET that is controlled by an OPAMP. I wanted to be able to accurately adjust and trim the final output so that I could bring the final trickle current to the gel cells to a very low level. The transformer of the cure light as well as the primary support circuitry was left in place. Tests revealed that the 17 VAC of the secondary when rectified and filtered produced an unregulated 22 volts. This provided plenty of room for the MOSFET and OpAmp to work.

 

I simultaneously was bread boarding and developing a control circuit that would look at the sensors that were discussed in Chapter 2 and trip an alarm and the solenoid to close the water valve. Here is a picture of the bread board circuit under development:

 

image

 

The work on the power supply and the control circuitry eventually led to this circuit. Here is a schematic of the final prototype design. For simplicity I have left the mains switch, fuse, suppressors and other transformer primary circuit components off the schematic.

 

image

 

 

Now the fun part begins. You have probably been asking yourself by now; Didn't he say something about Frankenstein in the title of the blog? Yes I did. For this project I decided to fore go the usual construction of the control circuitry on a piece of clean prototype board. Just like the famous Dr. Frankenstein I have decided to remove all the parts of this Cure Light Control that do not suit me and put in on the same circuit board, using the same pads and traces, the parts that I need to make an Automatic Water Shut Off. Here is a picture of the circuit board as it looked originally and after the old components were removed.

 

image

 

image

 

We might as well throw in a picture of the reverse side of the board too as this is where most of the new work will be done.

 

image

 

What I am doing with this board, I will call it Frankensteining, is only possible for me because I am working with very simple circuits like the one in the schematic above. The procedure involves a careful study of the layout of the existing traces and a careful, planned positioning of the new parts. Frequently it is necessary to cut traces and occasionally it is necessary to jumper traces. Pads for connecting components can be made with sections of the original traces. You will see unconventional structures like OpAmp Pillars and Comparator Pillars in this build. They are the results of necessity and convenience. This circuitry will work as it is all low frequency or linear in nature. This type of build would quickly fail if we were dealing with higher frequencies. Inductive and Capacitive coupling would interfere and our build would never rise from his slab. Skipping ahead here are a couple pictures of the completed transformation:

 

image

 

image

 

The controls, some of the terminal I/O, and the system volt meter were mounted to the original cover.

 

image

 

The power supply MOSFET was attached to an Aluminum base plate in the unit and the relay trigger MOSFET was mounted on a heat sink left from the original cure light circuit.

 

image

 

image

 

The trigger MOSFET is mounted on the black heat sink on the left side of the picture. This is a picture of the board before the rest of the sensor/trigger circuitry was installed but it gives the best picture of the OPAMP pillar that I referenced before. The blue ten turn trimmer is the voltage control for the unit.

 

image

 

This is a picture of the completed unit mounted with its battery pack on the wall alongside the mechanical mechanism that closes the water valve.

 

In case you are interested it wasn't a totally smooth build. Those of you who have made things like this yourselves would not have believed me even if I told you it was smooth. I am sorry to report that (2) LM393 ICs gave their lives before I properly conditioned their power source and protected them from spikes. At the time of failures it is always very frustrating but in the end I always learn more when I have troubles. When I ran a test involving recharging the battery from full discharge I also ran into a concern with the heat that was being sunk by the power supply MOSFET. This problem was addressed by adding a half ohm current limiting resistor in the charge circuit, (which I should have had there from the beginning), and by installing a small 12 volt fan from a different model dental cure light as well as a small thermostat set at 70 degrees C which was mounted on the heat sink next to the MOSFET. Subsequent tests kept the temperature down to safer levels. Actually I do not anticipate the need for the power supply to ever have to charge the battery from full discharge but it is important to always test the worst case possibilities.

 

With the control built, tested and installed next to the mechanical system it was time to add the sensors. One of my goals when planning for connection of the sensors was to have them easily removed for purposes of replacement or testing. I needed a simple low voltage 2 conductor connector. I also wanted it to be cheap. I remembered years ago there was a nice inline connector that was used for 300 ohm TV / FM antenna cable. A call to my local retro electronic parts store had the owner digging. I think I made his day when he found and I bought these little beauties:

 

image

Well at $1 per card of two maybe I didn't make his day but it sure made mine.

 

image

 

Here is a sensor with an plug attached. Based on good advice from my friends on the forum I also made a modification to the sensor. I added additional paper so that the copper electrodes in the sensor do not come into direct contact with any of the salt paper. I would not bet on this sensor being the final design but my curiosity will at least let them ride until they fail and shut off my water while I shower or worse yet if they catch the boss. The plug on the right has a 47K resistor and can be used to test the sensor line by triggering the system from any given sensor position in the house. Currently there are seven sensor positions like under the water heater, under the sink, by the main water service inlet, behind the washing machine and by the house's external faucets.

 

image

 

Here is a picture of the sensor that is at the water main entrance of the house. You can see the 2 pin 300 ohm inline connector tucked under the wall board.

 

This Chapter has gotten fairly long so I will stop for now and write one more final chapter in a couple days or as soon as I can get my video production crew, the boss Millie, to hold the camera.  In the video I will put drops of water on a sensor in front of the control and mechanics to demonstrate the operation of the system.

 

John

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 9 years ago in reply to jc2048 +4
    Hi Jon, Your recommendation has been implemented. John
  • michaelkellett
    michaelkellett over 9 years ago +3
    You might like to consider adding some hystereisis around U2 - maybe 10M from output to +ve input - this will make the switching threshold of U2 change a little when its output changes state and reduce…
  • jc2048
    jc2048 over 9 years ago +3
    I think I'd want a fuse in series with the battery (most practical way would be an in-line fuse holder in the red lead that comes down from the pair of batteries). If something were to short on the board…
Parents
  • kulky64
    kulky64 over 9 years ago

    I'm little confused. Your schematic indicates that the negative input of the comparator is used as reference with one half of supply voltage on it (which is 6.8 V). In your second blog you showed that when your sensor is dry it has more than 50 Mohm resistance, so basicaly open circuit and resistor R13 should pull down the positive input of the comparator to low level. So in dry condition you have lower potential on comparator positive input and therefore comparator's output transistor should be open and pull-up resistor R14 should pull the gate of Q2 high opening the transistor. Your solenoid should be now activated, buzzer buzzing a LED lit, which is obviously not desired behavior. Or am I missing something?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 9 years ago in reply to kulky64

    Hi kuly64

     

    These comparators are always confusing to me. I like to remember that when the + is at a Higher Conventional potential than the - the transistor of the comparator output transistor is open ( turned off ). When the + an d - are reversed with the - at at higher potential then the Op Amp is trying to do something to get back to the normal state and it turns its output transistor on which pulls the output down to the lower potential. Using this logic my LM393 is normally operating with the - input at 6 volts and the + input at ground. This makes the output transistor turn on which really means that it pulls the output down to ground. This keeps the gate of the IRF511 at ground and turned off. As soon as the sensor shorts out the + input of the LM393 is pulled above the - input and the output transistor of the LM393 turn off allowing R-14 to pull it and the gate of the IRF511 high and all the bells and whistles are tripped. Frankly I get confused by this myself and often have to bread board a circuit to figure out the logic. Hope this helps. I appreciate your input and it made me do some scrambling to recheck my schematic to make sure it was in conformity with the circuit which is working properly so at least I knew it was wired correctly even if I had made a mistake in the schematic. By the way I would be pleased to address you by your first name instead of your user ID if you let me know it.

     

    John

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kulky64
    kulky64 over 9 years ago in reply to jw0752

    OK, now i'm even more confused. I looked on figures 12 and 13 in this datasheet:

    http://www.ti.com/lit/gpn/LM393-N

    It is the same situation as yours. They have +2.5V on negative input and triangular waveform on positive input. And from Figure 13 it is clear, that when Vin on positive input is greater than +2.5V on negative input, the output is low. However in chapter 8.4 they claim the opposite.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 9 years ago in reply to kulky64

    You will have to read it again as I don't see an inconsistency. Keep in mind for this configuration of the circuit a High output really means that the output transistor is turned off and a Low output means that the output transistor is turned on.

    John

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • jw0752
    jw0752 over 9 years ago in reply to kulky64

    You will have to read it again as I don't see an inconsistency. Keep in mind for this configuration of the circuit a High output really means that the output transistor is turned off and a Low output means that the output transistor is turned on.

    John

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube