-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help with open collector encoder. #78
Comments
The more info you provide, the higher the chances you can get help. We do not know:
That said, a couple of 4K7 resistors from A and B to +5 (assuming that is the voltage of your microcontroller) won't hurt. |
Finally I found how to fix it. I was very very lucky that encoder can run at 5 volts which simplifies a lot solution. I've connected 0 and 5 volts to ESP32 Vin and GND. A and B as per sketch. Trick was to use build in pullup resistors. It means pinMode(encoder0PinA, INPUT_PULLUP ); Reason is because open collector only connect output to ground, when it's not connected it's floating and pull up to 5V changes floating to TTL level of 5 volts. |
You're welcome. If using external pull-ups with ESP, please remember to connect them to 3V3, not to 5V. |
Dear all.
I got things with small motor. Now i moved to 500w. Accidently I've dropped encoder. After that I position readings are unpredictable. Looks like encoders are very gentle devices. Now I found another with open collector. I cant make it work. Please advise. Tried to connect it to 5 volts. Looks like I can measure voltage across power plus and output. Nothing from gnd to A or B. Should I add some resistor? Type is omron e6b2-Cwz6C
The text was updated successfully, but these errors were encountered: