# CNY70 from 3.3v instead of 5v?

I would like to use a CNY70 with arduino that is not 5v but 3.3v powered. On the web there most tutorials use 5v and 200 + 10k resistors (e.g. here and here). So as far as I understand for 3.3v I would have to use lower ones.

Can someone explain how those 200 or 10k were calculated? How could I use CNY70 with 3.3v (if it's possible at all) ?

• That 200R is current limiting resistor. For 5V power supply and 1.3V forward voltage drop on LED that means about 19mA through resistor: `If = (5V-1.3V)/200R = 18.5 mA`. With 3.3V power supply you'll get about 10mA with the same resistor.
– KIIV
Sep 10, 2019 at 7:39
• and what about 10k on the transistor ? Sep 10, 2019 at 7:54
• That's just a pull-up resistor. It's basically "pick one between 1K and 100K". So even internall pull up resistor on the input should be sufficient. It depends on wire length, its capacitance and so on. Longer lines means stronger pull ups. Well, technically it should match line impedance, so there will be no signal reflections, but it's valid on much higher frequencies.
– KIIV
Sep 10, 2019 at 8:01

## 1 Answer

The CNY70 is just an IR LED and IR Phototransistor. You can treat the IR LED (emitter) portion of it just like any LED and size the resistor appropriately.

The receiver is just a phototransistor which can operate at anything from about 1V up to 32V with no need to adjust anything. The resistor used there is merely a pullup resistor. You can think of the receiver as a button. When enough IR light falls on it it turns "on".

On an Arduino you could even get away without the pullup resistor and use an input in `INPUT_PULLUP` mode.

• I'm total noob, but with 200 resistor, the LED might not get enough current to power up from 3.3 so I should lower it? Or not? Sep 10, 2019 at 10:27
• The lower the resistor the brighter the LED will be and the more sensitive the sensor. The higher the resistor the dimmer the LED will be and the less sensitive the sensor. Most people erroneously size the resistor to the maximum current of the LED thinking that is good - however brightness is non-linear, and halving the current doesn't halve the brightness. You will get about 2/3 the current, but that's still more than enough to "power up" the LED. Sep 10, 2019 at 10:29
• Thanks! Must be something else wrong then, I'll double check my wiring Sep 10, 2019 at 11:31