Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

useing my pc to moniter the state of an external switch

Status
Not open for further replies.

zxrepairman

New Member
What i am trying to do is to moniter a external switch and graphically represent it on my pc the software side i think i can solve but the electrical side is causing me a few headaches..i need to do this either through the usb,parallel or serial.as i do not want or need to control the switch
can i use the power from the computers port serial,usb or parallel send that current to the switch and determine wheather or not it is on or off .

or will i have to incoperate a A D C into the cable and use a external powersupply.

or is there an entirely different and easier way my main object is that it is cheap and not involve opening up the pc

as you probably tell i am new to this so any help however small is gratefully recieved
 
Just hook up one input pin on your parallell port with a pull up resistor to 5V and let the switch bring it down to ground and you're set for the external design.

Be sure to do things exact on the parallell interface since errorous voltages etc can burn the port. I would recommend an "optic switch" to isolate the port from your hardware application.

The software is (as you say) pretty easy to code, it's easy to scan the parallell port.

If you really need to work with serial interface, I would create some kind of middleware like a basic stamp to maintain the communication, but that's really overkill :)

Good luck
//Albert "thec" Sandberg
 
thank you very much for the reply its helped me very much i have been looking into what you said as i am new to electronics and i think your solution is the best so far for what i want to achieve.

i assume this is a non standard cable that i would be making or does such a cable exist if so do you know the name of such a cable.

again many thanx
 
Switch to PC

:!: A word of caution. You need one side of the switch to be at ground potential and you need to know that when the switch goes open circuit, the voltage is DC and is not excessive. I mean don't try to read the status of a switch connected to the mains.
 
there is no power going to the switch.

as i understand it(possibly wrong) the solution proposed would not need any additional power supply as the 5amp pull up resitor would supply the parallel port with a on state and by openeing the switch it would cause a short and drop to a off state. so it would be in affect a one bit data stream

i as stated in my original question electronics is not my strong point(dont ask what is i havent found it yet)so if you can see that i have missed the point please feel free to tell me
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top