How to reverse behavior of an open collector?

Thread Starter

bishop8000

Joined May 6, 2020
7
I have a 24vdc open collector proximity sensor that I'm trying to operate a relay with. When I connect the output of the sensor to the negative pole of the relay, the relay energizes when the sensor does NOT see an object in proximity, and the relay does not energize when the proximity sensor DOES see an object in proximity. The sensor appears to output ground when nothing is present and it outputs nothing when an object is present, which is the opposite of the desired behavior. The relay that I have to use does not have an open position pole, only a closed position pole. How can I reverse this behavior so that my relay will energize when the sensor DOES see an object? Thanks in advance.
 

Thread Starter

bishop8000

Joined May 6, 2020
7
Hi Dennis, Thanks. I don't really have any thoughts, and I'm a complete novice to this. I've done a bit of reading and I've experimented using a PNP transistor to make a not gate, but the outcome was that I could reverse the electrical polarity (positive output instead of negative going to the relay) but the net effect was the same. I'm open to any ideas or suggestions. Thanks again.
 

Thread Starter

bishop8000

Joined May 6, 2020
7
Use a NpN transistor to invert the output to feed your relay.
Hi Doggydave, thanks for the input. Can you give me any details on how exactly to wire that? Would the output of the sensor connect to the base of the NPN transistor? Ground on the collector side and +24VDC on the emitter side? Where would the output connect and what ohm resistors would I need and where would they be placed? I'm sorry it's not more intuitive to me, I'm solving problems as I go with little experience with this. Thanks,
 

Dodgydave

Joined Jun 22, 2012
11,284
Hi Doggydave, thanks for the input. Can you give me any details on how exactly to wire that? Would the output of the sensor connect to the base of the NPN transistor? Ground on the collector side and +24VDC on the emitter side? Where would the output connect and what ohm resistors would I need and where would they be placed? I'm sorry it's not more intuitive to me, I'm solving problems as I go with little experience with this. Thanks,
20200506_213442.jpg
 

Thread Starter

bishop8000

Joined May 6, 2020
7
Alright, when I wired it exactly as you drew it, the relay was energized 100% of the time. (I used a 2K resistor between +24 and sensor output.) Then I added a 1K resistor between the emitter and 0V, and it worked! Any reason why that would be? And is 1Kohms the correct value in that position?

The only remaining problem is that from a de-powered state, the relay will briefly energize when power returns until the sensor tells it not to (.5 seconds). Is there anything I can do to eliminate that? Thanks again.
 

Attachments

Last edited:

Bernard

Joined Aug 7, 2008
5,784
For a delayed operation could use a Schmitt NAND gate X 4 like 74HC132. one stage as inverter, parallel 3 stages with one input tied to ground thru 1 uF cap. & to +6V thru 1 M R. Other input to out of first stage. Upper limit of input is 3 to 4V which is almost 1RC time constant. Output should be about 15 mA , use 330 ohm output to base. Must run.
What is relay coil resistance or power ?
 

Thread Starter

bishop8000

Joined May 6, 2020
7
For a delayed operation could use a Schmitt NAND gate X 4 like 74HC132. one stage as inverter, parallel 3 stages with one input tied to ground thru 1 uF cap. & to +6V thru 1 M R. Other input to out of first stage. Upper limit of input is 3 to 4V which is almost 1RC time constant. Output should be about 15 mA , use 330 ohm output to base. Must run.
What is relay coil resistance or power ?
The operating coil draws 200mW, and its resistance is 2880 ohms.
 

Bernard

Joined Aug 7, 2008
5,784
You could drop last 2 NANDs & raise 330 ohm to 2k7 ohms or use one half of a LM393 comparator as in Delayed Relay Driver 2. R2 & R1 divide input V by 2, so - input is 24 V or 12V.
+ input can climb from 0 V to about 17 V in about 1 sec. A false lo input cannot change output for about a sec. but when + input is @ 17 V & - input is @ 12 V the output switches to open collector
& relay pulls in. Diode D1 is any thing from 1N4001 to 1N4007.Scan.jpg
 

vu2nan

Joined Sep 11, 2014
345
I have a 24vdc open collector proximity sensor that I'm trying to operate a relay with. When I connect the output of the sensor to the negative pole of the relay, the relay energizes when the sensor does NOT see an object in proximity, and the relay does not energize when the proximity sensor DOES see an object in proximity. The sensor appears to output ground when nothing is present and it outputs nothing when an object is present, which is the opposite of the desired behavior. The relay that I have to use does not have an open position pole, only a closed position pole. How can I reverse this behavior so that my relay will energize when the sensor DOES see an object? Thanks in advance.
Using the NC type sensor with the NC contact relay, will give you the function you require - relay contact closed when the target is sensed and open when it's not.

- Nandu
 
Last edited:
Top