# Wiring optical incremental encoder

I'm trying to connect an optical encoder (Bourns EN series) to AVR microcontroller, and a few things are not clear for me from the datasheet.

At first, datasheet says that the maximum supply current is 26mA, but do I have to limit current (i.e. by putting resistor on VCC) or this means it just drains not more than 26mA and can be directly connected to +5V?

And a second question: do I need to put any pull-up resistors on Channels A/B, or I can just connect them directly to AVR pins?

• It is good practice when experimenting to limit the current with a series resistor $\dfrac{5\text{V}}{10\text{mA}} = 470\Omega$ (rounded to the nearest E12 value) or more, to protect both AVR outputs and encoder outputs for overcurrent. For example when you accidentally configure the AVR pins as output. – jippie Apr 21 '13 at 9:11