1
\$\begingroup\$

I have CNY70 connected this way:CNY70 schematics

And I need to determine the value of R2 for OUT to be from 0V to 3.3V. I don't know how to calculate it, please help.

EDIT: Input is the 5V and output goes to microcontroller similar to Arduino, but its inputs can't take Voltage higher than 3.3V. So I need to get the output to 0V - 3.3V. I am sorry for being misleading.

EDIT 2: It goes into one of the microcontroller's analog inputs. Not the power supply.

Thank You!

\$\endgroup\$
21
  • 1
    \$\begingroup\$ What are you trying to do? That doesn't look like a reliable way to get 3.3V as an output. \$\endgroup\$
    – JRE
    Aug 4 '20 at 15:12
  • 2
    \$\begingroup\$ short pins 3 and 4 ... why do you believe that any resistor would cause the output to be 3.3 V? \$\endgroup\$
    – jsotola
    Aug 4 '20 at 15:18
  • 1
    \$\begingroup\$ Again, what are you trying to do? Do you need 3.3V to power some other device? Do you need a 3.3V digital signal from a 5V digital signal? Do you need to convert an analog signal that varies between 0 and 5V to an analog signal that varies between 0 and 3.3V? What is your input, and where does the output go? \$\endgroup\$
    – JRE
    Aug 4 '20 at 15:27
  • 1
    \$\begingroup\$ Why do you believe you need to use an opto-isolator? I can play this game all day. \$\endgroup\$
    – Andy aka
    Aug 4 '20 at 16:18
  • 1
    \$\begingroup\$ Connect the opto collector to the MCU +3.3 volts rather than to +5V. \$\endgroup\$ Aug 4 '20 at 16:19
1
\$\begingroup\$

You cannot do it by modifying the value of R2.

You can add a series 510\$\Omega\$ resistor between the +5 and the reflective sensor collector.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ So the value of R2 will stay 1k? \$\endgroup\$
    – Wojtic
    Aug 4 '20 at 16:38
  • 1
    \$\begingroup\$ Yes, it must stay 1K. If you find the sensor is not sensitive enough, increase both resistors proportionally. Eg. 1.5K and 3K. \$\endgroup\$ Aug 4 '20 at 16:39
  • 1
    \$\begingroup\$ Thank you so much. This should solve my problem. \$\endgroup\$
    – Wojtic
    Aug 4 '20 at 16:40
  • 1
    \$\begingroup\$ @Wojtic You are welcome, and welcome to the site. By the way, it's good practice to link the datasheet for your parts such as the CNY70 which would have made it more clear what you are trying to do. \$\endgroup\$ Aug 4 '20 at 16:51

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.