Questions tagged [rotary-encoder]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
2k views

Incremental encoder code

can somebody tell me what`s wrong with my code, i am using it to calculate rpm using incremental encoder long counter=0; long rpm = 0, z =0; long ini_time = 0; long end_time=0; void setup(){ ...
0
votes
1answer
57 views

How to put together an HKT30 optical rotary encoder?

I'm working on a project involving stepper motors. It is important for this project to track the position of these motors, so I decided to buy an optical rotary encoder, specifically an HKT30(HKT3005-...
0
votes
1answer
48 views

Setup Due counter

How do I setup a Due to count rising edges on a pin automatically without having to waste time on an ISR? I have some wheel encoders, the simplist implementation is direction less where you only count ...
0
votes
1answer
324 views

Flashing a specified digit 4x7 segment display and shift register 74HC595N

I have a project that is simply a relay timer. The code is not complete so you will see 'in progress' sections not related to my question in my code. However, my question is... I am creating a timer ...
0
votes
1answer
50 views

Multi turn potentiometer are a pain should I use a incremental encoder instead?

I built a robotic arm, the problem is I want to rotate the base more than once in order to complete a job, so I figured out I could use multi turn potentiometer. The problem I am facing is the ...
3
votes
1answer
2k views

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 ...
0
votes
1answer
46 views

Arduino DUE wheel encoder

I have an Arduino due, I am trying to keep track of ticks on two wheel encoders, polling in an infinite loop results in terrible performance. Have any suggestions? It looks like the due might have an ...
0
votes
1answer
27 views

Unable to get readings for "Motor with Encoder"

I've posted to the DFRobot forum, who makes the FIT0186 motors, but no one seems to be replying there. So, excuse the copy pasting. It's probably an issue with the motor/encoder, but perhaps it has ...
0
votes
2answers
417 views

Undocumented industrial servo with 8-wire encoder: how to read this encoder?

I have scavenged an industrial servo with its attached ballscrew linear actuator from an old large format scanner, and I am trying to figure out how to make a 'servo drive' aka 'servo driver' aka '...
0
votes
1answer
50 views

Artefacts on display when adding seemingly unrelated code

I have this simple program, where I am implementing a menu structure on an OLED display and a rotary encoder. The code works functionally as intended, however when I add more menu items, then I get ...
1
vote
0answers
25 views

Click counter using SparkFun Qwiic Twist

I wrote the script below in order to count the number of times that I press the SparkFun Qwiic Twist. But when I press the button, I get series of running numbers on the Serial Monitor and not a ...
0
votes
2answers
33 views

unexpected behaviour of encoder with increasing rpm

I am using a DC motor with encoder, and I am trying to calculate how many pulses are recorded in every one second interval. (note that the power source is of 12V for the motor) Circuit and code: int ...
-1
votes
2answers
43 views

Basic doubt regarding encoders with Arduino

I created a program that measures the pulses set out by the encoder (part of the dc motor with encoder inbuilt), and uses the ppr value (pulses per rotation) to calculate the rotations per minute (rpm)...
2
votes
1answer
3k views

Reading Two Quadrature Encoder using a single Arduino Due

I am working on an autonomous robot in my summer vacations. I am currently working on running the motors of my robot in a closed loop. In order to do so, I have to interface two Quadrature encoders of ...
1
vote
0answers
101 views

I'm making a trim wheel using a rotary encoder for flight simulation. Should I have the Joystick library use button presses or make it an axis?

Title says the majority of it. I'm looking to make a trim wheel for flight sim using a rotary encoder, the Joystick library and an Arduino Leonardo. I wasn't sure if it would be better to make it a ...
1
vote
1answer
44 views

BLDC geared motor with encoder - How to wire the encoder? (6 wires)

I am quite a newbie to arduino and currently stuck with an encoder. I have a BLDC geared motor with encoder, all I want to do is to get values from the encoder. There are 6 wires, out A, out B, out Z, ...
-1
votes
1answer
61 views

Using a Encoder Feedback to control a 360 degree servo

I pieced together a sketch to control a servo that turns an encoder. Eventually I plan to build this up to a DMX input, so I have the input range from 0 - 255. Basically, it's supposed to ask you to ...
2
votes
2answers
348 views

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 ...
1
vote
1answer
60 views

How do I control a conveyor to start and stop in same location using optical rotary encoder

I am a complete novice at arduino. I just want to know if this is possible before I start investing in components. I need to start and stop a chain drive conveyor {can't slip} powered by a 12 volt ...
1
vote
1answer
4k views

Interfacing with an SSI sensor?

I'm trying to interface with version RM08S of this rotary encoder using an Arduino Mega. The sensor supports a "Synchro serial interface (SSI), single ended" interface. I'm unfamiliar with this ...
1
vote
0answers
156 views

TFT menu system sometimes doesn't refresh the screen properly

I have a project in which I control a display using an Arduino Due microcontroller. The user can navigate on the TFT display (RA8875 driver ic) with a rotary enconder/pushbutton. The display shows a ...
1
vote
2answers
346 views

Read encoder output by using an optocoupler

I have a 512 pulses encoder with four wires: +5V, ChannelA, ChannelB, GND and I'm using it as feedback for my motor position (max 80 RPM) on Arduino UNO. Everything works fine, but I need also to ...
2
votes
5answers
14k views

Using rotary encoders with pin change interrupts

I'm using an Arduino Uno and two (3-pin) rotary encoders for a project. Since the loop takes a bit long and accuracy is important, I'd like to use interrupts to read the values from the rotary ...
2
votes
1answer
719 views

Problem in reading data from encoder with arduino

Hello guys I am trying to count the number of the steps of a stepper motor with an encoder (Avago heds). I found an Arduino sketch to count that steps and display them on the console and I found ...
1
vote
1answer
50 views

Saving a value with a click

I have a rotary encoder and 2 buttons to a. Store the encoder value b. Reset the encoder value to 0. The reset buttons work fine the issue is with the set/store button. Where the value changes without ...
1
vote
0answers
61 views

Help with code not working

I built a button box, everything is wired up and all of the push buttons work using the code below, but for some reason my rotary encoders are not working, well 3 out of the 4 are not working. Is ...
0
votes
0answers
105 views

Different Counter Reading on Serial Monitor Vs .96" OLED I2C

I've cobbled some code together from reading multiple sources on the web. Makeatronics in particular to help me get this rotary encoder code together (shout out to them). I'm pretty close to the end,...
2
votes
1answer
90 views

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 ...
1
vote
1answer
2k views

How to configure 2nd Quadrature Decoder IO pins in Arduino IDE

I am working to read two quadrature encoders using a single Arduino DUE, as part of my summer vacations project. According to the following link http://atmel.force.com/support/servlet/fileField?id=...
0
votes
2answers
374 views

Problem with interrupts and 4x encoders on Nano 33 BLE

I have a Pololu 4x encoder and am trying to write some code to make it work on my Nano 33 BLE. (Interestingly enough, the issue preventing some pre-existing libraries from working for me is the same ...
1
vote
0answers
40 views

Regarding Geared motor encoders

I wrote a simple code to count the number of pulses when the motor runs. The code just counts the number of interrupts from the encoder, but the output is very weird. Even when the motor is not ...
1
vote
0answers
2k views

Using digital rotary encoders for HID input using the Joystick library

I have been working on a small switch panel for flight sims, but I wanted to use the CYT1100 Digital Rotary encoders to move instruments in-game. I have the code set up to press a certain joystick ...
0
votes
2answers
117 views

Will an Arduino Uno be able to read 3x incremental encoders?

Encoders are quadrature 600ppr encoders with X2 counting. Therefore 1200 counts per revolution for each encoder. Is there an edge rate limit? I currently have one encoder hooked up using code with ...
-1
votes
1answer
234 views

counting revolution of incremental encoder

I'm doing a project which requires me to use an faulhaber encoder,and the one i have is a 2channel 16lines per revolution. I haven't worked with encoders before and based on what i found the lines per ...
0
votes
1answer
860 views

real-time reading of a quadrature encoder at full resolution with only one interrupt on ATmega328

I want to read a quadrature rotary encoders at full resolution with only one interrupt on Arduino Nano (ATmega328). So I found out that we can use XOR to reach a full resolution: Where pin 3 ...
1
vote
1answer
2k views

KY-040 rotary encoder skipping steps

Yesterday I asked a question about de-bouncing this rotary encoder and Jsotola suggested that I should use a method like This to detect the previous state and then do the counting. using that method ...
1
vote
2answers
791 views

Encoders for precise robot turns

So I recently purchased: DFRobot Wheel Encoders DFRobot 3PA and 4WD Rovers (2pk) Romeo V2 Arduino Controller I was doing a bit of research online and I'm trying to figure out how to use the ...
0
votes
0answers
179 views

Rotary Encoder gives "wrong" patterns?

I am trying to learn how to use a Rotary Encoder together with an LCD display where I can use the encoder to choose Letters that will be printed in the LCD. This is the kind of result I should be ...
0
votes
0answers
206 views

Best approaches to reading a high-count quadrature encoder?

I have a 24v servo motor coupled to a 2,000 segment optical encoder that runs on 5v. That's 2,000 "ticks" per revolution at it's base resolution. (Full quad reading allows 8,000 ticks per revolution, ...
0
votes
1answer
372 views

Forward kinematics of a differential drive robot

I've been braking my head over this for the past few days and can't make it work.. So, I have a small robot with a rotary encoder on each wheel and i want to track its position (in x and y) on a flat ...
-2
votes
1answer
332 views

How do you determine Lead Screw position using Absolute Encoder?

I need to control the position of a lead Screw Stepper motor using EMS22A Absolute Encoder? I've seen James Bruton do this in his video. can anyone help me? James Bruton Video: https://www.youtube....
2
votes
0answers
883 views

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 ...
2
votes
0answers
81 views

Program does not seem to be passing from setup to loop, or printing to SD card

I am trying to write code to test servo motors using an encoder. I create a file in the setup part, and then set 1500 microseconds to 0 for the encoder. However, if I try to print something to the SD ...
1
vote
1answer
1k views

Rotary encoder using interrupt

This is my first time working with a rotary encoder and interrupts. I am using a Pro Micro which has interrupt pins at pin0 and pin1. The code below works as expected. My question: do I need to use ...
2
votes
0answers
490 views

Rotary Encoder on LoLin NodeMcu increases value when rotating right/left

I have a test program running on my LoLin NodeMcu board, with a Rotary Encoder connected. I use Task.h and RotaryEncoderTask.h from this library: https://github.com/Makuna/Task (though my issue is ...
-1
votes
2answers
853 views

Reading a rotary encoder using digital pins of Mega 2560 directly using port registers?

I'm trying to write an interrupt service routine for an Arduino Mega 2560 to decode a quadrature rotary encoder. I've got an ISR (Interrupt Service Routine) that responds to the falling edge of ...
1
vote
0answers
301 views

High speed rotary encoder with Arduino MEGA

I'm trying to develop length measuring system and I'm using a industrial rotary encoder as the sensor. A have decided to use an Arduino external interrupt for connect the encoder. But, Encoder will ...
2
votes
1answer
137 views

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 ...
0
votes
2answers
28 views

Encoder coupled with motor shaft.Encoder is giving larger redings than expected

I am a rookie and i dont have much experience on arduino. please help me. I intend to build a robot that will drive on a straight path even on nonuniform surfaces like the ones we see in agricultural ...
0
votes
1answer
40 views

How to add numbers to a position when controlling a seven-segment display

I'm recently having a hard time with my Arduino project. I'm trying to control a seven-segment display (it has a microcontroller on it) with an encoder, and I'm trying so that everytime I rotate the ...