Question:

How can I read buttons, k***s and switches and flip switches (control lights, buzzers) from software?

by  |  earlier

0 LIKES UnLike

I want to build a very basic security system (as a summer project - I don't have anything that needs protecting). I want software that can read input from a keypad or an RFID sensor as well as a door switch. I want to control a buzzer/siren and status lights.

I have a Mac on which I can run Linux (I'd rather not do Windows - an extra $200 I want to avoid.) My technical expertise is decent in terms of software - though it's all in the web app realm - my dad knows more about hardware-level electronics.

So... what kind of system can let me control and read switches for not very much money? Would I have to learn a new language (I know Python and a little Java - PHP also, but that doesn't seem relevant)?

Thanks!

 Tags:

   Report

2 ANSWERS


  1. the problem is not in the software, it's in the hardware. To read a switch's position (assuming a toggle switch) you usually need a separate set of contacts on the switch that you can connect to 5 volts. This 0v or 5v signal can be connected to a wire that can be read by an interface to the computer. In your case, probably via a USB bus interface.

    similar techniques get you signals from other controls. Something that is not digital, like a k**b controlled potentiometer, such as a volume control is more difficult. You would have to put another pot ganged to the first, put a fixed DC voltage across it, and run the wiper of the pot to a A-D converter, which you run to the USB if. difficult.

    Lots of other difficulties.

    Which is why people who design instruments that are to be interfaced to a PC do the design with that in mind. Very difficult to retrofit an old design.

    I'm out of time, try more later.

    here is a USB IF, there are lots more around.

    this one has 24 bits of control.

    http://www.hobbyengineering.com/H3387.ht...

    get this working and you are a long way there.

    .


  2. Simple way if you can use windows:  Use an x-10 computer interface to transmit x-10 signals over your house wiring to control devices.  I think it can also receive x-10 signals from external devices.

    Check:  http://www.smarthome.com/1140.html

    More complex way:  buy a LabJack U-3 USB hardware interface.  It comes with drivers for Windows & Linux which can be called from a Python script.  I chose this route and installed the driver on my Linux PC, but have not yet had the time to write the python program.  This is a much more versatile solution, but the LabJack device is somewhat complex and will take some time to understand fully.

    Google "LabJack" to find out more about this device.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.