OPB720A optical sensor output voltage level

Thread Starter

zazas321

Joined Nov 29, 2015
936
Hello. i am planning to use this sensor to detect human hand presence inside a box. I have picked this sensor because it has a good range ( up to 30cm is exactly what I need for detection). Since I will be powering this through 24v and reading the sensor output with Arduino, I cant really find any details in the datasheet about the output voltage levels. Is it going to be 0 - +24V ? What is the best way to read this sensor using arduino? Would I just use potential divider to reduce 24V output to 5V for the arduino?
 

Irving

Joined Jan 30, 2016
3,887
A link to data sheet would be useful

However, the clue is on page 1 where it shows the circuit diagram of the device having an open collector output. This means it's entirely up to you what the output voltage is, which normally would just mean providing a pull-up resistor to your microcontroller supply rail.

However, the second piece of info is on page 2 where it says what Voh the high level output is, in conjunction with note 5. it recommends a 10k pullup to 10v for the A series device, for which it guarantees a 5v output with a 90% reflectivity target. A hand is unlikely to be that reflective, so you may have to experiment with say a pull-up to 5v and seeing if that gives you sufficient high level to be recognised or you may need some signal conditioning, or use an analog input. It's a little ambiguous as the switching diagrams on the following pages suggest a 10v change.

I'd try a pull-up to 5v at the Arduino end, stick a multimeter on the output and see how it behaves.
 
Last edited:

DickCappels

Joined Aug 21, 2008
10,180
The sensor has an open collector output with a maximum collector voltage rating of 30 volts. It should be safe to connect a pull-up resistor from +24V to the output and use that signal.
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
The sensor has an open collector output with a maximum collector voltage rating of 30 volts. It should be safe to connect a pull-up resistor from +24V to the output and use that signal.
Okay that is still a little bit unclear to me. Would the output voltage level depend on the input? Lets say I use +12V supply voltage. Would my output signal would be 0 to +12V? .

If I use +24V supply my output would be 0 to +24V?
 

Irving

Joined Jan 30, 2016
3,887
You can use any convenient voltage, I but if you use 12 or 24 you must do some signal conditioning eg a voltage divider, before the Arduino. Try it with 5v, it may give you what you need
 

DickCappels

Joined Aug 21, 2008
10,180
The part about the Arduino got past me. The output of the sensor is a switch to ground. To make it compatible with an I/O line in your Arduino simply connect a 10k (value not criticle) from the sensor's output to Vcc on the Arduino. Also connect the sensor output to the I/O line. Make sure the sensor's ground is connected to the Arduino's ground.
 

Irving

Joined Jan 30, 2016
3,887
To extend my ( & Dick's) previous answers - you may not be familiar with the term 'open collector'. This means an output transistor whose collector pin is 'free' and unconnected.

When the transistor is turned on - ie nothing being detected - it allows current to flow from an external source and, as long as that current is not too large - the datasheet says 50mA - then the device presents a gauranteed low voltage of 0.8v.

When the transistor is fully off the collector pin is floating. It will rise to whatever voltage the external circuit dictates. If that external voltage is via a pullup resistor then it will very close to that external voltage. As long as its less than 30v the device doesn't care what voltage it is, you are free to choose whatever voltage you like. The first diagram shows using a pullup to 5v at the Arduino end of the wire. The second shows a pullup to +24v at the device end with some signal conditioning at the Arduino end. The latter might be preferable for noisy environments. Other solutions are possible, and additional protective diodes and filter capacitors could be added if need be on both options.

Both of these assume the transistor is fully off when an object is detected. That's the ambiguity in the datasheet. It implies that might not be the case, but gives no examples other than saying on a 10v supply the output will be at least 5v on 90% reflectivity, but it coud be as much as 10v, it simply isn't specified, nor is the value for say 50% reflectivity. Some experimentation needed to validate that device for your purpose.

1593772545444.png 1593772345873.png
 
Last edited:
Top