Polarity switching - increasing the duration

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
Hi all,

Firstly, apologies if this is in the wrong category. I know a little about analogue electronics.. that's all!

I've got some taps/faucets at home which have sensors on them. When your hand gets close, a 5v pulse is sent to a solenoid which opens and water flows. When the hand moves away, a pulse is sent with the opposite polarity and the solenoid is closed. The water stops. Simple enough.

However, the sensors are ridiculously sensitive! If you move your hand 1mm out of range of the sensor, the water stops flowing. This means a constant switching on/off of the water flow solenoid and It's annoying!

I would really like some sort of countdown timer to intercept the 5v pulse.. it senses a hand, then counts down 5 seconds before switching off. If the hand is sensed again, the 5 second countdown resets and starts again.

I've looked at regular countdown timers like the FRM01 but because of the polarity change when it sends an open or close pulse, the FRM01 doesn't cope.

Has anyone got any ideas about how to do this?
 

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
Hi! Thanks for the reply. It's low voltage 5vdc. It has a step down transformer from the mains but can also be run from batteries.

I don't have any details on the solenoid. Only that it takes a 5v pulse one way which locks it open. Then a 5v pulse is sent the other way and it locks it closed.
 

crutschow

Joined Mar 14, 2008
38,320
Since you need a pulse in both directions, that makes a solution more complex.

Many questions:
  • How you know it's a 5V pulse?
  • Do you know, or can you measure its duration?
  • Is that 5V pulse going directly to the solenoid?
  • Can you measure the resistance of the solenoid?
 

Reloadron

Joined Jan 15, 2015
7,855
Less more information like what crutschow ask above this is pure speculation The On/Off of the solenoid is likely controlled by a form of H Bridge. That takes care of polarity reversal. While your hand is in range the solenoid is On and when out of range it's Off. Possibly the addition of what is called a One Shot multivibrator between the On pulse and shut off would have a set delay. When triggered by the On pulse when it was removed the output would remain high for a preset period. It's a retriggerable One Shot. These can be had already wired on a small module board very inexpensive.

The problem is if the existing control is all a small package on a single board it likely will not be easy to employ since presence creates an on pulse and a logic low shuts it off. There is a good possibility the control is all in one using a small pre programmed uC (micro-controller) chip. Making a work around difficult.

Pure Speculation on my part. :(

Ron
 

crutschow

Joined Mar 14, 2008
38,320
Further thought:
The simplest way may be that the added circuit will be triggered by the pulses from present module to generate its own bipolar pulse to the solenoid.
This probably will require that everything be powered from the mains, to avoid short battery life from the added circuit power draw.
 

Irving

Joined Jan 30, 2016
4,996
My take on this would be an ATTINY85 programmed to recognise the +ve input pulse and generate Open and Close drive to an H-bridge formed from 2 x irf7137 dual complementary MOSFETS. A trim pot would set the required 'ON' time. While idling and timing out the ATTINY85 would be in sleep mode so using only nano-watts of power over the original solution..

1646597698769.png
 
Last edited:

crutschow

Joined Mar 14, 2008
38,320
For the microphobic, here's my take on a discrete approach using one CD4093 quad, 2-input Schmitt-trigger NAND gate IC, 5 MOSFETs, a diode, and a few resistors and capacitors (LTspice simulation below).
It's more complex than a micro approach but, of course, requires no programming.

The ON pulse from the faucet sensor (red trace) goes directly to M2 which turns on M2 (and thus also M3) to generate a positive left (turn-on) current pulse in the solenoid (blue trace).

The OFF signal (green trace) goes to a triggered, one-shot delay circuit.
This pulse signal sets the output of latch U1a-U1b low, which starts discharging C1 through R7 to delay the turn-off pulse, as determined by the values of R7 & C1 (set for a little over 5 seconds here).
When C1's voltage (yellow trace) drops below the input threshold of U1d, its output goes high, turning on M1 (and thus M4) to generate a negative (turn-off) current through the solenoid..
Since M1's drain voltage is now low, C2 starts discharging through R6.
When C2's voltage drops below U1a's input threshold voltage it resets the U1a-U1b latch.
This rapidly recharges C1 through D1 to near +5V which causes U1d's output to go low, terminating the solenoid current pulse.
The solenoid pulse width is determined by R6 & C2 (set here for about 100ms).

M5 resets The OFF output delay pulse timing (yellow trace) by resetting latch U1a-U1b if there is another ON input pulse due to hand movement, (shown by the second ON input pulse), so the faucet always stays on for at least 5 seconds after the last Off input pulse.
This does generate an extra ON solenoid pulse when the solenoid is already on, but I don't see that as a problem
Those additional pulses could be suppressed, but would require extra circuitry.

Spike suppression for the solenoid inductance is supplied by the bridge MOSFET's internal substrate diodes.

The bridge N-MOSFETs M1 & M2, and P-MOSFETs M3 & M4, can be just about any logic-level types [Vgs(th) <2V max.], since the solenoid current is low.
If you like, you can use the same N-MOSFET for M5 as you use for M1 and M2.

Note that the quiescent current of the circuit is negligible, being just the leakage current of the MOSFETs and the CMOS gates, so could be operated from a battery if desired, with no noticeable reduction in battery life.

1646765914993.png
 
Last edited:

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
Further thought:
The simplest way may be that the added circuit will be triggered by the pulses from present module to generate its own bipolar pulse to the solenoid.
This probably will require that everything be powered from the mains, to avoid short battery life from the added circuit power draw.

This is exactly what I need! I want to use the 2 wires coming from the existing circuit to the solenoid. So in my mind:

1. Hand triggers solenoid OPEN pulse (note, this is definitely a pulse which opens the solenoid NOT a constant holding the solenoid open). The pulse goes to a separate circuit which then sends a pulse to the solenoid to open.
2. Hand moves away, pulse is sent to close solenoid. However, the pulse is received by the separate circuit and the countdown begins. No CLOSE pulse is sent to the solenoid yet.
3. The separate circuit now sends a solenoid CLOSE pulse when time expires.

How do I do this please :)
 

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
You chaps have come out with some pretty fantastic suggestions! I'm very poor with my electronics though :( I'm happy to try any of the suggestions but might need some help!

