PWM via USB?

Thread Starter

wayneh

Joined Sep 9, 2010
17,498
Is there a way to use a computer's USB port as a PWM controller? I think I know how an analog audio port might be used; I could use a tone generator to send a variable duty cycle square wave at, say, 5kHz to a comparator driving a MOSFET. Power would have to come from a wall wart or the USB port. But I'm thinking the 5v power of the USB port could drive a logic MOSFET directly, and thereby give a nice simple PWM controller for cheap.

Now, I already have a LabJack which is a USB powered data acquisition device. It's perfectly capable of performing the PWM function. But it's ~$115, and I'm wondering if there is a solution that might be <$5. I think it's "just" a software problem, but maybe someone here knows more about USB?
 
The Labjack is cool, a cheaper solution would be either a PIC (the 18F2550) or an Arduino as both support USB & PWM. I'm biased but I'd go with the PIC and something like JAL2 to program it. Not sure but the UBW might support PWM and that would be a good fit if it did.
 

Thread Starter

wayneh

Joined Sep 9, 2010
17,498
I see that PIC is cheap enough, but I have zero experience with such things. What would it take to get a working PWM solution using computer+USB+PIC 18F2550? What are the software options?
 

Thread Starter

wayneh

Joined Sep 9, 2010
17,498
Interesting link. I think that approach could definitely work, but for me personally there would be a considerable learning curve since I'm not a programmer.

I think what I'm hearing is that there is no really simple and direct approach that doesn't involve another piece of hardware in between the USB and the device under PWM control. The hardware options range from $5 (IC only) to $115 (full overkill), and they all require some programming. The only option I can currently program with confidence is the LabJack, which I can control with ease in Excel using Visual Basic.
 
Top