Home > categories > Electrical Equipment & Supplies > Control Cables > Can I use the USB port to send simple on (+5V) / off (0V) control signals?
Question:

Can I use the USB port to send simple on (+5V) / off (0V) control signals?

I just want to control an LED or a switch, from VB I'd like to avoid buying a controller board / interface

Answer:

Unfortunately not. There are four pins on the USB port, two are for voltage and the other two are a bi-directional twisted pair for two-way communication (The twisted pair actually carry the same signal.twisting them causes any noise that appears on the line to cancel out, which allows for much higher transfer rates). The USB protocol is fairly complex, and you can't programmatically control any of the pins. If you want to control data pins via the USB port with the minimum amount of effort then I'd suggest using a PIC18F4550. This is a dedicated USB client chip that can be used to implement many types of devices, including standard HID (keyboard, mouse, joystick, user etc). I've used it before several times and it's always been dead easy to program for, it's easier than most other PICs because you can also program it via the USB port while it's plugged in. You can also get a free C compiler for it, plus lots of sample source code, from the Microchip web site.
Yup! When you open a USB cable, there should be two wires, a green one (voltage) and a white one (ground). Just make sure you remember which one is which!
u have serial and parallel port why usb just try parallel port its too good and use matlab to manage the LED ;)

Share to: