0
\$\begingroup\$

I am currently working on using a slottet optical switch like this OPB4xx one as a sensor for my project. The sensor going to send its output to my Arduino which then will process the data. According the to the data sheet it has 4 input wires and 1 output wire.

Here's a portion of the datasheet:

Screenshot of the datasheet showing part of the schematic and a pinout table

The wires being VCC, ground, output, anode and cathode.

VCC seems obvious it will probably go to the 5v pin on the Arduino,
ground goes to ground on the board. Output goes one the pins on the board.

But how should the anode and cathode be connected to the board?

\$\endgroup\$
  • \$\begingroup\$ Output needs to be pulled high, as it is open collector on the specced part. \$\endgroup\$ – Scott Seidman Oct 9 '16 at 0:47
  • \$\begingroup\$ how are you going to pull output high? \$\endgroup\$ – Carlton Banks Oct 9 '16 at 8:23
  • \$\begingroup\$ Search for "open collector" \$\endgroup\$ – Scott Seidman Oct 9 '16 at 12:11
  • \$\begingroup\$ I do understand the concept of the open collector. My question is should i just connect it with an pull up resistor to the 5 v vcc pin and and a analog pin on the pi... \$\endgroup\$ – Carlton Banks Oct 9 '16 at 14:01
  • \$\begingroup\$ Yes, but digital pin on the pi. It needs to be 5v tolerant, or use 3.3v \$\endgroup\$ – Scott Seidman Oct 9 '16 at 14:05
2
\$\begingroup\$

The anode and cathode are the terminals of the IR LED, which produces the IR light that the detector portion of the device detects.

The Electrical Characteristics table on page 4 of the datasheet gives the characteristics of the IR LED. The LED has a typical forward voltage of 1.7 volts, at 20 mA.

As with any other LED, the IR LED must be connected to a suitable power supply, with a series resistor to limit current. For a 5 volt power supply and 20 mA LED current, you require a resistor of about 165 Ohms - the value is not highly critical - 160 or 180 Ohms would be fine.

\$\endgroup\$
  • \$\begingroup\$ Soo.. anode should be connected to a resistor and then to one of the pins , and cathode should be grounded. ? \$\endgroup\$ – Carlton Banks Oct 9 '16 at 8:34
  • \$\begingroup\$ The resistor should probably be connected to +5 volts, or whatever your Vcc is. \$\endgroup\$ – Peter Bennett Oct 9 '16 at 15:51
1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. The transmitter is an infra-red LED. The receiver has some detection logic but the output is an NPN transistor with an optional internal pull-up resistor or "open collector" requiring a pull-up elsewhere on the circuit.

  • Current needs to be limited for the LED. VF is quoted at 1.7 V on the datasheet so there will be 5 - 1.7 = = 3.3 V across R1. Aim for 20 mA. You have enough information to work out the resistance value.
  • If you buy the open-collector output version then you can add a pull-up resistor or use the internal one in your micro (if it exists). You usually have to enable these in code.

VCC seems obvious it will probably go to the 5v pin on the Arduino, .ground goes to ground on the board. Output goes one the pins on the board.

Correct.

But how should the anode and cathode be connected to the board?

As shown in Figure 1. Resistor LED sequence doesn't matter but A should be towards the + supply.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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