How to detect a plug is connected to socket

contactormicrocontrollerpower supplysocket

I have a plug and socket. Before I turn on power supply from a contactor, I need to detect if the plug is connected to the socket via a microcontroller. Any ideas on how to do this ?

UPDATE: The Plug I am using is

Plug

The Socket i am using is

socket

All the four pins of both socket and plug are connected to neutral, ground and (120v) ac lines.

Best Answer

Assuming your power supply will have the microcontroller to control the power, there are several ways to do this:

  • Always have a small voltage and monitor the current. When there's current, there's something connected.

  • Have a couple extra pins with a resistor or a diode on it, and use those pins to electrically control the power supply (note: this doesn't even require a microcontroller)

  • Have a physical switch in the socket to detect if something is in it

As with literally everything engineering related, be creative. When there's something you want to detect, always ask yourself what its effects will be. Is there a physical state you can measure (with a switch, or a magnetic breaking switch)? Is there an electrical state you can measure (resistance, or an closed circuit)? Then see how you can detect those and use them.

EDIT after your update:

Put a switch on the plug and turn it on when you need it.

Related Topic