Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

Automation, sensing and robotics • Re: Wiring multiple photoelectric sensors to RPI 4

$
0
0
Ok then it is exactly what you specify on the first post.

My problem is that the output of the sensor is suppose to be a NPN transistor because the PNP will be PM-U25P.

This mean that the sensor only pull the signal to gnd. it can't have any voltage on the output unless you add a pull-up resistor.
opto_npn.jpg

Collector on transistor only put the signal low.
So to get voltage on the output obviously you need to have something that put the line high.

According to PM-U25 part there is no resistor added to the circuit so the only thing is the transistor output which pull low or let the output open.

Normally I use 4k7 pull up resistor to get the correct response on open collector. That resistor is connected to 3.3V for a raspberry Pi.

So how do you get a voltage on the sensor if you didn't put any resistor and it is not connected to anything except is connected to the voltmeter?

Could you fill the table I asked you to do. I just don't want you to burn your Pi with an invalid assumption. Something don't make sense.

In theory the output doesn't need a resistor divider but just a 3.3V pull-up, something around 4k7 to 47K.
Here are the results:

1) No resistor in circuit (RPI + Voltmeter + sensor): 0V when sensor detects nothing (no hit), 4.87V when sensor detects an object (hit).

2) 4k7 resistor over 5V and light ON (as shown in your diagram on Mar.14): 4.84V when sensor detects nothing (no hit), 5.15V when sensor detects object (hit).

3) 4k7 resistor over ground and light ON: 0V when sensor detects nothing (no hit), 4.87V when sensor detects an object (hit).

Statistics: Posted by dij0nmustard — Mon Mar 18, 2024 7:41 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles