An electro-mechanical device for detecting angular position and/or motion.
Questions tagged [rotary-encoder]
109 questions
16
votes
2 answers
How precise can I get Arduino using rotary encoders?
Stepper motors are often pricey for a large motor. However, with a powerful, standard DC motor and a rotary encoder, you can "simulate" a stepper motor. How accurate are rotary encoders with Arduino just with a basic loop and not much other code? Is…
Anonymous Penguin
- 6,365
- 10
- 34
- 62
10
votes
1 answer
Reading several rotary encoders
Have an upcoming project where user input will be based on spinning a large cog and I have several UNOs available
Since rotary encoders need two pins, only a Mega would be able to handle the 7-8 encoders needed. Unless theres a better method of…
Andrew Lazarus
- 243
- 1
- 2
- 7
10
votes
1 answer
How to design and debug a custom I2C master-slave system?
How to proceed, when in need of a custom I2C master-slave system?
What are the design criteria to apply?
What are the debugging tools one can use to troubleshoot problems?
Igor Stoppa
- 2,125
- 1
- 15
- 20
4
votes
0 answers
Rotary Encoder with interrupts - erratic behaviour
I'm trying to change my working rotary encoder code (stolen from here) to an interrupt-based code on my Mega2560. The trouble is that the result behaves very erratically, even though the physical setup is exactly the same as the working code. The…
Malibu
- 41
- 2
4
votes
3 answers
Rotary encoder on Uno and interrupts issue
This question is regarding a project using an Arduino Uno.
I have one of these quadrature rotary encoders.
I'm using a slightly modified version of the code from the article, Quadrature Encoder too Fast for Arduino (with Solution), which uses a…
pat333
- 41
- 3
3
votes
2 answers
How to detect the direction of a rotary encoder?
I'm trying to detect the direction of rotation for an incremental rotary encoder. I'm supposed to get +1 for clockwise and -1 for counter-clockwise. However, I receive random values. Any help appreciated.
Following is the code.
const int…
zalt
- 93
- 1
- 2
- 15
3
votes
0 answers
Encoder + Bounce2 Library
I am working towards debouncing my keyes rotary encoder using the Bounce2 library found here ( https://github.com/thomasfredericks/Bounce2 ).
I believe the problem lies in my code as there isn't much in terms of a circuit. The encoder is connected…
kevinconnectable
- 31
- 1
- 2
3
votes
1 answer
Read/write data from 2 Arduinos simultaneously with Python
So for my project I have one Arduino Mega hooked up with a quadrature rotary encoder which is connected to the computer. An Arduino Uno is connected to a circuit I built, which in turn is connected to a valve and a touch connector (also connected to…
Max
- 31
- 2
3
votes
2 answers
How to control cold to hot (blue to red gradient) RBG LED strip/bulb with a rotary encoder?
I'm doing a project for university and I am struggling to code and set up a rotary encoder that can control hot-cold variations. Much like the idea of communicating temperature selected by turning a dial. I would either like to control a single…
Kate
- 31
- 2
3
votes
1 answer
Interfacing pc mouse (serial port DB-9)
So I`ve got that mouse with serial connector. It is named serial so it should be easier to connect than even a ps2 mouse, right?
I can`t find any instruction on it. Or should I see instruction on ps2 mouse and plug in the same wires?
Btw mouse has…
TheKitMurkit
- 133
- 1
- 3
3
votes
2 answers
Reading from a KY-040 rotary encoder with Digispark
I have a rotary encoder KY-040 connected to a Digispark like this:
CLK go to p0 and and DT go to p2, SW is disconnected for now (it's just a button).
I did everything like the instructions here:…
shinzou
- 155
- 1
- 3
- 9
3
votes
2 answers
Turning a DC motor a set number of Rotations using an encoder
I'm using an arduino UNO, and i want to turn a motor a set number of revolutions, i'm trying to read the clicks of the encoder which has a resolution of 360 clicks/ revolution, my logic is that i count the number of clicks until i get to the desired…
Apastrix
- 33
- 1
- 4
2
votes
2 answers
Encoder giving value between steps
I'm trying to interface an encoder and a 1602 i2c display. My encoder seems to be giving an output between steps.
I have tried to make my code as simple as possible and am outputting whether the encoder rotated clockwise or counter clockwise to…
John Engelman
- 23
- 3
2
votes
0 answers
What wrong with my Arduino code?
I have a rotary encoder (ppr = 600) and I want to write code to achieve the implementation to read current angle and direction.
Here is my code. I think it is correct but it donot have any output on the serial monitor.
#include
// Rotary…
Jie
- 29
- 2
2
votes
1 answer
Change Interrupts on the ATTiny 88
I am working on a project that requires a number of I/O pins for various purposes. I chose the ATTiny88 because it has plenty of GPIO pins, and is relatively inexpensive.
Here is the updated code per timemage, with many thanks!
#include…
Leslie Rhorer
- 71
- 6