The microphobic suggestion by @crutschow might be one I can follow. If I buy the...:

CD4093 quad
2-input Schmitt-trigger NAND gate IC
5 MOSFETs
Diode
Resistors
Capacitors

......would you be able to help advise me how to assemble this into a circuit please?

What MOSFETS, diodes, resistors and caps would you suggest? I'll get purchasing!
 

Irving

Joined Jan 30, 2016
4,996
Where in the world are you? While there are good global suppliers, location can have an impact on component availability & choice...

Also what experience do you have of electronic assembly, how are your soldering skills?
 

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
I'm in the UK, in the East of England. Have access to RS Components, Maplins and a few others. My soldering skills are decent enough to work with the DIY SMT type projects.
 

Irving

Joined Jan 30, 2016
4,996
Ok, not so far away from me so all those parts readily available online from RS, Farnell and Cricklewood Electronics, my usual go-to outlets. Not used Maplins since they closed the local shop a few years back...

Unless you plan to make a PCB (so quick n easy these days) best stick to through-hole parts & prototyping board.
 

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
Great, got it, thanks! I see the circuit diagram provided in @crutschow post so I can see a lot of the resistor and cap values there. However, I can't see the MOSFETS, and Diodes? Unsure what versions of those I need to start off with. Is the MOSFET the IRF7207, IRF7811?
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,044
Do we know more about the pulses on the two solenoid wires? Keeping in mind that this is a commercial product produced in volume, It might not be what it seems.

A) The solenoid is driven by an H-bridge in the original circuit box. Both solenoid wires sit continuously near either Vcc or GND. One of them pulses to the opposite polarity to turn on, and the other pulses to turn off. This is what Wally is replicating in post #9. If this is correct, then we need to know the resting voltage on the two wires with respect too the circuit GND inside the control module.

B) None of that is true. The control module has a half-bridge output and a large coupling capacitor. Seat-of-the-pants - 4,700 uF. - 10,000 uF. One of the two output transistors is saturated at all times, but there is no output current so this does not shorten battery life.

Even if the original control module is A, the pulse extender circuit could be B. Can we get photos of the control module innards?

ak
 
Last edited:

crutschow

Joined Mar 14, 2008
38,320
I don't think we need to have a latch. The solenoid is the latch, and it latches on just fine.
Look more carefully at the circuit.
The latch is not for the solenoid.
It is part of the triggered off-delay one-shot circuit (latches upon input of the off pulse).
 
Last edited:

Thread Starter

skylinedgtr

Joined Nov 7, 2016
21
Hi again,

Really eager to get this assembled. Can someone guide me through it please? I'd really appreciate it! I'll buy:

Prototyping board
CD4093 quad
2-input Schmitt-trigger NAND gate IC
5 MOSFETs (which ones?)
Diode (which one?)
Resistors (which ones?)
Capacitors (which ones?)

Help! :)
 

crutschow

Joined Mar 14, 2008
38,320
5 MOSFETs (which ones?)
The 4 in the bridge can be any with at least a 20V rating, on-resistance of <100mΩ, and a max Vgs(th) of <2V, and through-hole mounting.
M5 can be the same as the bridge units, or a small 2N7000.
Diode (which one?)
1N4148
Resistors (which ones?)
Any 1/8W or 1/4W units with wire leads.
Capacitors (which ones?)
Any with a voltage rating of ≥8V and wire leads.
 
Top