Page 1 of 1

USB LED project

Posted: Fri Dec 14, 2007 2:11 am
by Todd_Z
It's been a while folks, good to be back.

I'm trying to create a minimalist program which will make an led blink through the usb port. I have found that usb cables have two power (5v) which are always on and two data cables.

I am looking to eventually tie a website peripherals - but first I must make baby steps.

Does anyone know how I would go about sending such a "signal" across the data cables so as to get a voltage? Anyone know of any good reads to learn about this?

Thanks!

Posted: Fri Dec 14, 2007 3:51 am
by Oren
As a start, what programming language you are going to use?

P.S

5V is too much for a simple LED. 1.5V is optimal, so you will have to use a resistor and connect it in a series to the LED.
V = I * R, source is 5V and we want 1.5V to go to the LED, so we want the other 3.5V to fall on the resistor. Also, 20mA is optimal current for a LED, so we get:

R = V / I = 3.5 / 20mA = 3.5 / (20 * (10^-3)) = 175 Ohm
175 Ohm is not a standard resistor I believe, so in practice you'll want to use a 200 Ohm resistor.
You can also use a 100 Ohm resistor if you want the LED to emit more light.

Posted: Fri Dec 14, 2007 3:57 am
by Todd_Z
In the 200-level physics course on electronics here at umich.

Got myself a 220 ohm resistor in the mix.

I would like to use php since I am so comfortable with it - but i'll use anything if I can get it to work. C, perl, whatever.

Posted: Fri Dec 14, 2007 4:13 am
by Oren
Well I've never done this before with USB to be honest, but I did such things with LEDs, C/Assembler 8086 and the parallel connector. I'm sure it's very easy though... just google it. I do have some old notebook with info about the USB connector from Assembler 8085 class, but my guess is that you won't be using Assembler, am I right?

Posted: Sat Dec 15, 2007 3:10 am
by Todd_Z
probably not asm - too hardcore for me at this point.