PNP with Other Inputs

Hi Guys,
Hopefully a very easy question and this probably shows I dabble more in the code than on the electrical engineering side.

Excuse the crude mockup in the picture using 12v Milwalkie battery

What I am trying to do is hook up a 12v PNP laser sensor in to my Arduino Mega 2560.
I have used a voltage divider and when the beam is broken the output is .5v and when not broken it is 1v which is fine.

My concern is with this being PNP. How do I hook this up to the Arduino.

The reference is positive voltage. Do I hook the +ve in to the GND on the Arduino and the signal in to an analogue input, or perhaps the reverse of this.

I am concerned given i have other devices using the GND from common PSU and its negative it will cause something to break and potentially let smoke out.

Thanks
Shane

Hopefully a very easy question

It would be if you could provide some information. All I see is a heap of wires and components on the floor which is not very informative.

It would be good if you:-

  1. Gave a link to the data sheet of the sensor.
  2. Posted a diagram of how you connect the sensor and potential divider up.
  3. Post a diagram of how you think you should wire this up, then we can check if it is correct.

I am concerned given i have other devices using the GND from common PSU and its negative it will cause something to break and potentially let smoke out.

On the face of it that sounds an unfounded fear, but then you might not have described your actual situation very well.

Hi,
Your data sheet should how you how to connect the sensor to a device.

Tom... :slight_smile:

That's an industry standard sensor.

PNP means that the output wire will be driven to VCC (supply voltage of the sensor)

To connect the output to the Arduino you will need a voltage divider.

Using a 15KΩ and a 10KΩ resistor you can scale the voltage to fit the Arduino.

Voltage divider for 12V to Arduino

// Per.

Like this:
PNP_sensor.png
Yours,
TonyWilk

PNP_sensor.png