Software Defined Radio (SDR) is a great technology, but there’s something so satisfying about spinning a physical knob to cruise the airwaves. Wanting to restore that tactile experience, [Tysonpower] purchased a cheap USB volume knob and set out to get it working with his software. Unfortunately, getting it up and running took a lot more work than you’re probably expecting.
![](https://hackaday.com/wp-content/uploads/2019/12/sdrknob_detail.jpg?w=400)
After verifying that the knob worked for volume control on his computer, [Tysonpower] decided to try and pull the firmware from the device’s STM32 microcontroller. Unfortunately, this is where things got tricky. It turned out the chip had Code Protection enabled, so when it was wired up to a programmer and put into DFU mode, the firmware got wiped. Oops.
That left [Tysonpower] with no choice but to write a new firmware from scratch, which naturally required reverse engineering the device’s hardware. Step one was reading up on STM32 development and getting the toolchain working, which paved the way to getting the knob’s LED to blink. A couple more hours worth of work and some multimeter poking later, and he was able to read the knob’s movement. He describes getting USB HID working as a nightmare due to lack of documentation, but eventually he got that sorted out as well.
The end result is a firmware allows the volume knob to mimic a mouse scroll wheel, which can be used for tuning in many SDR packages. But we think the real success story is the experience [Tysonpower] gained with reverse engineering and working with the STM32 platform. After all, sometimes the journey is just as important as the end result.
I think one big dial is good, but throw in a couple programmable toggle switches for setting mode and a button pad plus LCD for programming without a slave computer. These would purely be for feel though.
The tuning knob is the most beneficial, though, when pulling broadcasts the chip can’t “lock on” to steadily in automated scanning.
Nice project ! Well done.
(I must confess that after reading “The end result is a firmware (that) allows the volume knob to mimic a mouse scroll wheel” I could not help imagining myself “transplanting” the hardware from a mouse scroll wheel to fix the “dead” volume knob, even if it required a lot of “mechanical tinkering”… Oink ! Oink ! ;-) ;-) ).
Best regards,
A/P Daniel F. Larrosa
Yes, I’d be inclined to pull apart a dying scrollwheel mouse for the essentials. I’ve got an old dell one where the rubber scrollwheel is simultanously horribly sticky to the touch and stiff. Now I’m thinking that that part of the hardware basically puts out pulses, and you could use a stepper motor a backwards by cleaning up the pulses of that when you rotate it into each position. Big knob on it, maybe a stack of washers glued inside for heft, and I think it would feel great.
heh, i had one where the wheel was shaped to have ~3mm recesses, it was horrible. I got rid of the outermost part and replaced it with a champagne cork slice, cut to size. you don’t want to see it
Now I have a 3d printer, so I guess I could step up and make a decent one. Still, damn, they are handy for this type of stuff
I have a similar project that mimics keyboard inputs using an STM32 and one (or more) rotary encoder(s). I also wanted the user to be able to reprogram the input combinaisons without compiling a new firmware. I ended up with this https://github.com/Booster2ooo/stm32f103c8-usb-rotary-knob
It’s my first real elec project and my first time using C, I’m craving for advices/reviews or even PR <3
I must thanks Hackaday because I has this idea after reading few articles like this one, about knobs. I thought it would be an easy enought project to start with but, like Tysonpower, I struggeled for months on USB HID descriptors. In the end, I'm pretty satisfied even if it's far from perfect (eg. when turning the knob too fast, some 'usb ticks' will be lost).
You can add physical clicks by making a saw pattern around the race of the bearing.
Its desirable for clicks to correspond with steps send out by the device, not easy just adding notches manually
qmk has good stm32 support nowadays, and supports mouse emulation. using that may have been less painful. impressive job though.
Now to add one of those heavy Tuning knobs from a vintage stereo receiver for Tuning control.
(yeah, yeah, even I would think twice about butchering an old Pioneer, Marantz, or Onkyo receiver)
I used to want to do that.
Then I built a 3d printer.
So… I’ve used smooth rods, skate bearings, gt2 belts and pulleys. None of that feels mysterious as it once did. I can design and print brackets to hold said items. The only thing that seems even remotely challenging is a balanced weight to go on the end of the shaft.
Too bad I haven’t used a lathe yet. I do remember seeing an article where one guy used a tuna can. He drilled a hole in the center for the shaft then filled it with cement, or was it molten lead. I don’t remember. Maybe a big, oversized shaft coupler would do the trick?
Well.. anyway, point is… why bother ripping the mechanism out of a classic radio. It’s too easy to just build such things from scratch today!
Awesome Hack. …and the price is right!
This is something that I really don’t get about ham radio or more accurately, it’s something that I really don’t get about radio hams.
When SDR first started coming on the scene so many hams declared they would have nothing to do with it because they preferred the feel of a dial. Ok… I actually do get that. Perhaps it’s because that’s what I grew up with or maybe it is actually an objectively better interface than clicking virtual buttons on a screen. I’m not really interested in that debate. What I don’t get is that so few realize how simple it could be to have the best of both worlds. Granted, Tysonpower took on a difficult job having to reverse-engineer existing hardware. How simple would it be to just buy a naked encoder, interface it to an Arduino and use that to tune one’s SDR app using only beginner level code?
I would also add some sort of LCD myself with an image of a dial, moving needle and all but that would be the version for advanced hams with more programming experience. Well… at least until it gets shared. Then it’s just a minor wiring job and downloading a sketch off of GitHub.
Now there are ready made solutions for this today. But most of them cost more than a decent used car. A few hams buy it anyway, the rest drool over it. Come one, who are we kidding. If you can pass a General class test you can do this! It’s definitely not rocket science!
I also find it really sad that many hams still think SDRs are a waste of time or some sort of Devil like tech :P
I started with SDR before i made my ham license, so i’m more used to it that a normal Radio if i’m honest. But there are some things that are better on a Radio then on SDRs, one of them is the Frequency Knob. Still, it is easy to replace, on my PC i often just use my Mouse Wheel and it works fine, but on the Go such a usb Knob is perfect.
I’m also searching for a good Knob with Encoder that can be interfaced with an Arduino, maybe that will be a future Project :) If i built it myself, i really want a decent Knob that is like the one on a Radio from Yaesu etc.
regards, Manuel DO5TY
There were intropoductions to SDR about forty years ago, but they were theory since real.circuits were expensive and slow at the time. Though in retrospect I.see that some very high end receivers went digital about then, but they were so.expensive that most of us didn’t notice at the time.
Very slowly there was a trickle of construction articles on the topic, but they started out slow, and were few. So we never saw the same level of articles that regen and supehet recievers were seen in the ham magazines. Worse, a shift in publications moved the few SDR construction articles to the margins, where fewer hams saw thwm. They were seen as etoseric, and black boxes.
Early work were often add-ons, so they couldn’t even be seen as standalone receivers. Processing required a substantial computer for some time.
So.SDRs aren’t seen as having much in common with previous receivers. It seems like for a long time “SDR” meant a receiver online somewhere, rather than something to build. Even now they are often treated as black boxes, a solution to a problem rather than something to understand and build. Look at all those cheap USB SDRs, they are seen as some way to reach VHF reception, rather than write software to solve a problem or try new modes, or try to.improve reception. Peiple lacking in understanding of receiver design just jump in, unable to evaluate what makes a good SDR design.
The basics are understandable, but they just aren’t out there to the same extent that simple superhets used to be, stilll are.
Michael
If you manage to start the bootloader, the device will run in DFU mode on usb: no need to wire up a serial connection…..
the people in charge of STM32 usb hardware have reserved parking in hell. who the fuck licenses synopsys hw, modifies it, and then forgets to document their mods?!
you have to use their shitty libraries, which also only sometimes work, or else you’re fucked! there is not enough data in the docs to get it working yourself. There are at least 3 (THREE!!) undocumented regs that their code accesses by raw hardcoded address, without which the hardware simply will not start. In conclusion, i cannot wait till whoever is responsible for this hw arrives at their reserved parking space in hell, and is replaced by someone sane!