Electronic – Wiring optical incremental encoder

avrencoderwiring

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?

Best Answer

Just connect Vcc and GND, you don't have to limit current on Vcc and GND. Ch.A and Ch.B are your outputs. The maximum supply current (26mA) in combination with maximum output current (25mA) implies that you do have to limit the output current. Notice that you have two outputs that can be active at the same time. In my opinion maximum output current per pin should be limited to 25mA / 2 = 12.5mA. I personally would advise to keep the output current a fair bit lower (factor 2..10) than the these maximum ratings.