Wiring and understanding a circuit diagramm

Hello dear community,

for a project I want to use this: https://www3.panasonic.biz/ac/na/fasys/sensor/micro/pm-45/index.jsp

Here is how the wiring is supposed to be: https://www3.panasonic.biz/ac/na/fasys/sensor/micro/pm-45/circuit/index.jsp

  • I am really a beginner in electronics but I want to understand what is going on.
    I get that brown belongs to 5V and blue to GND.
    What the other two do and why there needs to be a load I just dont understand. In Youtube videos some people seem to use normal resistors concerning similar sensors...

  • Secondly how and which wire should be connected to an analogPin to get the reading into the Arduino?

Thank you in advance

The 'load' is just a component or device that can (or will) be powered by your circuit.

The supply voltage level for this device is chosen by the user, and that voltage needs to be within the range of 5V up to a maximum of 24V DC.

Whatever supply voltage that you choose ...... eg. 5V supply voltage ..... the data sheet is saying that the electrical current that goes through the load .... which also travels through the collector to emitter pathway .... must not be allowed to be higher than 50 milli-Amp.

For arduino to be used .... eg. UNO or MEGA, you might consider using a 5V supply, because these arduino's (eg UNO or MEGA) work nicely with 5V levels. You will then be able to use the DIGITAL input pins of the arduino to detect the voltage level of the sensor outputs (eg. sensor output 1 or sensor output 2). In this case, the arduino voltage level detection circuitry is going to be the 'LOAD'. And you won't be exceeding that limit of current of 50 mA, so that should be fine.

And if you are going to use 'digitalRead', you could also look into using the 'pullup' mode, which implements an internal pullup resistor. Look up 'pullup resistor' in arduino tutorials.

I think you might need some basic information on this type of circuit.

Look at the first circuit labeled "NPN" in you 2nd link.

The two transistors TR1 and TR2 can be thought of as simple switches.

If you remove the load and measure the output of the switch with a voltmeter** you could see two conditions:

  1. the switch is closed and the voltmeter will read zero
  2. the switch is open and the voltmeter will still read zero because there is no connection on the voltmeter.

The purpose of the "load" (which can be a simple resistor) is when the switch is open, the voltmeter will read the voltage value on the brown wire.

The negative or black lead from you voltmeter will be on the blue wire for all measurements.

Hope this helps.

And you won't be exceeding that limit of current of 50 mA, so that should be fine.

The current from an Arduino pin where damage starts to be done is 40mA.

Grumpy_Mike:
The current from an Arduino pin where damage starts to be done is 40mA.

That's a really good point.

For a 5V DC supply for that sensor device. That should keep the digital pin input current well below 40 mA, and the voltage range stays in the UNO/mega operating rate for digital input levels.

I'll be remembering this 40 mA value. Had forgotten about that --- good refresher.

Wow, this community is awesome. Thank you so much for the effort.

So did I understand it correctly that the black and white cable are to put into different digital Pins so that I will be able to read the value? :slight_smile:
Is there any need for resistors?

So did I understand it correctly that the black and white cable are to put into different digital Pins so that I will be able to read the value?

Yes

Is there any need for resistors?

Yes use 1K resistors where it says load, and connect the hot end ( that is the end of the resistor not connected to ground ) to wire into your Arduino pins.

Ok, I tried various Resistors and it works:)
I got now that I only need one wire to get the signal (black or white). So is there any reason that a sensor like this has two wires for this since you one only needs one or is it just to invert the logic (which kinda seems unnecessary to me)?
Or is it so you can get double sure that it works correctly: if(black is high and white is low){do this and that}?

So is there any reason that a sensor like this has two wires for this

It has two sensors in slightly different positions so you can detect what direction a spinning disk with a slot is moving in. Or what direction the sensor is moving in when an interrupt of the light happens.

If you just want an on / off opto slot then this component is way over specified, and way too expensive for what you want.

Marsmann:
So is there any reason that a sensor like this has two wires for this since you one only needs one or is it just to invert the logic (which kinda seems unnecessary to me)?

If you skim through the document that you provided the link for...... it says in a table..... something like 'light on' for one of the outputs...... and 'dark on' for the other output. So your assumption is likely correct. That is.... if output 1 is 'on' or 'high' voltage ... then output 2 will be a low voltage. Maybe they just offer this feature for convenience.