4 ms·
Spinner-mouse: Arduino-based USB rotary controller for Arkanoid, Tempest, etc.
- sleepybrett 3y agofriend of mine built this: https://www.instructables.com/HDDJ-Turning-an-old-hard-disk-drive-into-a-rotary/ https://www.instructables.com/HDDJ-Turning-an-old-hard-disk-... can't beat how smooth it is.
- HeyLaughingBoy 3y agoLove it! Very clever idea.
- nativeit 3y agoThis looks awesome. I’m going to try building one this evening. It’s interesting reading the comments from 14-15 years ago, the capacity for hobbyists to do such things today is so much greater, even just since 2010.
- dylan604 3y agothat's interesting. the switch from vinyl to any of the other controllers was a very long time for me because I did not like the feel of any of the control surfaces at the time. the CDJ100s feel like fisher price toys which is probably what kept the prices a fraction of the CDJ1000s which had a much more acceptable feel. some of the digital only devices have gone back to that cheap light plastic feel with just a horrible bit of resistance. i often wonder how people tolerate it, but then i realize most people don't know what it was like playing vinyl and have nothing to compare to.
- sleepybrett 3y agoI remember back in the day NI had a box that worked with traktor that came with some special vinyl records that had encoded signals built on it. You ran the output of the record players into the 'traktor box' and it would turn this into positional information for traktor .. seems like they still make the records: https://www.native-instruments.com/en/catalog/hardware/traktor/digital-vinyl/ https://www.native-instruments.com/en/catalog/hardware/trakt... I think the product, back in the day, might have been called traktor scratch.
- djmips 3y agoI was just going to post about this! Not this particular project but the fact that most of us have old hard drives lying around that we could turn into rotary input device!
- modeless 3y agoThis is cool. I wonder how hard it would be to drive the motor just enough to compensate for friction so that it would spin forever at whatever speed you leave it instead of slowing down when you're not touching it.
- CrLf 3y agoI built one of those many years ago as well. :) * https://github.com/carlosefr/DisKnobUI * https://www.youtube.com/watch?v=MvpPVjJnbao It thought about using that (the spindle motor from a hard-disk) for this project. The issue is that it's not very precise at very low speeds. It sort of works, but it falls out of sequence too often.
- tombert 3y agoI made something like this pretty recently, though it was with an ESP32, and it was bluetooth, and I used a mouse driver. It was cool, though I did kind of grow a hatred for the Arduino "poll the pins in the loop" way of doing things. It would kind of work, but the problem would be that if you spun the knob too quickly, it would actually end up going backwards because you're effectively spinning faster than it can sync. I ended up having to learn how to use the FreeRTOS interrupts. It was a bit harder but it was a much better play experience.
- mikeInAlaska 3y agoWhat is causing the interrupts? Any change to encoder A or B?
- tombert 3y agoYou can set a gpio pin mode to PULLUP, and there’s a function built in to the freertos/arduino stuff for the ESP32 to convert that gpio pin signal to an interrupt. From there you can pass in a function pointer to run upon receiving the interrupt. The rotary encoder I bought simply applies pulses to one pin when spinning clockwise, and another pin when spinning counter clockwise, so I just attached the interrupts to two separate gpio pins, and sent the updates to the mouse stuff directly in the interrupt handler. I simply moved the mouse N units to the right or left if going clockwise or counterclockwise. I’m sure it’s not ideal but it worked to play breakout. I’m still a little new to the world of microcontrollers so it’s possible that I did something dumb.
- dekhn 3y agoThere is also a very simple and straightforward chip that will convert quadrature to pulses. Ls7183n. It's kind of unnecessary if you can write your own interrupt handlers but it's useful if you're just working with discrete electronics
- HeyLaughingBoy 3y agoThe LSI-Logic encoder interface chips are nice if your encoders are running at thousands of RPM. You also have to jump though a few more hoops than just an online order (I use an LSI device in a machine tool reconditioning product), so it's not particularly hobbyist-friendly. I'd be hard pressed to imagine anyone using them if they didn't absolutely have to. That said, they work very well.
- robertclaus 3y agoIt was refreshing to see an off-the-shelf project box on the parts list rather than 3d printing it. I'm in the middle of a multi-day printing spree for a project and am learning to appreciate that not every generic box needs to be 3d printed.
- HeyLaughingBoy 3y agoIf I could give you a thousand upvotes... Yeah. I've gotten tired of replying to the myriad "how can I 3D print an enclosure for my project?" questions that electronic enclosures are a mature product category and there are literally hundreds of thousands of varieties available off the shelf at prices your 3D printer can't touch. Need something with weird custom shapes that likely no one else has ever needed? Go ahead and 3D print. Need a generic box-like thing, with or without a clear cover, made from a wide selection of materials, with or without ingress-protection ratings and/or hand held, wrist-mounted, rack-mounted, desktop or wall mounted, or clipped to a belt strap in enough variations and sizes to make your head spin? Buy it off the shelf. I'm willing to bet that 9 times out of 10, for a hobbyist product, a Hammond-1551 variant will do just fine.
- joshmarinacci 3y agoI don't understand how it has a final resolution of 96 steps if the hardware has 24 steps.
- HeyLaughingBoy 3y agoThat's where the word "quadrature" comes in. The encoder has 4 states for each cycle.
- tanseydavid 3y agoI had the same question. Following the wikipedia link from the README: https://en.wikipedia.org/wiki/Incremental_encoder https://en.wikipedia.org/wiki/Incremental_encoder helped me develop a little bit of understanding and it confirmed my suspicion about 96 = 24 positions * (2 output pins / 4 states). Asking an LLM next, provided this sentence: "Resolution Increase: By detecting both the rising and falling edges of both channels' signals, you effectively multiply the basic steps per turn. Each step in one channel can be subdivided into four phases (A rising, B rising, A falling, B falling), which leads to the increased resolution. Here’s the math: 24 steps * 4 (due to the four phases per step in quadrature encoding) = 96 steps per turn."
- JKCalhoun 3y agoIf the encoder is like a wheel with 24 "teeth" a single LED/detector could tell you when it became blocked, when it became unblocked (by a tooth). There's 48 states already. You put another LED/detector just a half-tooth out of phase with the first detector and you not only doubled the resolution, but you can tell direction as well.
- Rebelgecko 3y agoI've been eagerly awaiting the day when I can buy one of these: https://github.com/scottbez1/smartknob https://github.com/scottbez1/smartknob (or when building one myself doesn't require any soldering more advanced than thru-hole).
- trentnix 3y agoNow add vertical adjustment to the spinner so I can play Discos of Tron!
- vunderba 3y agoNicely done. Back in the day, I actually used to convert the midi signals from a rotary encoder knob on one of my AKAI into a MAME input just so I could play Arkanoid.
- toobitts 3y agoNice. I've purchased a couple of these, which are similar: https://www.tindie.com/products/bittradeone/rev-o-mate-bfrom11bk/ https://www.tindie.com/products/bittradeone/rev-o-mate-bfrom... Incredibly useful in my line of work.
- resonator 3y agoI really must make one of these. My favourite game is Kaboom! which is completely unplayable without a paddle. https://en.wikipedia.org/wiki/Kaboom!_(video_game) https://en.wikipedia.org/wiki/Kaboom!_(video_game)
- wavesplash 3y agoIf you want an out of the box USB spinner solution, check T-Sticks' USB spinners: https://thunderstickstudio.com/collections/spinners https://thunderstickstudio.com/collections/spinners
- _spduchamp 3y agoThat's some nice looking hardware. I need to find more resources for robust buttons, switches and knobs for building instruments for disabled musicians using the Instrument Maker framework. (https://instrumentmaker.org/ https://instrumentmaker.org/) The look and feel of these instruments it incredibly important for artistic performance, and we're hoping to find off-the-shelf options for various buttons/switches rather than fabricating our own.
- thanatos519 3y ago96 steps? Hmm, my TRON had 128 steps. Might take a bit more circuitry or and/or a gear to get there.
- CrLf 3y agoAnd Arkanoid had 486, which made me fear this project wouldn't have enough resolution for decent gameplay, yet it works perfectly (for my standards, at least). I'm not sure why Arkanoid's spinner had so many steps. It can be to allow for pixel-by-pixel movement on its 336 pixel horizontal resolution, but it can also be because the way they were polling the encoder might miss some quadrature steps and they needed the extra resolution to ensure smooth control. Perhaps a combination of the two.
- roydivision 3y agoReally nice project, props to Carlos!