Rotary Encoder Help!

Discussion in 'General Electronics Chat' started by JdogAwesome, Jul 9, 2016.

  1. JdogAwesome

    Thread Starter New Member

    Mar 24, 2016
    9
    0
    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
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,493
    2,363
    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.
     
  3. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,872
    369
    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!)
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,634
    2,342
    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
     
  5. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,787
    825
    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.
     
  6. JdogAwesome

    Thread Starter New Member

    Mar 24, 2016
    9
    0
    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
     
  7. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,872
    369
    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.
     
    djsfantasi likes this.
  8. GopherT

    AAC Fanatic!

    Nov 23, 2012
    5,979
    3,686
    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.
     
  9. JdogAwesome

    Thread Starter New Member

    Mar 24, 2016
    9
    0
    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!
     
  10. ScottWang

    Moderator

    Aug 23, 2012
    4,848
    767
  11. JdogAwesome

    Thread Starter New Member

    Mar 24, 2016
    9
    0
    Thats exactly what I first tried using the example code there, though it wasn't working. Im going to try what AlbertHall suggested and report back later.
     
Loading...