Last chance to enter The Hackaday Prize.

A USB Connected Box-o-Encoders

picoscope-encoder

[Colin] loves his PicoScope, a USB based “headless” oscilloscope. While using it he found himself longing for a classic oscilloscope interface. Mouse clicks just weren’t a replacement for grabbing a dial and twisting it. To correct the situation he created his USB-Connected Box-o-Encoders. The box maps as a USB keyboard, so it will work with almost any program.

[Colin] started by finding encoders. There are plenty of choices – splined or flatted shaft, detents or no detents, panel, PCB, or chassis mount. He settled on an encoder from Bourns Inc. which uses an 18 spline shaft. His encoder also includes a push button switch for selection. With encoders down, knobs were next. [Colin] chose two distinct styles. The two knob styles aren’t just decorative. The user can tell which row of knobs they are on by touch alone. Electronics were made simple with the use of a Teensy++ 2.0. [Colin] used a ATUSBKey device running Teensy software, but says the Teensy would have been a much better choice in terms of size and simplicity.

Once everything was wired into the box, [Colin] found his encoders would “spin” when the knobs were turned. They are actually designed to be PCB mounted, and then screwed into a control panel. Attempts to tighten down the panel mounting nut resulted in a broken encoder. Rather than redesign with purely panel mounted encoders, [Colin] used a dab of epoxy to hold the encoder body in place.

encoder-wired

The software setup is simple: Whenever an encoder is moved, Teensy outputs a unique keystroke for that encodrer’s clockwise rotation, counterclockwise rotation, and press-to-select. The PicoScope software keyboard shortcut keys are setup to respond to the keys programmed into the encoder box. The final result is very slick. Timebase, channel voltage, and trigger level, all work like a regular scope. 

Comments

  1. Tom Hargrave says:

    The PEC11-4215K-S0024 used in his project is no longer being manufactured.

  2. ejonesss says:

    looks like you built a macro box or a video editing keyboard or gaming mouse where each encoder can be programmed to do something so you can turn 1 and vertically scroll and another horizontally scroll and another volume for sound or another could be brightness or contrast in a photo editor or video editor

  3. tekkieneet says:

    BTW you can laser print onto transparency and iron on your faceplate
    design onto Plexiglas i.e toner transfer. Using that on top of the
    aluminum panel instead of permanent markers would make it look more
    professional.

  4. J. Peterson says:

    Nice. I think the headless O-scope companies should consider a project line for this (i.e., PC is just used for the display screen). Another solution for cleaner look on the mounting panel is FrontPanelExpress.com (I haven’t tried them, but it looks like relatively painless way to get a nice result).

    • Ren says:

      Yes, if such a company takes this on, I hope they would use a PCB to solder the encoders to reduce the “rat’s nest”.
      I had no idea encoders could be had for those prices. Is there an item available for obtaining scrap encoders, like maybe a mouse wheel?

      • reboots says:

        Scroll wheels usually do have a small optical encoder attached. Old ball mice contain two or more. For a mechanical encoder with a shaft, look in discarded consumer electronics which use a rotary knob for a digital function: car radios, stereo receivers, and radio scanners.

    • tekkieneet says:

      Cable ties or lacing (en.wikipedia.org/wiki/Cable_lacing) would clean up the mess.

      DX (and possibly others) sells Rotary Encoder (SKU: 275658) $3.26 for 2.
      They used to sell a few similar items at QTY 10.

  5. Zapro says:

    Dat “encodrer”

  6. echodelta says:

    The only good encoder is optical and it will have a power input for the LED. The mechanical ones don’t always output one pulse per click or bump. I have a stereo where the big knob skips pulses and has to be turned slowly to get volume change at all. They get dirty and wear off their carbon tracks. Though I prefer knobs to a buttons especially for volume in a car radio, some of these leave something to be desired.
    This overall hack could make for some better action for keyboard based games or editing.

    • I agree that the mechanical ones can sometimes not output a pulse. However this is generally only a problem at higher rotational speeds where the contacts bounce, or it’s given a quick flick, in which case you’re not expecting it to settle on an exact value anyway.

      The insides aren’t carbon track, they’re metal contacts. Here’s the innards of one of the cheap Chinese ones:

      http://imajeenyus.com/temp/DSCN6381.JPG

      Note the grease – at higher speeds, the sprung contacts will ride over the surface of the grease (“greaseplaning!”) and won’t make proper contact. However, I found that even at 500rpm, the encoder still produces (or rather, my little circuit detected) correct pulses 95% of the time. At 2000rpm, that’s down to 90%.

      Generally you’re going to sneak up on whatever value you want, so the final adjustment will be at a very slow speed, so contact bounce shouldn’t be an issue.

    • BTW, totally agree about knobs on car controls instead of encoders!! With a knob, you can easily tell where it is without looking, unlike an encoder.

    • rasz says:

      professional $xxK oscilloscopes work just fine with mechanical encoders

    • coflynn says:

      The mechanical ones need SW debouncing…. if you are lazy (as in my project) they won’t be very reliable. But lots of products use them & work great (e.g. real scopes) because they were not lazy!

  7. jonded says:

    Very nice! this will have to be added to my list of things to do. Only thing that would irk me is that the Picoscope software would need to be the active window for the keyboard short-cuts to work, so I couldn’t have the scope on a second monitor (usually my TV) while working on something else on my main monitor. This is already an issue though, having to mouse on over to the TV to change anything

    I might add a button to the panel which would run a Windows Hotkey which would make the Picoscope window active. This could maybe also run the software if it isn’t already open. Or see if I can run the Hotkey on the first click of any encoder without the window minimising when I turn another one.

  8. M H says:

    Seems like the generic HID (covered in HAD a while ago)
    http://hackaday.com/2010/06/23/working-with-the-at90usbkey/
    would be a logical alternative for firmware, if wanted HID, rather than keyboard emulation.
    (Though might have to use different encoders, or adapt generic HID encoder support).

    • coflynn says:

      Keyboard is HID… just a specific class. Thus if you want to use generic HID it’s about 2 lines of code to change! The problem is then you require your computer SW to be designed to use this box properly & know what the codes are. I didn’t have that option (scope software is closed-source) so had to hack the available input options.

  9. NATO says:

    This is a complete waste of time. For the cost of a Picoscope and the encoders, you can just go out and buy a better bench oscilloscope WITH VGA output. A much cleaner, much more functional solution that doesn’t require 4 boxes (picoscope, CPU, Monitor, switch box).

    This is what happens when people stop thinking analytically.

    • Colin says:

      Huh? AFAIK this is far cheaper… the reasonably-priced scopes have very small buffers (1MSample) seems to be more expensive, although the Pico devices have insanely large buffers (512MSample for my device). Besides 95% of the time I like the GUI interface anyway instead of encoders, but wanted to build this out of interest…

    • coflynn says:

      Huh? AFAIK this is far cheaper… the reasonably-priced scopes have very small buffers (1MSample) seems to be more expensive, although the Pico devices have insanely large buffers (512MSample for my device). Besides 95% of the time I like the GUI interface anyway instead of encoders, but wanted to build this out of interest…

      • coflynn says:

        My comment got screwed up there sorry… it should have read “the reasonably-priced scopes have very small buffers like below 20KSamples, devices with OK sized buffers (1MSample) seems to be more expensive”. I don’t think the comment system liked my ‘less than’ sign for some reason!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,175 other followers