Hi Folks,
I have a valve with two OP821Z photo sensors that are wired in series to 12v. They detect open and closed. They need to be connected to a PLC input. Normally this device has a very expensive controller, and I need to connect them without it. I had been using a similar setup with two PC817 optocouplers instead of relays, but had issues with it being unreliable. This new circuit works, but the problem is that the output is inverted. When the sensors are not blocked, the relays are on. I need the relays on only when the sensors are blocked. I have tried using another transistor to invert this in more than one place, but just cannot get the thing to work. The problem is the minimal current/voltage from the phototransistor, and that I cannot change its configuraton at all. This all has to fit in a very small space as well… I don’t even have room for a DIP to use as an inverter, but am considering SMD dual inverter IC. Would prefer to use all transistors… I'm 35+ years out of electronics school and finding myself rusty as heck as I have not really been designing circuits like this for a living. Any advice to invert the thing without making any changes to the way the two sensors are wired together in the dotted line box would be helpful and much appreciated. They are inside of the valve and I cannot change that.

I have a valve with two OP821Z photo sensors that are wired in series to 12v. They detect open and closed. They need to be connected to a PLC input. Normally this device has a very expensive controller, and I need to connect them without it. I had been using a similar setup with two PC817 optocouplers instead of relays, but had issues with it being unreliable. This new circuit works, but the problem is that the output is inverted. When the sensors are not blocked, the relays are on. I need the relays on only when the sensors are blocked. I have tried using another transistor to invert this in more than one place, but just cannot get the thing to work. The problem is the minimal current/voltage from the phototransistor, and that I cannot change its configuraton at all. This all has to fit in a very small space as well… I don’t even have room for a DIP to use as an inverter, but am considering SMD dual inverter IC. Would prefer to use all transistors… I'm 35+ years out of electronics school and finding myself rusty as heck as I have not really been designing circuits like this for a living. Any advice to invert the thing without making any changes to the way the two sensors are wired together in the dotted line box would be helpful and much appreciated. They are inside of the valve and I cannot change that.

Attachments
-
357.1 KB Views: 7