Questions tagged [rotary-encoder]

An electro-mechanical device for detecting angular position and/or motion.

103 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,155
  • 9
  • 31
  • 62
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
  • 12
  • 20
9
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
  • 233
  • 1
  • 2
  • 6
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…
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
  • 1
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
  • 3
  • 9
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…
2
votes
2 answers

Most precise way to measure linear distance travelled by a wheel

Suppose a bot with wheels is traveling in a a straight line, and we want to measure this linear distance traversed by it as accurately as possible. One of the ways is to use an optical encoder to measure the angle of rotation of the wheels and get…
2
votes
1 answer

Is it possible to get which pin generated interrupt?

I wrote some code that handles rotary encoder using an interrupt, but I would like to get which pin generated the interrupt, so I'll be able to handle many interrupts in a single method. Something like: void ISREncoders() { int pin =…
user67439
2
votes
0 answers

read with Arduino SSI encoder signal

I'm stuck in my project, I try to read an absolute encoders angular position with my Arduino. I used and cabled a differential line receiver and driver between Arduino and the encoder, like explained in the 2 following links: Figure 2.1 here Input…
ian
  • 21
  • 2
2
votes
1 answer

Unexplainable int behavior in encoder/LED project

I am trying to use a rotary encoder to cycle through the brightest versions of R, G & B. And it works! Red goes to blue just fine. Then G happens. For some reason, the int for green goes completely haywire. And it does this the same way on two…
laffan
  • 25
  • 3
1
2 3 4 5 6 7