FezHat and FezUtility

Can anyone provide me with a link showing how to actually wire NPN and PNP 5vdc sensors to these two hats? All sensors have 3 wires (+ brown) (- blue) and Signal (black).


Welcome to the forum. I am afraid your question is not clear. NPN and PNP are transistors and not sensors and they do not have color coded pins. Please provide links to the sensors you are trying to use.

These are the sensors:




I have never used these kind of sensors. Maybe somebody else has in this community who can help.

According to the specs These sensor require 10 to 30 VDC, not 5VDC
So you can not connect them directly to a FEZ HAT.

But what These sensors do (like all NPN and PN switching sensor) is:
The PNP Version Switches the Voltage from L+ to black wire when activated.
The NPN Version Switches the Ground Level from L- to the black wire wehen activated.

So when you are brave you can supply the sensor NPN on L+ and L- with an external power supply that provides a voltage between 10 and 30V.
Then connect the power supply ground (which is connected to L-) to a Gnd Pin of the FEZ HAT.
A as digital Input Configured GPIO is then connected to the black wire.
You should configure the Input with a Pull up.
When you read the Input in then you schould get the inverted Signal from the sensor.

But I would not recommand that.
You should get some opto coupler so the sensor is not directly connected to the FEZ HAT. if somehow the 10V (or more) gets to the Controller then it will be history.
Look at the attached Image how an correct schematic for an 24V Input can look like.

Edit: The schematics in the attached Image requires the PNP sensor, not the NPN sensor!


This is the reply I was looking for, thanks a lot!!!