...

View Full Version : [Hardware + Software][C++ or C#] USB Fan



Mywk
06-14-2009, 07:57 PM
Hey All,

I am a newbie C#, VB and PHP programmer and I know also some stuff in C++.

I started to play around with hardware last week when i had to fix some stuff in my mouse and i kinda liked it so:

I picked a old usb mouse cable and a old motherboard fan, then i stripped the usb cable, conected usb white wire to fan red wire and usb blue wire to black wire and fan is now working (i think the usb has only 5 volts because its a 12volts fan so its working at half of the speed).

There are two wires left, orange and green, i presume they are the wires that used to send data from mouse to the computer, here is a pic of the little stuff i made:

http://www.techcoders.net/mywk/usb.jpg

I want to do a software that first detects if it plugged in (is it possible to send a number through the orange or green wire then it reads it? if its the correct number it means the fan is plugged in), then it will increase or decrease the voltage of the blue or white wires! (It can be C# or C++)

Thanks In Advance,
Best Regards,
Mywk

oracleguy
06-15-2009, 06:06 AM
That is a cool thing to try. USB does run on 5 volts, not 12 as you were thinking. To know a little bit more how USB sends its data, you might want to read up on differential signaling (http://en.wikipedia.org/wiki/Differential_signaling). That is why it has two data wires. You can use a chip to convert the signal back to one data line.

Sadly it won't be quite as easy as you think to do what you want. Getting the data lines merged back together isn't that hard per-se. However the way the computer knows how to route data is that there is a protocol that the bus uses so different devices can identify themselves and the data gets routed correctly. Which means without a controller chip, your fan can't identify itself properly.

If you are interested in controlling your fan with software, I'd suggest you try an easier interface. A serial port or a parallel port is so much easier to work with from a software perspective and a hardware perspective.

Mywk
06-15-2009, 10:24 AM
That is a cool thing to try. USB does run on 5 volts, not 12 as you were thinking. To know a little bit more how USB sends its data, you might want to read up on differential signaling (http://en.wikipedia.org/wiki/Differential_signaling). That is why it has two data wires. You can use a chip to convert the signal back to one data line.

Sadly it won't be quite as easy as you think to do what you want. Getting the data lines merged back together isn't that hard per-se. However the way the computer knows how to route data is that there is a protocol that the bus uses so different devices can identify themselves and the data gets routed correctly. Which means without a controller chip, your fan can't identify itself properly.

If you are interested in controlling your fan with software, I'd suggest you try an easier interface. A serial port or a parallel port is so much easier to work with from a software perspective and a hardware perspective.

I'm actually getting a lot of support here: [Hardware + Software][C++ or C#] USB Fan (http://cboard.cprogramming.com/cplusplus-programming/116835-%5Bhardware-plus-software%5D%5Bcplusplus-csharp%5D-usb-fan.html)

"I did some more research and you are actually right, i can't regulate the voltage of the USB port, however i can power the fan using external 12v power adapter then regulate the amount of volts the fan will receive with my device."

I'm really interested in to use USB and not serial or parallel ports.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum