How to connect to a Computer?

Discussion in 'The Projects Forum' started by jmccoy125, Dec 7, 2008.

  1. jmccoy125

    Thread Starter New Member

    Dec 7, 2008
    3
    0
    I am trying to connect a voltage comparator to a computer. I want to use the data from the comparator to trigger something in a program I have on the computer, but I'm stuck as far as how to get a connection to the computer. Anybody have any good ideas?

    I was thinking maybe through the serial port or the USB port. If anyone had any tutorials, how-to's, or suggetions that would be great.

    Thanks
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Is this a computer, as in a desktop, or a microprocessor?
     
  3. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    Radio Shack sells a DVM that connects to the serial port, what more could you ask for? :)
     
  4. jmccoy125

    Thread Starter New Member

    Dec 7, 2008
    3
    0
    I plan on connecting it to a PC not a microcontroller.
     
  5. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    The parallel port is a simple way to connect the comparator, provided the output is at logic level - 0 to 5 volts.

    The problem is getting the computer to see the input. A few lines of code in any language that allows hardware level access will let you set the port to input and look for the bit changing.
     
  6. jmccoy125

    Thread Starter New Member

    Dec 7, 2008
    3
    0
    I don't have a parallel port on my PC though. Would I need a parallel to serial converter or just interface directly through the serial port.
     
  7. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    We're talking RS232 here, I'm not sure what you're refering too. You can get an external RS232 card for your computer.
     
  8. leftyretro

    Active Member

    Nov 25, 2008
    394
    2
    If you have a serial port (COMM port) on your PC then there are control signals already on that port for reading a digital input signal (DCD, etc) however you must insure your digital signal is electrically compatilbe to the RS-232 standard or go through a voltage level switcher. On the software side you have to have or write a program that can read the comm port control signals and that whatever action you wish it to take.

    Lefty
     
  9. DickCappels

    Moderator

    Aug 21, 2008
    2,662
    633
    If your computer has USB, here is a very crude method, but on that is quite likely to work: Take a cheap keyboard apart, figure out what needs to be shorted on the controller chip to simulate a given keystroke, then use a transmission gate such as a 74HC4066 to simulate the contact closure.

    Here is a similar hack:
    http://www.geocities.com/AirPanther/keyboard.htm

    With USB you can use two keyboards - one for you and one for your applicaiton circuit (actually, you can throw away the keyboard and just keep the part with the controller chip), and most likely, your program can take input from the console (USB keyboard in this case) without having to come up with any special drivers.
     
Loading...