0
\$\begingroup\$

I have at my disposal a photosensor (Optical encoder) with "C9017-80055", it has three cables: Black, Green, and yellow. I want to know the circuit (GND, VCC, output) to connect it with Raspberry pi, there is a problem if I connect it with raspberry pi without a resistor?.

Please find this related question about the same Photosensor Photosensor but I'm in trouble to understand.

Thank you.

enter image description here enter image description here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. The component contains an infrared LED and a phototransistor. The case outline is in grey.

We can see from your photos that the green wire is attached to a trace that goes to both sides of the opto device. This is almost certainly a common ground.

I want to know the circuit (GND, VCC, output) to connect it with Raspberry Pi, ...

We've got the green. Now you need to figure out the blue and yellow.

... there is a problem if I connect it with raspberry pi without a resistor?

There certainly is. If you do that to an LED you will have no current limit. Infrared diodes have a forward voltage of 1.4 V or so. To limit the current to 10 mA (a reasonable choice) you need $$ R = \frac {V_{CC} - V_f}I = \frac {3.3 - 1.4}{0.01} $$ which you can work out. That resistor will do to protect the transistor while you test it too.

Connect green to your Pi ground. Try connecting the yellow to the +3.3 V supply via the resistor. Then look into the slots using your phone camera to detect the infrared to see if either side lights. If it does then yellow is your LED. If not try powering up the black in the same way.

\$\endgroup\$
8
  • \$\begingroup\$ i have black green and yellow you mean i connecting the black to the +3.3 V or yellow ? \$\endgroup\$
    – ma9
    Commented Feb 5, 2021 at 21:59
  • \$\begingroup\$ Sorry I may have mixed up colours from the other question. Try one first then the other. \$\endgroup\$
    – Transistor
    Commented Feb 5, 2021 at 22:05
  • \$\begingroup\$ can you edited, please \$\endgroup\$
    – ma9
    Commented Feb 5, 2021 at 22:07
  • \$\begingroup\$ You can edit to fix it if you like. It doesn't change the method. \$\endgroup\$
    – Transistor
    Commented Feb 5, 2021 at 22:08
  • \$\begingroup\$ i connect the black to the +3.3 V yes ? \$\endgroup\$
    – ma9
    Commented Feb 5, 2021 at 22:09

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