I am a beginner with the Raspberry Pi and I want to use it to control DC motors to conduct some experiments. I have an incremental encoder with two channels A and B in quadrature and I want to connect those channels to the pins of the Raspberry to count the pulses and get the position of the motor to which the encoder is attached. I am powering the encoder with the 3.3V source of the Raspberry, so when I rotate the rotor of the motor the measured voltage between the channels of the encoder and GND switch between 0 and 3.3V. The hardware specifications of the encoder say that the max current flowing from any of the channels of the encoder is 5mA. My question is: can I connect DIRECTLY the encoder channels to two pins of the Raspberry Pi and read their digital value without damaging the board? What is the maximum current that the pins can get when configured as digital inputs? I do not want to damage the Pi.
I want to configure the pins as digital inputs using something like this (Python):
chA = GPIO.input( xx )
I have attached a diagram to help explain the situation. I hope I have explained clearly the doubt.Can this be achieved as I propose or is it wrong?
Thank you very much in advance
Adrian