USB switch

Discussion in 'General Electronics Chat' started by Anadolu, Oct 15, 2012.

  1. Anadolu

    Thread Starter New Member

    Oct 15, 2012

    I want to control a program written in VB through a USB port on a PC. The idea is this. Currently a function in my program is activated by pressing a software button on the GUI. I want to use a switch (a push button) connected one of the USB ports instead for this function. I have a Serial to USB adapter cable. I believe I should be able to connect a push button switch to RS232 end to change the state of the receive pin so that OnComm event of the Serial control is activated. So if I pool receive buffer continuously I should be able to detect the data (high or low?) and initiate my function. But I do know how to do the electronics. Where should I connect the switch? There are three important pins on the serial end of the adapter: 2: Receive, 3:Transmit, and 5: Ground. Do I need to power the one end of the switch with 5V? How long do I need to press the switch?

    There might be simple USB switches that do what I need. I am open to any suggestions. I just need to have a very simple and small circuit without any extra power other than the 5V supplied by the computer through the USB port.

    Thank you
  2. panic mode

    Senior Member

    Oct 10, 2011
    if you connect switch between pins 2 and 3 you can send data to serial port. if anything comes back switch is closed. if nothing comes back, switch is open.