How to build a USB controller having knobs, sliders, and switches

I'd use one of the Teensy boards. These are Arduino-like microcontroller boards which have USB support. Unlike the Arduino, they can appear to a PC as any sort of USB device. This means that you can create your own custom USB keyboard, joystick, MIDI device, etc and have the PC use standard drivers.

The Teensy supports the Arduino IDE, or you can program in C and use LUFA (for USB support) directly.

Here are some project links to help.


I would use a microcontroller board like an Arduino. You read the ADC and digital I/O and send ASCII characters to the PC using the UART->USB connection.

How much external hardware you need depends on the accuracy you require. I would think for most applications the hardware internal to the microcontroller would be sufficient. I would debounce the switches in hardware.

For the USB interface just write a simply parser so that you can query the readings. For example if the PC sent the string "A00?" the uC could send back the reading on analog channel 0. "D00?" the uC could send back the state of digital input 0. To change a digital output maybe something like "D00=1" or "D00=0". These are short strings in a fixed length. Should be very easy to parse.


I like using Arduinos, they're simple to program and you can easily send data to your computer from the various inputs via the onboard USB connection. The data can be sent to the Arduino programming environments Serial Monitor - which is useful for debugging.

I then use a program like Pure Data (PD) or Max MSP to receive the serial data. Data can be sent out from these programs in all kinds of useful formats. Cuz it's simple enough to do any kind of log curves or scaling in the software - you don't have to worry about buying expensive log pots or using hard to find values - just buy a job-lot of the same value and worry about the specifics later (1K or 10K is normally easy to get).

This one's free: http://puredata.info/

This one is the payed for swanky version, but it has a good demo: http://cycling74.com/downloads/

Tags:

Interface

Usb