Making an Ardunio-controlled bike light

Hi,

I've been planing this project for some time and now when ADK is available this would be easier to make.

The problem is I'm a programmer, and I know little in electronics.
I would like to use an Arduino pro mini board for this project: http://www.sparkfun.com/products/9220
I would also have to mount a USB host shield: http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini/

So now I have two problems:

  1. Where can I find a led driver for a cree led? (http://www.dealextreme.com/p/mj-808-ha-iii-ssc-p7-c-sxo-3-mode-900-lumen-led-bike-light-set-44459)
  2. How can I connect the battery of the flashlight to the Arduino board, and then to the driver?
  3. Probably not related to this forum. Do you think there are any pins left on the pro mini after connecting the USB host shield?

I have no problem paying for a good, small footprint board if there is, or to someone to make me one.

Thanks!

  1. Where can I find a led driver for a cree led? (http://www.dealextreme.com/p/mj-808-ha-iii-ssc-p7-c-sxo-3-mode-900-lumen-led-bike-light-set-44459)

Are you proposing to obtain that led and batter/charger package from that link, or are you asking about just a possible driver module for a bare cree led? If the latter which size cree led? If the former the driver is built into the lamp assembly, you only have give it a constant voltage equal to a two cell li-po battery (6-8.4 vdc).

  1. How can I connect the battery of the flashlight to the Arduino board, and then to the driver?

You will have to come up with a compatible power plug 'splitter', so that there are two output plugs from the battery, one for the lamp assembly, and other to wire to the 'raw' and ground pins of the pro mini. What's not clear in this post is do you want the pro mini to be able to command the lamp on and off or does the pro mini have no function concerning the led? If you wish to have the pro mini be able to command the led on and off you are going to have to have either a transistor or relay between the pro mini and the led assembly as you cannot control that high a voltage and current directly from a pro mini output pin.

  1. Probably not related to this forum. Do you think there are any pins left on the pro mini after connecting the USB host shield?

The pro-mini like all 328 based arduino boards has 14 digital I/O pins (pins 0-13) and 6 I/O pins (pins A0-A5) that can be used as digital I/O pins or as analog input pins. The usb serial converter module only utilizes two of the pro-mini I/O pins, pins 0 and 1. So still 18 I/O pins left over to utilize.
Lefty

Yes, I would like to be able to control the led on and off, and even change the brightness and have a blink feature. Is this done by a single component? And if so than why are led drivers so complicated?

omni96:
Yes, I would like to be able to control the led on and off, and even change the brightness and have a blink feature. Is this done by a single component? And if so than why are led drivers so complicated?

As the driver is internal to the lamp assembly I don't think you can do much more with the arduino then to turn the lamp on and off, which would make your arduino kind of a expensive on/off switch. Constant current drivers are only as complicated as they need to be, no more, no less.

Lefty

I am planning to remove the circuit from the light. And it actually does other stuff like showing battery level so I guess the driver itself is less complicated. So how can i translate PWN to led brightness level?

Once you've taken one apart and seen what the built-in circuitry is like, it might be easier to say what can be done. Certainly the bare LED and battery could be interfaced to Arduino with a current-limiting resistor and a MOSFET and driven by PWM. Looks like the LED is one of the 12W ones (4.2V @2.8A), but its hard to be sure without disassembling the light...

MarkT:
Once you've taken one apart and seen what the built-in circuitry is like, it might be easier to say what can be done. Certainly the bare LED and battery could be interfaced to Arduino with a current-limiting resistor and a MOSFET and driven by PWM. Looks like the LED is one of the 12W ones (4.2V @2.8A), but its hard to be sure without disassembling the light...

Those high power LED usually don't work well with using just a current limiting resistor, hence the use of a constant current driver circuit in most higher power led drawing 300ma or greater.

Lefty