Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Easy way to run rotary encoders

  1. #1
    FLAC TheLlama's Avatar
    Join Date
    Jul 2004
    Location
    All over the world
    Posts
    970

    Talking Easy way to run rotary encoders

    I've wanted rotary encoders for my carputer for a long time. I use my own winamp plugin which displays to a 160x32px Noritake VFD. I have been using a sort of D-Pad solution but it sucks for scrolling through long lists. Especially since I can only fit about 5 lines of text on the screen at a time (when browsing).

    I looked at using the Griffen Power Mate except it's windows support sucks, it's huge and only one can be used at a time. So I started building my own solution. After buying about 4 ICs and writing too much PIC assembly source I almost decided to give up.

    This is when I found a much easier solution under my own nose (actually it was in a desk drawer.) I disassembled a ball mouse, and looked toward the rollers. For those unfamiliar with how a mouse works, there are two rollers, X and Y. Each roller has a slotted disk on its axle and a phototransmitter and photodetector on either side. As the disk spins the detector receives impulses of light. There needs to be two detectors per disk though, one 90deg off phase. You can read more about this on Google. Its is essencially a two-bit Greycode (Quadrature).

    This mouse (and most others) will have both channels built into a single detector. My detector has 4 pins. Chan A, Chan B, +5VDC, and GND. It is easy to discover the pinout by following the traces. Then all you need to do is hook up your rotary encoder to these pins. From the encoder: hook A to Chan A, B to Chan B, and C to GND. Also attach a 10k pullup resistor individually from pin A to +5VDC and pin B to +5VDC. I will draw up a schematic if anyone is interested. The pullup resistor is manditory.

    The PEC11 series encoders from Bourns work great and cost less then $4. You can find ball mice for free. You can hook two encoders up to a single mouse. You can also wire the pushbutton shaft to RClick and LClick.

  2. #2
    FLAC TheLlama's Avatar
    Join Date
    Jul 2004
    Location
    All over the world
    Posts
    970

    Interface

    I forgot to mention how to interface with it. In my case I SetCursorPos to a fixed point (100,100). Then on WM_MOUSE_MOVE I read the position, increment or decrement my values as needed and reset the mouse back to (100,100). I dont know what software others use. If you are using a fullcolor LCD you can also hide the mouse. For WinAmp you just need to do SendMessages using the winamp api.

  3. #3
    Variable Bitrate
    Join Date
    Mar 2002
    Posts
    413
    And yet another method pioneered by MAME arcade cab makers years ago gets moved into the MP3 car world. Nifty. Anybody looking for ideas for controllers should head over to www.arcadecontrols.com .

    If you don't want to hack a mouse, you can get pre-built spinners by Oscar ( http://www.oscarcontrols.com/ ) controls and hook it up to an Ultimarc Opti-Pac ( http://www.ultimarc.com/ ).

  4. #4
    Nic
    Nic is offline
    FLAC Nic's Avatar
    Join Date
    Oct 2003
    Location
    Melbourne, Australia
    Posts
    1,047
    i love you guys
    Signature: [==||========] 20% complete

  5. #5
    FLAC Chairboy's Avatar
    Join Date
    Jan 2004
    Posts
    1,380
    I'll second the Ultimarc recommendation, I have one of his I-PAC encoders for my MAME arcade controller, and it works great. The I-PAC would be good for anyone who wants to monitor buttons.

  6. #6
    Variable Bitrate nzKAOSnz's Avatar
    Join Date
    Aug 2003
    Location
    Christchurch - New Zealand
    Posts
    332
    My optical encoder has 3 wires!!!!!!!!!! And only one for each axis.

  7. #7
    FLAC TheLlama's Avatar
    Join Date
    Jul 2004
    Location
    All over the world
    Posts
    970
    Quote Originally Posted by nzKAOSnz
    My optical encoder has 3 wires!!!!!!!!!! And only one for each axis.
    I think all optical encoders have 3 wires. one for your V+ and two for each channel (A and B). the channels emit a 2 bit quadrature (sp?) output. You can tell which direction the knob is being rotated by seeing which line goes high first.

  8. #8
    Variable Bitrate drait's Avatar
    Join Date
    Dec 2004
    Location
    NorCal
    Posts
    247
    Quote Originally Posted by TheLlama
    I forgot to mention how to interface with it. In my case I SetCursorPos to a fixed point (100,100). Then on WM_MOUSE_MOVE I read the position, increment or decrement my values as needed and reset the mouse back to (100,100). I dont know what software others use. If you are using a fullcolor LCD you can also hide the mouse. For WinAmp you just need to do SendMessages using the winamp api.
    I'm using the Mouse plugin for Girder for my rotary encoder (ALPS EC11E15244B2). You could accomplish this same thing in Girder by creating events for the X and Y axises.

  9. #9
    Variable Bitrate lerandell's Avatar
    Join Date
    Mar 2004
    Location
    Ennis,TX.
    Posts
    316
    can someone give me a photo or a wire schematic on this. I have been searching on this stuff but it is a little deep and need some direction from those who understand it.
    Randell Kelly

  10. #10
    Registered User
    Join Date
    Apr 2004
    Posts
    803
    Fore does who want more input to the computer you might what to try this http://www3.alps.co.jp/pdf/2004pdf/p...ulti/rkjxt.pdf
    its a 8-directional Switch and Encoder with a Center Push, i got mine last week and hooked up the rotary encoder and center push to my mouse and the 8 way directional switch is hooked to a hacked up keyboard. You have it do up to 13 different actions with the help of girder.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 39
    Last Post: 09-16-2004, 11:12 PM
  2. Replies: 16
    Last Post: 06-15-2004, 11:52 AM
  3. Getting adware/ Trojans off my comp!
    By bosstone74 in forum General MP3Car Discussion
    Replies: 23
    Last Post: 05-24-2004, 08:28 PM
  4. Those who run fans for cooling??
    By osirisdon in forum General Hardware Discussion
    Replies: 3
    Last Post: 06-12-2003, 09:30 AM
  5. Configuring old computer to run mp3's in car
    By Blake in forum General MP3Car Discussion
    Replies: 4
    Last Post: 02-23-2003, 10:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •