0

I want to build a simple computer interfacing system. The use case is: A user will press a switch that is connected to a computer through a serial port (or any other means, I don't care) and a running Windows program should be able to sense it somehow. How can I achieve this through simple circuitry outside the computer (i.e. on the switch end). Also suggest how can I sense the signal (i.e. switch toggling) using .NET or any programming language.

3 Answers 3

0

Hopefully others will have better solutions or be able to point you to a better forum (this is a particularly bad/hackish solution, and I suspect the forum is wrong), but one very crude way of doing this might be to get a UPS with a serial port and notification software which can launch a program/do something you can interface/detect in a programming language, and then put a switch inline between the UPS and wall socket (don't connect the UPS to the computer of-course), so that the loss of power toggles an alarm on the UPS software.

I am certain there are better solutions, probably simply using the RTS/CTS or one of the other sets of pins. It would probably not be that hard to write software to talk to the serial port, but it would depend on the library and thats a programming question way out of my depth - particularly in a Windows environment. Here is a web page which might help.

0

Here is an easy to implement SerialPort Class Library which can give you the functionality you're asking for. There are some nice and short examples of what you want in C# which is extremely similar to Java and will likely have similar Libraries on offer.

I suggest reading into these things, the ideas on how to solve your problem will come on their own.

0

There are many ways to skin this cat, but I would prefer stealing the circuit from an actual keyboard. A keyboard generally consists of a switch matrix with fewer terminals than you might expect (See description here.) I would modify a keyboard by keeping only the controller board and soldering the switch between two terminals corresponding to a key. You would have to trace out the correct terminals from the contact sheets used in your particular keyboard. This has the advantage of providing a very standard interface, and being expandable.

Keyboard pads

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .