# CNY70 from 5V to 3.3V

I have CNY70 connected this way:

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!

• What are you trying to do? That doesn't look like a reliable way to get 3.3V as an output.
– JRE
Aug 4 '20 at 15:12
• short pins 3 and 4 ... why do you believe that any resistor would cause the output to be 3.3 V? Aug 4 '20 at 15:18
• 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?
– JRE
Aug 4 '20 at 15:27
• Why do you believe you need to use an opto-isolator? I can play this game all day. Aug 4 '20 at 16:18
• Connect the opto collector to the MCU +3.3 volts rather than to +5V. Aug 4 '20 at 16:19

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