I purchased a PNP sensor in error. I should have purchased an NPN version.

I'm stuck with this thing now and I'm trying to get it to work. All the guides online show circuitry from NPN sensor. I do however have multiple NPN transistor 2N2222A if that will help.

Can somebody draw up a quick diagram on how to do this correctly for my case?

Additional information:

Thomas' Auto Bed Tramming guide on how to wire it , I'm left with the ground wire that is to be used as the Z signal...i guess.. here is a pic that i got from instructibles that matches my setup: http://i.imgur.com/cxJdbYO.jpg

I've noticed that even though i followed the wiring guide for an NPN inductive sensor, the light from the inductive sensor does turn on when it's near the aluminium heated bed, and turn off when it is away from the aluminium heated bed.

However the wire i'm left with to use as a signal to the RAMPS 1.4 board from my inductive sensor appears to be a negative terminal. As I undertstand it, I need to send a positive signal, and I'm not sure how to invert a negative/ground signal to positive.


closed as unclear what you're asking by Olin Lathrop, Leon Heller, Andy aka, Daniel Grillo, PeterJ Sep 2 '16 at 12:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ You mention all these parts but don't clearly describe what you are trying to accomplish. In fact I thought it was something to do with automobiles at first. I was able to discover that this actually relates to 3D printing, but without any links to/coherent descriptions of the guides you are trying to follow, it will be anyone's guess how to help you. If you want to substitute a PNP part for an NPN in an existing circuit design, you'll need to show the circuit to get advice on how to modify it. By the way, "tramming" is an exceedingly uncommon word in English. \$\endgroup\$ – Oleksandr R. Sep 2 '16 at 11:07
  • \$\begingroup\$ Huh? What is "bed tramming"? Closing as unclear. \$\endgroup\$ – Olin Lathrop Sep 2 '16 at 11:13
  • \$\begingroup\$ Just go and buy the right transistor dude. \$\endgroup\$ – Andy aka Sep 2 '16 at 11:53
  • 1
    \$\begingroup\$ For the uninitiated, 'PNP' and 'NPN' are shortcut terms used to describe the output type (source or sink) of sensors such as proximity sensors. 'Tramming' is certainly in my working vocabulary (with regard to milling machines), but I think you are using it wrong- it's not the squareness of the head you are adjusting but the squareness of the bed to the gantry. This process is usually called "leveling the bed". \$\endgroup\$ – Spehro Pefhany Sep 2 '16 at 12:21

Your question is quite garbled but if I understand correctly what you are asking is:

How can I adapt a 24 V, PNP proximity switch for an NPN machine input.


simulate this circuit – Schematic created using CircuitLab

Figure 1. Adding R1 and a small signal NPN transistor should do the trick.

If your machine input requires a "pull-to-ground" to activate it then the NPN transistor configuration of Figure 1 will do the trick.

  • \$\begingroup\$ Looks good to me. Maybe add a 10K base-emitter resistor so leakage isn't amplified. \$\endgroup\$ – Spehro Pefhany Sep 2 '16 at 12:22
  • 1
    \$\begingroup\$ I was wondering whether to or not. You tipped me over the edge. Component count up by 50%. Thanks. \$\endgroup\$ – Transistor Sep 2 '16 at 12:27
  • \$\begingroup\$ @PrinterGuy: Thanks for accepting the answer but I'd rather you wait until you confirm it's working. You may get other better answers in the meantime - although unlikely. ;^) You can unaccept and reaccept the best answer in a day or two. \$\endgroup\$ – Transistor Sep 2 '16 at 13:50
  • \$\begingroup\$ Hey @Transistor. It works!!!!!! Finished testing it and happy with the results. Thanks :D \$\endgroup\$ – printer guy Sep 3 '16 at 2:37

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