The connection of a proximity sensor to an electrical circuit is not limited to only one possibility. Instead of using a PLC to construct a working electrical circuit for a certain application, making use of a traditional wiring method is also a mutually exclusive choice which is another workable option when a PLC is not available.
Figure 1: Traditional Wiring Method of PNP Proximity Sensor Without Using PLC to Construct a Working Electrical Circuit
When the proximity sensor is activated, its internal PNP transistor is switched ON, thereby permitting the +24V supply voltage to flow from the emitter down to the collector of the transistor, this will complete the electrical path going to the relay's coil to energize the relay. When the relay is energized, its isolated contact points changes state, the normally-open contact switches from open to close which in this case will cause the external 220 AC voltage to provide power to the lamp even when the push button switch is not pushed ON.
Figure 2: Traditional Wiring Method of an NPN Proximity Sensor Without Using PLC to Construct a Working Electrical Circuit
Another circuit distinctly different from what was featured in this article is the nontraditional advanced method, which is an alternative modern approach outside the scope of this article discussed previously in my blog post How to connect a 3 wire DC solid state proximity sensor to a PLC.