Home > categories > Electrical Equipment & Supplies > Control Cables > How can I control a servo with my computer's USB using no external micro controller?
Question:

How can I control a servo with my computer's USB using no external micro controller?

I have a USB cable and a servo, and I need to put the servo in 2 different positions. (I'm using it to lock and unlock a cabinet) So really what I need is a simple computer program that can give the servo information on where to be. I'll only need to use 1 information wire which will control the position and I can just power it with the power wires. The problem is I have no idea how to write computer programs that will interact with USB ports. I'm familiar with Arduino which is a language for controlling the Arduino micro controller. It's similar to C. But I don't want to use a micro controller for this. I want it to be controlled by my computer. I think C is what I would need to use for this? Anyway, I need to know how to do this, what program, what language, and how to make it a simple program that I can save onto my computer and access quickly at any time, etc.

Answer:

USB connections have only 5v,ground and two data pins. A (typical) servo has power,ground, and signal. In order to use it with USB directly you would have to connect the power and ground pins from the USB cable and to the servo and the only way to send signal to the servo via the data pins is to send a bunch of binary or attempt PWM.
Basically, you CANT! When you plug a USB cable into your computer it finds out what hardware is on the other end and loads the proper driver for that hardware BEFORE that USB port is activated. There is NO driver for controlling a servo connected directly to a USB cable! Even then, there may not even be enough power on the USB cable to even actuate a servo. Bottom line, you need hardware in between the USB cable and the servo.

Share to: