SparkFun Forums 

Where electronics enthusiasts find answers.

#202090
Hey all,

I've been wondering how to do this... I'd like to make a few things (like assisted devices) that are basically simple switches that connect to a computer via USB.

An example is a simple button that, when pressed, sends a keypress signal to the computer, which can then be set within software. This might be used by someone wanting to be able to press a large button to send an "Alt-M" to lighting software to turn on lights using a "Morning" setting. Another example might be a rotary switch which sends a signal to close a window shade to a certain point (almost like a dimmer).

I know this can be done with Arduino or other types of boards, but mass-producing them would be cost-prohibitive. I want to be able to make a small panel to which I can add a number of these switches (up to 20 or 30, or more), then connect them via a powered hub or something else.

That said, I'm not sure of the terminology, and WAY too many search results come up when searching things with USB and Switch...

Can anyone recommend references/tutorials?

thanks,
Andrew
#202092
Look at www.phidgets.com. I'd also look at products used by the DIY flight simulator folks and the DIY arcade folks. Both groups have solutions for reading multiple buttons or controls and connecting via USB.
Spinning a small PCB with a tiny85 running VUSB would also be a cheap and easy solution, but housings, wiring, and hubs will add up.
/mike
#202093
n1ist wrote: Fri Feb 15, 2019 8:31 am Look at www.phidgets.com. I'd also look at products used by the DIY flight simulator folks and the DIY arcade folks. Both groups have solutions for reading multiple buttons or controls and connecting via USB.
Spinning a small PCB with a tiny85 running VUSB would also be a cheap and easy solution, but housings, wiring, and hubs will add up.
/mike
Thanks Mike!

I took a quick look at both phidgets.com (not sure what I'm looking for, exactly, but I'll go back) and looked up the tiny85.

Regarding the tiny85, I saw what look like chips, as well as what looks like tiny boards... I assume you're talking about the chip?
#202096
Arduino type boards that use the ATmega32U4 (Leonardo, Pro Micro, etc.) can emulate an HID keyboard. You can attach as many buttons as there are GPIO pins available and use them to send whatever keyboard input you want, including multiple key presses per button press.
#202097
darrellg wrote: Fri Feb 15, 2019 10:35 am Arduino type boards that use the ATmega32U4 (Leonardo, Pro Micro, etc.) can emulate an HID keyboard. You can attach as many buttons as there are GPIO pins available and use them to send whatever keyboard input you want, including multiple key presses per button press.
Yes - as noted, though, that would be prohibitively expensive, I think...
#202103
Prohibitively expensive depends on your budget and quantity you want to build, so unless we know that, we don't know what to recommend. Up to a certain volume, it costs less to use an off the shelf Arduino board than to spin your own. Remember that these guys are building thousands of Arduino clones and doing so in China, so unless your quantities are similar, it's probably cheaper to buy than to build. I can't build a Pro-Mini equivalent for the $2 I can buy one for.

Anyway, the search term you want is probably "HID switch interface" or similar.
#202104
Thanks lyndon -

Ok, so this is why I'm asking - I am ok with using arduino to build an interface for multiple inputs. I am just unsure where to start if I want to either make or buy the button/switch/dial components, and I don't know enough about the tech involved to google it. "USB abc" turns up millions of unrelated stuff...

The search you recommended literally turns up 3 results. (That's kind of impressive on Google...)