Maker Pro
Maker Pro

USB multiswitch

Catcher

Jan 21, 2013
5
Joined
Jan 21, 2013
Messages
5
Hi guys & gals, looking for hardware advice on a very basic electronic part of a larger software project.

I need to mount 4 physical switches that fire a state change signal to a USB port when any switch is flipped. If necessary, I can continuously poll the port instead for state change.

This type of thing would be trivial if lpt ports still existed, but alas..
Any recommendations?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,758
Joined
Nov 17, 2011
Messages
13,758
Could you use a USB mouse with multiple buttons? Re-wire the buttons to your switches, evaluate the state change of the buttons by typping into the mouse driver.
 

Catcher

Jan 21, 2013
5
Joined
Jan 21, 2013
Messages
5
Creative idea, but unfortunately the switches need to be around 6' apart.
2 are rollover switches. The other 2 are push button switches, but those are optional.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,758
Joined
Nov 17, 2011
Messages
13,758
By re-wire I mean place your switches where they are needed and use some wire to connect them to the mouse's electronic (just solder them to the pads of the mouse's original switches).

Or use a USB I/O card like for example this one.
 

Catcher

Jan 21, 2013
5
Joined
Jan 21, 2013
Messages
5
Ahh, I see. So I would just buy switches and solder them to the relay pins on the I/O card?

How difficult would the mouse rewire be? Sounds very simple, but I am a software guy. :)

Thanks very much for the ideas!
 

donkey

Feb 26, 2011
1,301
Joined
Feb 26, 2011
Messages
1,301
hey catcher, if its all about reading serial data via USB try one of the many microcontroller assemblies out there. A quick glance at Arduino shows a schematic to hook up a single button and one for analog input as well. theseare both printed to the serial monitor.
http://arduino.cc/en/Tutorial/DigitalReadSerial
http://arduino.cc/en/Tutorial/AnalogReadSerial
just a thought for you any way, expanding on that design won't take too much as long as your programming is good lol
 

Catcher

Jan 21, 2013
5
Joined
Jan 21, 2013
Messages
5
All great info, thanks guys. I'll respond here if (when) I have more Qs.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I was going to add the following

Another option is a USB/Serial Converter dongle. They're dirt cheap and enable you to communicate with the PC via good old RS232 protocol and architecture. Of course you would have to convert your switch closure data to serial data.

but then I had a thought or two. There must be countless damaged USB keyboards out there with nothing more wrong with them than missing keys. They can be had for nothing or next to nothing. Each key contact is an available switch input.

Chris
 

Catcher

Jan 21, 2013
5
Joined
Jan 21, 2013
Messages
5

donkey

Feb 26, 2011
1,301
Joined
Feb 26, 2011
Messages
1,301
I too am playing with raspberry pi. they have a huge section on items like this. if you are good at programming I should add you cos I hate linux buthave so many ideas for my little pi's (I have 3 atm lol)
check their gertboard section as it might be the best thing for you.
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=42&t=13037
 
Last edited:
Top