Announcement

Collapse
No announcement yet.

OT: Electronics help debouncing a float switch

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OT: Electronics help debouncing a float switch

    I have a small float switch and a pump bailing out my toilet as it is flooding until we can clear the blockage - long story. The float switch turns on a relay and the relay runs the pump. The problem is that there is not a wide enough hysteresis - so sometimes the pump turning on can cause it to immediately switch off which can then switch it on.....and it bounces for a while.
    I thought this would be simple enough to fix by connecting a 100uF capacitor (because I had that or 10uF available) across the float switch. That seemed to burn out the float switch or in some way jam it on even after I disconnected the capacitor and reset everything. Seems to work now - maybe it's cooled?

    Questions are this then if anyone can help:

    1. Is there an easy way I can just add a delay in the relay turning off after the float switch turns off?
    2. Why did it break it?

    Relay is this one wired as a ground trigger (see one of the pics) - since it was slightly less wiring. The "DEVICE" is the pump and the "Ground trigger source is the float switch to ground.

    Many thanks,
    Gareth

  • #2
    You can simply buy a relay with time delay release or a host of other options. Not sure what voltage etc. you are using but here's a generic search.

    Amazon.com : time delay relay

    Comment


    • #3
      Thanks Lakeside. Sorry, meant to say that it's all 12V. A lot that I'm finding seem to claim "Delay off" but the description either indicates that it turns off after a time or it's just written by a non-english speaker and utterly mangled. I'd need the pump to run on for even a second after the switch goes off but the description seems to suggest that when the switch is closed, the relay will close (and run the pump) for a set time and then turn off regardless of the switch still being on. I was looking at this one: https://www.amazon.co.uk/Delay-Timin.../dp/B08C4YLL9H
      Am I reading that all wrong?

      Comment


      • #4
        A large capacitor across the switch will give the contacts a big surge when they close. It "can" delay the relay opening for a little while. If you put a smallish resistor in series with the capacitor, that will cut the current surge. It needs to be small relative to the coil resistance, so that it does not reduce coil voltage after the switch opens. See another idea below...

        You are, of course, quite correct, the system lacks hysteresis.

        What you really need is a float switch that trips to "pump on" at a higher level than it trips to "pump off". That way the pump runs long enough to drop the level a fair distance. Most of those should, but maybe yours is either bad, or the wrong type.

        How fast does the pump drain the sump? If it is too big, it will suck down and shut off very fast. I assume you already checked for that, and it is not the issue.

        What kind of switch is it? I've seen ones that are like a toilet tank, a float on a guide, and ones that are a floating switch on a cord, no guide.

        What happens when you raise the float yourself, and then let it down slow? Does it switch on and off at the same point?

        How fast does it repeat when it is turning off and on?

        The relay you linked is unavailable, and gives little data anyhow. I don't think I'd look to another relay for a solution as the first choice, although you might end up there.

        A capacitor across the relay coil might do better. With a resistor in series with the capacitor, and a diode across the resistor, you could get a system that would charge a large capacitor slower through the resistor, with no big surge, and the diode (reverse poled across the resistor) would allow it to power the relay for a while after the switch opens, without the resistor interfering.

        The time it stays closed after the switch opens depends on the capacitor value, the coil resistance, and also the "drop out" voltage of the relay, the coil voltage that will no longer hold the contacts closed. Bigger capacitor, and higher resistance coil makes it longer.

        The resistor can be any value that you like which keeps the current surge within reason for the switch contacts. If larger than maybe a tenth of the coil resistance, it needs the diode, if smaller you can leave out the diode. I'd go higher, since it has to carry both the relay coil current, and also the capacitor charging current, and I have no idea of its rating.
        Last edited by J Tiers; 01-09-2022, 01:06 PM.
        4357 2773 5647 3671 3645 0087 1276

        CNC machines only go through the motions

        "There's no pleasing these serpents"......Lewis Carroll

        Comment


        • #5
          Ah, that sounds like it explains why it broke. The surge must have stuck the contacts of the reed that's in the float switch together and I was just lucky they came apart again after they'd cooled. I have a couple of spare float switches (they took too long to arrive so I had to find a local one) but of course, they're a different thread (M10 instead of M8) and won't fit the mount I made.

          The float switch I'm using is one of these: https://uk.rs-online.com/web/p/float-switches/0519242

          Hopefully (!) this is just a short-term solution to stop the toilet overflowing and buy time until the problem is properly fixed. Hence I'm keen not to throw much more money at it than I have to but I'm concerned that the rapid bouncing will cause either the relay or the pump to fail. Speed-wise, it's quite quick but I think that it's the inrush of the pump starting that drops the water level enough to drop the float but as soon as it then turns off, that water hasn't really gone anywhere meaningful....it's sort of slack in the system.....backlash if you like .
          The pump isn't that fast but I think some of that is because the non-return valve I got is truly appalling - it was jammed completely shut until I poked it and is still very hard to blow open. I think the resistance of that plus the 10m of garden hose and the 1m of head slows it down a lot. The important thing is that it does keep up with the in-flow! I put the non-return valve in the system after issues with a lower-power pump initially. Whilst it did pump, it was more of a 'maybe' than a 'get some sleep, I've got this' and couldn't prime the system itself. The issue as well was that because the outlet at the kitchen sink (appliance barb on sink waste) is above the height of the pump, some of the water drained back downhill after the pump stopped and that led to a similar (but slower) bouncing as the returning water filled the bowl enough to trip the switch and cycle.
          You're right, the ideal solution would be a float switch that turns off lower than it turns on. They do a 10mm longer switch but there's no indication that it does that.

          The coil resistance is 77 Ohms.

          What I have is this:



          Is this what you're suggesting?



          Components available are a selection of axial resistors from an electronics kit, diodes from same (N4007), 50V electrolytic capacitors in either 10 or 100uF. I think I also have a much larger power diode somewhere I can try to dig out if necessary. I do have access to RS but while they often sell cheap per unit, they're frequently in packs of 1000 or something unhelpful (for me!).

          Comment


          • #6
            Originally posted by Cenedd View Post
            ...............................

            The coil resistance is 77 Ohms.

            What I have is this:



            Is this what you're suggesting?



            Components available are a selection of axial resistors from an electronics kit, diodes from same (N4007), 50V electrolytic capacitors in either 10 or 100uF. I think I also have a much larger power diode somewhere I can try to dig out if necessary. I do have access to RS but while they often sell cheap per unit, they're frequently in packs of 1000 or something unhelpful (for me!).
            With that, the diode is not needed, and would be detrimental.

            I am actually suggesting the whole set of 3 parts be transferred to across the relay coil with the same polarities. In that way, the turn-off will be delayed a bit. The diode will drop less voltage than the resistor (which can be larger).

            Unfortunately, the 100 uF capacitor is small, given the somewhat low resistance of 77 ohms, and would only hold the relay in for a few more milliseconds, somewhere between 10 and 20 ms most likely, depending on what voltage it opens at.

            So if those are what you have, it seems there is no big advantage to be had.

            Presumably, if the switch is a reed switch, it is activated by a magnet. Maybe the magnet can be arranged to be pushed up by the float, but the float can be arranged to leave the magnet in position (needs a bit of friction) until it has floated down farther than the current shutoff point. An aluminum "hook" to drag it down seems appropriate, with the length set up to give a suitable amount of pumped water before the hook pulls the magnet down. Anything similar would work, and you have a shop..... possible free solution, given some shop time.
            4357 2773 5647 3671 3645 0087 1276

            CNC machines only go through the motions

            "There's no pleasing these serpents"......Lewis Carroll

            Comment


            • #7
              As you have a few spare switches, maybe arrange it such that one of them starts the pump and a second one, mounted lower, shuts the pump off. A bit more complex, but maybe not unduly so. It's not an uncommon arrangement.

              Comment


              • #8
                Ok, I can't easily do it in electrics then and haven't got the stuff (of knowledge) for electronics. I did think about microelectronics (you know me and over-thinking things!) - there shouldn't be any reason I couldn't do this on an Arduino in the manner that Alan suggested but there are so many other things going horribly wrong (or otherwise occupying my time) at the moment that I think I'm just going to risk the bounce killing things. It seems that rain isn't causing as much backwash as it did previously but running the washing machine really does! The timing of that, however, is controllable. Thanks for the help guys, I really do appreciate it - especially at the moment!
                Just for laughs, here is my situation in pictures:

                Paddling pool was cheap insurance against the pump not working and I could get it delivered before I had enough bits to make the pump work. The black rectangle is just a piece of rubber to stop the bottom of the toilet piercing/scraping through the bottom and causing a leak.



                Black rod is some 10mm delrin bored through and the end tapped M8. Scrap-bin steel tube to mount it all to - if you can call cable-ties "mounting"! And some lovely green paracord to stop it sliding off.



                12V PSU and automotive relay:



                Draining via garden hose into the kitchen sink. Less pump head required to get there, doesn't get in the way so much and also doesn't foul the kitchen sink. Silicone sealant to make up for the imperfect fit.....but I didn't want to buy 30m of larger hose just for this one-off.



                On Sunday we managed to find the manhole which is the next step to getting the problem fixed. Some numpty poured 4" of concrete over the top of it and then left it to cure for 20 years.



                We still have to dig up the new kitchen floor and the garden to move the downstairs toilet from the drain it is on now to the one the upstairs toilet is on. Whilst it would have been permissible to reclassify the drain from rainwater to foul (it's on a shared service), it turns out that it is a party line (so to speak) and next door's rainwater joins it before it gets to the chamber under the manhole; so we have to disconnect it. Still need to clear the blockage that's there now as next door's rainwater would otherwise flood our foundations.

                Comment


                • #9
                  HOLY CRAP ! ! !
                  Why are you rigging this contraption up in the first place???
                  What is the problem statement ? ? ?

                  -Doozer
                  DZER

                  Comment


                  • #10
                    Originally posted by Doozer View Post
                    HOLY CRAP ! ! !
                    Why are you rigging this contraption up in the first place???
                    What is the problem statement ? ? ?

                    -Doozer
                    Originally posted by Cenedd View Post
                    I have a small float switch and a pump bailing out my toilet as it is flooding until we can clear the blockage - long story. The float switch turns on a relay and the relay runs the pump. The problem is that there is not a wide enough hysteresis - so sometimes the pump turning on can cause it to immediately switch off which can then switch it on.....and it bounces for a while......................................

                    Many thanks,
                    Gareth
                    It appears that the downstairs toilet overflows due to excess flow outside of the house......no?

                    That IS impressive..... I am "relieved" to know that there is another toilet available...... presumably on another drain line.
                    4357 2773 5647 3671 3645 0087 1276

                    CNC machines only go through the motions

                    "There's no pleasing these serpents"......Lewis Carroll

                    Comment


                    • #11
                      DoozerIt's more UNHOLY crap to be honest. The long and the short of it is the builder made assumptions based on "knowing what he was doing" and bet on the wrong horse. There are no plans of the drains for the entire area and we were told there was no manhole serving our property at all.
                      We should be able to confirm things with a further camera survey sometime this week now that we have found a manhole and can attack it from the other side but all evidence points to the drain we connected to joining next door's rainwater drain before it gets to the manhole and there being a blockage between that junction and the manhole - hence when it rains, next door's runoff backs up our drain (which is now connected to a toilet instead of a rainwater downpipe) as a less restrictive exit..... which is undesirable!

                      J Tiers Yes, fortunately. I've endured bathroom refits before where shall we say the supermarket was my friend! And yes, it's on another line to the same manhole. That's the line we'll have to join our new toilet (pictured) to but that means digging up the garden (not so much of a problem) and also part of the new kitchen (more of a problem!). Fortunately the joint and the entire run doesn't go underneath any cupboards and we should be able to lift the new floor as it is comes up in the reverse direction to which it was layed and the part that needs to come up was laid last.
                      We also need a stub stack and air admittance device fitting behind the toilet as the builder did not install them and they are needed. I did like the way said builder said he would come and quote for the work. This is going to be.... interesting!

                      Comment


                      • #12
                        Dude, you must be an engineer.
                        No normal person rigs up a contraption like that.

                        -D
                        DZER

                        Comment


                        • #13
                          Oh I'm far from "normal" ;D ...but an engineer? A wannabe perhaps. It's some breathing room and some peace of mind at night. That was my fear; that it would rain heavily overnight when I wasn't watching over it with a wet vac.... which was my first goto.
                          The hysteresis is a problem that would need solving for longer term reliability and the non-return valve would also need replacing with one that isn't so horribly restrictive.
                          There are, of course, off-the-shelf sump pumps but I believe they are too large to fit - or perhaps to do so and activate much before overflow. Also more expensive but I'd have gone for a pre-rolled solution given the situation!

                          Comment


                          • #14
                            Do you know what an M-80 is over there in England ? ? ?
                            Sometimes lit and flushed down toilets by high school
                            students here in the States.
                            -D
                            Last edited by Doozer; 01-10-2022, 08:51 PM.
                            DZER

                            Comment


                            • #15
                              Originally posted by Cenedd View Post
                              .............................
                              The hysteresis is a problem that would need solving for longer term reliability and the non-return valve would also need replacing with one that isn't so horribly restrictive.
                              .............................
                              It seems you may need, as long as the drains have to be attacked, that it would pay you to have a "backflow preventer" put in. I don't know if those are "a thing" over there, but they are here. In some situations they must be put in by code.

                              There are ones made for 150mm and for 100mm pipe (6" and 4") which do not restrict flow. They are basically a big flapper valve in a housing, and can pivot up so as not to offer any restriction at all..
                              4357 2773 5647 3671 3645 0087 1276

                              CNC machines only go through the motions

                              "There's no pleasing these serpents"......Lewis Carroll

                              Comment

                              Working...
                              X