# Solved: USB Light software



## andythepandy (Jul 2, 2006)

Hi,
I have made a simple USB light. I need to be able to control the voltage with a very simple piece of software that will sit in the tray. How would I go about controlling the voltage outputted through the USB port.

Thanks in advance, 
Andy


----------



## cancon (Jul 22, 2005)

That's not possible, because the connection to the motherboard from a USB device is a constant voltage.

How about a variable resistor on your end?


----------



## Ent (Apr 11, 2009)

What about adding a voltage divider_one or more side branches opened by a transistor tacked onto a USB pin. Then you could tell your software to give a value to that port, and in particular that particular pin. The problem is that this makes your device even more complicated, and diverts some power from the lamp.


----------



## andythepandy (Jul 2, 2006)

Thanks for the replies. If it is a constant voltage from the motherboard, how come my light starts to flash after about 30 seconds?!

Thanks,
Andy


----------



## cancon (Jul 22, 2005)

By flash you mean intermittent light? or actually start flashing??! Any problem like that would be with your connection. USB is an industry standard, and for regulation purposes power output cannot be modified by software. It would be pretty agitating if I plugged my thumb drive into another PC and had it fried...

Check this out.


----------



## andythepandy (Jul 2, 2006)

The light goes on and then off and then on repeatedly. I have checked all my connections...no problems.

Andy


----------



## cancon (Jul 22, 2005)

did you try another USB port?


----------



## Ent (Apr 11, 2009)

If you don't actually have a driver for the light, mightn't the computer itself be asking it "what exactly are you meant to be?" If that is the case it might be giving power for its handshake routine, and cutting it when the connection times out. I guess that we cannot really know without actually seeing the design.


----------



## cancon (Jul 22, 2005)

One solution I can think of is to get a variable resistor you can control over USB and use that in a circuit.


----------



## andythepandy (Jul 2, 2006)

As for the design of the light, it is literally wired into the + and - wires of a usb cable.


----------



## JimmySeal (Sep 25, 2007)

By + and - do you mean VCC and Gnd? If it's D+ and D- it would be no surprise that it's flashing.
Is your light designed to work at 5V with the current supplied by a USB port? It could be that your light is draining more current than the port can source and causing it to intermittently shut off.


----------



## Ent (Apr 11, 2009)

My knowledge of hardware is really mostly theoretical, and I have no way of knowing whether these will work. Anyway I have done a wiring diagram for three different ways of changing THE BRIGTNES OF YOUR LAMP. None actually adjusts the voltage though.

The first is basically a binary electronic version of the Variable resistor, the second is built as a voltage divider. The third is the easiest way to increase the brightness--it should allow you to turn lights on and off.

I would appreciate it if someone could check that these make sense.


----------



## Ent (Apr 11, 2009)

Whoop, I forgot to say. P means a wire to one of the pins. I could have drawn it, but it looked hideous.


----------



## andythepandy (Jul 2, 2006)

It is just a small light bulb, like the ones you see in schools. I dont know how much it is trying to drain from the USB but it sounds like that is the only explanation. It is attached to the Red and Black wires from the USB wire.

Thanks


----------



## andythepandy (Jul 2, 2006)

I just discovered what the problem was, the light was one of those old flashing bulbs.
I'm so stupid.

Thanks for all the help,
Andy


----------



## cancon (Jul 22, 2005)

What about the software controller? I was interested to see what would come of that...


----------



## andythepandy (Jul 2, 2006)

I decided to leave that as it looked like it was going to be a pain. If I ever do find a simple solution, I will post it here.
Andy


----------

