PDA

View Full Version : reading switch status



csdude
12-01-2009, 03:22 PM
Hello,

I have a pico ITX board and I need 'something to read the status (pressed or not) of a micro switch (9 of them) with. (I can use the serial port or usb).

Any suggestions for something simple, small I can get of the shelf ?

thanks,

Ron

Adrenalynn
12-01-2009, 03:46 PM
Off the shelf - I'd suggest the cheapest Arduino-clone you can find. Freeduino? Arduino mini? Something like that.

How the heck have you been? Haven't spoken with you in FOREVER!

csdude
12-01-2009, 03:54 PM
Off the shelf - I'd suggest the cheapest Arduino-clone you can find. Freeduino? Arduino mini? Something like that.

How the heck have you been? Haven't spoken with you in FOREVER!

Hey Lynn, how have you been?

Not too bad at all... been traveling quite a bit, projects job opportunities that kinda thing. But back and picking up some projects again.

I have 9 micro switches, I was thinking of powering one pole of each switch, and then with "something" just check if the switch was pressed via rs232 or usb
Sounds like I should be able to find something like that (on ebay or so) for a few bucks?

so what is it I am looking for?

Ron

Adrenalynn
12-01-2009, 05:30 PM
Good enough, I suppose thanks!

>> so what is it I am looking for?

A microcontroller.

You have a serial port and a parallel array. I suppose you could use a parallel printer port, but the bus driver is going to cost more to build these days than a cheap microcontroller with a handful of switch inputs. A $17 arduino is gonna be a lot easier... ;) [nkcelectronics.com]

csdude
12-01-2009, 06:08 PM
Good enough, I suppose thanks!

>> so what is it I am looking for?

A microcontroller.

You have a serial port and a parallel array. I suppose you could use a parallel printer port, but the bus driver is going to cost more to build these days than a cheap microcontroller with a handful of switch inputs. A $17 arduino is gonna be a lot easier... ;) [nkcelectronics.com]

right I thought about the parallel port, but that pico doesn't have one.

$17 for an ardiuno is not bad, what one am I looking for ? (checked there site didn't see a $17 one.

Adrenalynn
12-01-2009, 06:15 PM
Well, I sorta misspoke. The Pro Mini was what I was thinking of. But if you don't already have an RS232 to TTL or a USB to TTL, you'd need to buy one of those too.

They have the already built and tested Seeduino for about $20 (http://www.nkcelectronics.com/seeeduino-fully-assembled--v212-atmega168--arduino-comp212168.html)[/URL] or if you're game to solder it together, they have [URL="http://www.nkcelectronics.com/arduino-board-serial-v20-complete-k.html"]a kit for $14.49 (http://www.nkcelectronics.com/arduino-duemilanove-with-atmega168-22-prom16822.html) or the version 2.0 kit for a couple dollars more (http://www.nkcelectronics.com/freeduino-serial-v20-board-kit-arduino-diecimila-compatib20.html).

That'll give you like 14 digital inputs and 6 muxed analog inputs.

csdude
12-01-2009, 07:03 PM
Well, I sorta misspoke. The Pro Mini was what I was thinking of. But if you don't already have an RS232 to TTL or a USB to TTL, you'd need to buy one of those too.

They have the already built and tested Seeduino for about $20 (http://www.nkcelectronics.com/seeeduino-fully-assembled--v212-atmega168--arduino-comp212168.html) or if you're game to solder it together, they have a kit for $14.49 (http://www.nkcelectronics.com/arduino-board-serial-v20-complete-k.html) or the version 2.0 kit for a couple dollars more (http://www.nkcelectronics.com/freeduino-serial-v20-board-kit-arduino-diecimila-compatib20.html).

That'll give you like 14 digital inputs and 6 muxed analog inputs.


and than read from the digital input ports. right ?
(still a bunch of work, I wonder if there's something simpler. I might mess with an old keyboard controller a bit)

lnxfergy
12-01-2009, 07:14 PM
You might look at the Firmata library, you can download a sample sketch (program) to the Arduino, and then there are libraries in nearly every language imaginable to read/write the pins on the Arduino over the serial connection (almost 0 development time.. and of course, if you ever need to do something odd/interesting/more-advanced, Firmata is open source, you can add whatever to the firmware on your Arduino)

-Fergs

csdude
12-01-2009, 07:41 PM
You might look at the Firmata library, you can download a sample sketch (program) to the Arduino, and then there are libraries in nearly every language imaginable to read/write the pins on the Arduino over the serial connection (almost 0 development time.. and of course, if you ever need to do something odd/interesting/more-advanced, Firmata is open source, you can add whatever to the firmware on your Arduino)

-Fergs


well true, but this is one of those projects that when it is done it has the conroller in there permanently.

I think I have a very cheap solution, get a usb game pad/controller (for 4-5 bucks on ebay) and scavenge it for the microcontroller with USB port. The thing has a gazillion buttons (like 15 or so) and they are all micro switches. just do some creative wiring et voila.