Would love some help here, I know next to nothing about electronics.

I've been asked to fit a normally open (NO) capacitive sensor to a MOSFET to operate a relay.

My problem is it is working backwards to the way I need it to.

I have a 24V supply to the relay +ve, the mosfet source is connected to the relay -ve. Drain is connected to ground. Gate is connected to the sensor, and I have a resistor from the sensor/gate to ground.

When the sensor detects an object it goes to 24V, and the MOSFET is then closing the relay which is activating a pump. But I need the opposite result, when it detects an object it needs to open the relay and turn off the pump.

The task was to replace a NPN-NC sensor with a PNP-NO sensor. Knowing nothing about MOSFETs I read that this would require switching from an n-channel one to a p-channel one. I guess I didn't understand that p-channel MOSFETs can be enhancement or depletion. So I think I've got a MOSFET that does the same as the previous one did, hence the logic is now backwards from what I wanted as the sensor is switched.

Unfortunately I do not have time to find another MOSFET, order and test it. This has to be operational today. Is there anything I can do with what I have?

  • 2
    \$\begingroup\$ Our text-to-schematic converter is out of commission so please draw a schematic. Do realize that most relays have normally open and normally closed contacts, maybe you could just use the other contacts? \$\endgroup\$ Commented Oct 19, 2020 at 11:04
  • \$\begingroup\$ @Bimpelrekkie That would be ideal. I'm using an Omron g2rv-sr700, but I do not see anything in the datasheet about switching it from one mode to another. Am I unfortunately using a relay that cannot? \$\endgroup\$
    – Ed the Ted
    Commented Oct 19, 2020 at 12:52
  • \$\begingroup\$ @Bimpelrekkie Further from previous reply... Ok, so the relay has 3 outputs, presumably there is a common one always used, and using either common with the 2nd, or common with the 3rd, will result in either a closed action or an open one. So whichever way round I've got it now I just need to switch one of the outputs over to the unused 3rd one? Apologies, like I said I know nothing about electronics! \$\endgroup\$
    – Ed the Ted
    Commented Oct 19, 2020 at 12:59

1 Answer 1


Here's a way, without the mosfet.

enter image description here

The sensor, capable of switching 200 mA, can easily drive the relay's 12.6 mA coil.

The 'NC' contact of the relay is used to turn off the pump.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.