Rotary Encoder Help!

Thread Starter

JdogAwesome

Joined Mar 24, 2016
9
I took apart an old music system that didnt work anymore and got a nice volume knob, or at least thats what it was used for, and I wanted to use it for a different project. At first I thought it was a potentiometer but it definetrly was not because it continuously spun, unlike a potentiometer, so I thought it was a rotary encoder. I found the pins for ground and the 2 outputs and I tried hooking it upto my Arduino to test it out. I hooked up exactly how I am supposed to and used multiple different example codes to test it out, but it wouldn't work. By that I mean in the serial monitor where it was supposed to output to, nothing was outputed. Though when I used THIS code and I hooked up all the pins, nothing displayed in the serial monitor, though when I disconnected the ground pin, it would start spamming numbers in the monitor. If anyone could help me try to figure this out and get it working that would be great. Below is a picture of the supposed rotary encoder.
Rotary Encoder Photo.jpg
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
You can read an incremental encoder very easily with a meter, if only two pin out, it could be a quadrature encoder and under power you should see the two signals 90° apart. Although an odd application for a quadrature encoder?
Max.
 

AlbertHall

Joined Jun 4, 2014
12,347
From the photo it looks like quadrature encoder - 4 off LEDs, 4 off 100R resistors + 2 off 10k resistors as pull-ups for the encoder.
(And it also looks exactly like one I removed from a defunct radio!)
 

bertus

Joined Apr 5, 2008
22,278
Hello,

A picture of the backside of the PCB would also give us more info.
Are there any numbers or other markings on the switch?

Bertus
 

djsfantasi

Joined Apr 11, 2010
9,163
How are you connecting the encoder to the Arduino? It is not clear to me if you are using pull up resistors or not. Particularly since your description on mentions connecting ground and two pins.
 

Thread Starter

JdogAwesome

Joined Mar 24, 2016
9
Ok so I just noticed those 10K resistors and they are connected to gnd as pull down resistors(I think). Here is a picture of the back side of the PCB.
Rotary Encoder Back.jpg
 

AlbertHall

Joined Jun 4, 2014
12,347
Those 10k resistors are indeed pull-downs and the common from the encoder is connected to ground. If you are using the encoder still fitted to that board then you will need pull-ups to 5V, say 1k, so that you will get proper logic levels to the Arduino.
 

Thread Starter

JdogAwesome

Joined Mar 24, 2016
9
It is a simple 3 pin pot.
Center pin connects to Tuner
Right pin (when viewed from bottom pcb pic) connects to Tuner2
Left pin connects to Ground Pin.
That's exactly what I thought and that's how I hooked it up to my Arduino, though that didn't work. I'm going to try what AlbertHall suggested and see if that works. Thanks you all for your help!
 
Top