# Urgent electronic problem (drive pump with 2 switches)

**URL:** <https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221>\
**Category:** Hardware\
**Created:** [2 January 2024 20:02 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221 "2024-01-02T20:02:39Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![IanH](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ianh/32/95002_2.png) [@IanH](https://discourse.nodered.org/u/IanH)\
**Post date:** [4 January 2024 08:46 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/22 "2024-01-04T08:46:56Z")

</div>

Bart,  
The easiest long term is a 240V Float switch that is suitable for Sumps (rather than tanks) although some can do either (they have 3 wires). THey have in built in Hysterisis, and by playing with lead length and the weight you can set on and off depths. A quick search of eBay or internet will find many like this  
[10m 10A Liquid Water Level Float Switch Sensor Sump Fluid Tank Pump Controller | eBay](https://www.ebay.com.au/itm/314224451147?hash=item49293c9e4b:g:5M8AAOSws4FiLywJ&amdata=enc%3AAQAIAAAAwDWarUFhNkITtMo80RsO2b95D7%2Boz4cxFrYQaabOB%2BNTH7TRl31mxR7qnDhw4hkZAlaCP88vFCSa41KJizL00EXtO4qXDNiCTLRNBts45KBp21maR8%2BCVRIxzmuyvWmcvbYLQ4bgO%2FXI9QtN8xCDZeVRlTz9ATHcg3kqWWeRdH5N1CHaCSd8eQG1%2F7vEcg235Lc7NnaBGXNKSrA7Botsm2FVX5BnRzBzzJ4xj5a2%2Blo5f8deh1d%2BH0ORmCHDEO1qtg%3D%3D%7Ctkp%3ABlBMULCu07maYw).

SHort term, just wire in one of those LV float switches to your relay board (or both ) , it will short cycle  
but will keep the water out till you find a float switch. You just need to find a LV power supply (an old USB charger should have enough Amps at 5V)

Should work with any sump pumps of size usually used in home basement but do check rating plate (10A is 2400W at 240V, or 1200W at 120V but you load is indictive motor, halve those (1200W or 600W) to help preserve contacts.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [4 January 2024 14:10 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/23 "2024-01-04T14:10:31Z")

</div>

Just noticed that we haven't heard from Bart since he started wiring up the pump.  
Did anyone warn him about the dangers of wiring mains circuits whilst standing in water??

![bart](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b292e8413810d73448242522a477c5821fea875f.jpeg)

---

<div class="post-metadata">

**Author:** ![BarryMas](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barrymas/32/38363_2.png) [@BarryMas](https://discourse.nodered.org/u/BarryMas)\
**Post date:** [6 January 2024 14:33 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/24 "2024-01-06T14:33:46Z")

</div>

I would go for either SSR as already stated or for mosfets to switch the pump.  
That can be combined with a SR-flipflop:

- one level-switch sets the flipflop,
- the other resets the flipflop
- the output of the flipflop switches the SSR or mosfet.

The flipflop is a standard 5V TTL IC. Inbetween flipflop and SSR/mosfet you might need a buffer, also standard TTL.

The lower switch is connected to ‘set’ via RC so the flipflop gets a ‘set’- pulse but after that the reset input is still usable. I don’t know how to describe this better in English 😉

SSR is more safe because the switches are the separated from mains. For mosfets there are small driver-IC’s which decouples the input from the mosfet.

Two mechanical relays parallel doesn’t look like a good idea to me 🙂

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 January 2024 14:36 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/25 "2024-01-06T14:36:15Z")

</div>

😅

 ![Screenshot 2024-01-06 at 14.35.04](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/58e5ae0f682fcc6195ecdd671242c7a007f1a3cc.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [6 January 2024 19:43 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/26 "2024-01-06T19:43:48Z")

</div>

Sorry Paul, I don't want to _nit pick_ but looking at that schematic.....

I saw someone pointed out a problem and I take it you fixed it, but......

I really think you got the NC and NO labels on the High and Low relays the wrong way around.

Because as I see it, as shown - I'm guessing with no water - the `Latch relay` would latch.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [6 January 2024 20:42 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/27 "2024-01-06T20:42:46Z")

</div>

> [@Trying\_to\_learn](#):
>
> I really think you got the NC and NO labels on the High and Low relays the wrong way around.

Yes, I noticed that later, and thought of a better solution.  
What I would do is reverse the float logic by using a resistor between +5v and the float, so that if the float contacts are open, the resistor ensures that the output is +5v.  
However, if the float contacts were closed, it would take the output to 0v.  
I would do it that way because, if the circuit was as it was previously, the 2 input relays would be energised all of the time, and only de-energised when the water level is high, which is not good practice (and a waste of energy).

![float](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4e0c8a2299e6c39c06b93279c9e0b56223a9013b.jpeg)

I've not amended the circuit (as I don't know if Bart is interested or not), but well spotted @Trying_to_learn 👍

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [8 January 2024 09:36 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/28 "2024-01-08T09:36:07Z")

</div>

Hi Bart, I don't know if you have finished your automatic pumping, but here is what I would have done:

 ![pump](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d0b4e46779094e3c9caaa1b0dc4ea16ab016db5.jpeg)

MANDATORY: a [power contactor](https://vi.aliexpress.com/item/1005003292288085.html?spm=a2g0o.detail.0.0.4963UL7aUL7ajw&gps-id=pcDetailTopMoreOtherSeller&scm=1007.40000.327270.0&scm_id=1007.40000.327270.0&scm-url=1007.40000.327270.0&pvid=46fe3f37-2a97-4b76-92ba-ff78b1921a7e&_t=gps-id:pcDetailTopMoreOtherSeller,scm-url:1007.40000.327270.0,pvid:46fe3f37-2a97-4b76-92ba-ff78b1921a7e,tpp_buckets:668%232846%238112%231997&pdp_npi=4%40dis%21EUR%2114.19%2113.06%21%21%2115.18%2113.97%21%402103010b17047020719713804e84ae%2112000025051712816%21rec%21FR%21177233591%21) 220V 32A 2NO to power your pump. Then you can use the Shelly with the floats connected to it, then do the flow you want.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [8 January 2024 14:21 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/29 "2024-01-08T14:21:29Z")

</div>

> [@SuperNinja](#):
>
> but here is what I would have done:

How is that intended to work with 2 floats??

I can't see what Shelly logic you could use to keep the pump running until the water level dropped below the bottom float?

Remember, the pump is not intended to start until the water level reaches the top float, and does not switch off again until it falls below the level of the bottom float.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 January 2024 14:25 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/30 "2024-01-08T14:25:54Z")

</div>

Paul you can separate the switch from the relay with shellies, so one can turn on and one turn off, using actions. Also with shelly 2 Gen you can use scripts.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [8 January 2024 15:00 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/31 "2024-01-08T15:00:48Z")

</div>

> [@E1cid](#):
>
> Paul you can separate the switch from the relay with shellies

Yes I'm aware of that, but not aware of any action that would fulfill Bart's goal.  
It would be good if he could explain what he has in mind  
Using MQTT to a pi, to perform the logic?

> [@E1cid](#):
>
> Also with shelly 2 Gen you can use scripts.

Haha, don't you have to pay Shelly for the script training course?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 January 2024 15:44 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/32 "2024-01-08T15:44:22Z")

</div>

I will attempt to make it clearer for you Paul. You can disengage the switches from the relay, at which point you can set button/switch actions to on's and off's. so when top float opens (or opposite), the action can be turn on relay, you do not have to set an off action. You can do the same for lower float switch to turn off relay. Hope that clears any confusion.

No you do not have to pay to use scripts and shelly offer many examples free, You can of course pay any company to learn any programming language, or you can educate yourself as many do. The shelly scripting language is based on Javascript i beleive.

Actions [Shelly Plus 1 Device Smart Control](https://kb.shelly.cloud/knowledge-base/shelly-plus-1-device-smart-control)

 ![chrome_screenshot_8 Jan 2024 15_55_50 GMT](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d7182e873c66ae1d461ab70c1f3092e58719229b.png)

Script examples [GitHub - ALLTERCO/shelly-script-examples: Shelly Scripts for Gen2 Shelly devices](https://github.com/ALLTERCO/shelly-script-examples)  
Scripting features [Shelly Script Language Features | Shelly Technical Documentation](https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures/)

Script library

 ![chrome_screenshot_8 Jan 2024 15_53_29 GMT](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/b/abf98ac978c054c8320cc7661935f12e3b93f568.png)

All accessible from local ip in browser

No other device or server is required.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [8 January 2024 17:35 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/33 "2024-01-08T17:35:18Z")

</div>

> [@E1cid](#):
>
> Hope that clears any confusion

Thanks @E1cid I never thought about it that way, it does seem quite a good solution.

All of my devices are 1st Gen, so haven't looked into scripting in any detail, although I seem to be getting endless shelly emails asking me to sign up for their scripting courses.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 January 2024 17:48 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/34 "2024-01-08T17:48:01Z")

</div>

> [@Paul-Reed](#):
>
> I seem to be getting endless shelly emails asking me to sign up for their scripting courses

Should of checked the no marketing box, I have never received any emails from Shelly. You sure they are from Shelly, whats the url?  
All I can find is [About us - Shelly Academy](https://shelly.academy/about) , do not look like they are part of Shelly/Allterco

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [8 January 2024 18:10 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/35 "2024-01-08T18:10:58Z")

</div>

> [@E1cid](#):
>
> You sure they are from Shelly, whats the url?

The courses are run by the 'Shelly Academy' through 'Shelly Uni', but payments for the courses are made by buying a voucher from [shelly.com](http://shelly.com)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 January 2024 18:36 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/36 "2024-01-08T18:36:07Z")

</div>

I see [https://www.shelly.com/en-gb/shelly-scripting-basics](https://www.shelly.com/en-gb/shelly-scripting-basics) not available as of now, tried to see pricing, for a laugh.

> For anyone with zero or basic programming skills

That's not for you Paul.

I suggest you login to your account and turn of marketing emails.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [8 January 2024 21:06 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/37 "2024-01-08T21:06:27Z")

</div>

Hey, let's all hope that @BartButenaers is ok.

We haven't heard/seen any posts since.

---

<div class="post-metadata">

**Author:** ![Don\_Kyhoty](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@Don\_Kyhoty](https://discourse.nodered.org/u/Don_Kyhoty)\
**Post date:** [10 January 2024 17:25 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/38 "2024-01-10T17:25:48Z")

</div>

Wouldn't be easier to purchase a simple sump pump with built in float switch?

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [11 January 2024 09:04 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/39 "2024-01-11T09:04:21Z")

</div>

As long as I see this update - I feel somewhat better

 ![IMG_1065](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee9674f21ef4b09fb4a8826af604a39daef2e07e.jpeg)

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [11 January 2024 09:10 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/40 "2024-01-11T09:10:40Z")

</div>

![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/80765fac6e0ffd52410b439757f199e689fd300a.gif "Belgium Belgium Meme GIF - Belgium Belgium Meme - Discover & Share GIFs")  
😈

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [20 January 2024 20:12 UTC](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221/41 "2024-01-20T20:12:38Z")

</div>

@BartButenaers verdict? 🙂

[Previous page](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221.md?page=1)

[Next page](https://discourse.nodered.org/t/urgent-electronic-problem-drive-pump-with-2-switches/84221.md?page=3)
