How To Build a Flashlight With Perfect Modes (picture heavy)

[quote=Benik3]

Thank you very much Sixty545

[/quote]

You're welcome, Benik3!

[quote=Benik3]

EDIT: After flashing the driver I must disconnect a star?

After flashing a driver with stars on it, the old program is erased and the stars have no function anymore.

(Myself, I use the star connected to the MCU pin2 to mount the 3 components for pin-switching mentioned in my former post).

[/quote]

A very easy solution is to replace the Tiny13 with a Tiny 85... it has 8K of code you can bloat in. Life's too short to waste time squuezing bytes these days. It does take some tiny soldering skills to do, but is easily manageable.

Generally, the Tiny85 PWM and peripherals are compatible with the Tiny13. One difference is the Tiny85 internal RC oscillator runs at 8 MHz (vs 9.6 MHz for the Tiny13). Should not be a problem.

I converted my driver for the 5000/9000 lumen Bridgelux arrays (yep, my flashlight is brighter than yours ) from a Tiny13A to a Tiny85 and all I had to do was recompile the code with the Tiny85 processor type flag. There are a lot of enhancements in the Tiny85 that you can take advantage of if you want.

Hmmm... Question. (tried to search, no luck)

I got couple of 101-AK:s from SB to take my shot in the flashlight programming. Still waiting for the SOIC8 clip. The right two legs of my drivers are bridged, just like explained in flashlight-wiki (to set to 3 modes from 5 modes). Do I need to un-bridge (separate) the legs before attempting to flash?

If you mean pins 3 (PB4) and 4 (GROUND) then you should be OK. Pins 2 (PB3) and 3 (PB4) are not used during programming. All the other pins are used when programming.

3 and 4 they are. Thanks for the info

Pictures...pictures...We need Pictures!! :)

I got mine to work! I did too much research and thought only 4 pins needed to be connected, but once I added GND I was all set. I was able to download the 4 setting files from an AK-47. I haven't tried to upload anything yet. Are the fuse settings ever changed? Couldn't we leave those alone?

Ok,

The array mounted on a CPU heatsink. This the the C4500 array. Made in USA. Has real, legitimate spec sheet. Outputs over 5000 lumens at nominal drive (60 watts). Can be pushed to over 1.5 times that. At 60 watts in (26V, 2.3A) it puts out more light than any 100 watt Chinese array. They have released a 9000 lumen/80 watt array (pushable to 15,000+) that is the same size. I have them on order (delivery date has slipped three times now out to June).

Here the array mounted on a cut down heatsink with 50mm fan. 28 degree Ledil reflector. LED controller. 8S1P A123 battery pack.

The LED is mounted on a cut-down AMD CPU heatsink. It fits in a 3 inch diameter tube that matches the reflector diameter. That's a 50 mm 24V fan on the back. The LED controller adjusts the fan speed depending upon the heatsink temperature. If it gets too hot, it will shut off the LED. Fan comes on at 120F, ramps up to full speed at 152F. Shuts off at 110F. At less than 8W or so drive, the fan does not come on.

The controller is a modified LED dimmer from DALEWHEAT.COM I rewrote the firmware (Atmel ATtiny13A) and changed the voltage regulator so that it draws less than 20 microamps when the LED is off. It is analog dimmable with a pot from 0 to full power in 255 steps. You can also use a pushbutton to step between light levels. Added a second PWM channel to control the fan. There is no power switch. Just turn the knob down and it goes to sleep. At 20 microamps it will drain the pack in about 10 years.

The 70mm Ledil reflector makes a VERY smooth beam with no hotspot. 28 degree beam width at half intensity. I have the reflector mounted so that it can be removed for a 110 degree beam. They also have a medium width reflector.

The battery pack is 8 A123 Systems 26650 2300 mAh LiFePO4 cells in series. It will run the light for an hour at full intensity. About 2 weeks at minimum. Those cells are very deceiving. They can put out 200 amps! One of those 4 cell sub-packs will start a car 20 times in -20 degree weather! Does your flashlight have jumper cables? LiFePO4 chemistry is intrinsically safe. Won't go into thermal runaway or burst into flames, etc.

The LED controller is essentially direct drive. The LiFePO4 chemistry has a very flat discharge curve. 90% of the discharge is between 3.3V and 3.2V. No need for a regulator. The LED controller code does monitor the pack voltage. Too high or too low and it shuts down. A little high and it backs off the PWM to protect the LED and produce what appears to be a regulated output.

Beamshot down 100+ foot driveway (pitch black otherwise). Hard to get a good exposure since the foreground overdrives the camera. This thing will light up a 70+ foot wide tall two story house like it's daylight. Without the reflector it is a 110 degree flood. With the reflector it is 28 degree.

Is it a budget light? Yep, for a portable sun. LED is now $45. Reflector 5 bucks. Heatsink/fan 5 bucks. LED controller 20 bucks (with mod parts). Batteries can be had for around 50 bucks. Free if you can find a "dead" DeWalt 28V pack with a bad cell or two. Package it to suit your tastes.

Awesome thanks for all the details :)

"Does you flashlight have jumper cables?" Nope. You got me there.

I am always impressed with endeavours like this.

pushingtheenvelopeFoy

[quote=texaspyro]

A very easy solution is to replace the Tiny13 with a Tiny 85... it has 8K of code you can bloat in. Life's too short to waste time squuezing bytes these days. It does take some tiny soldering skills to do, but is easily manageable.


I converted my driver for the 5000/9000 lumen Bridgelux arrays (yep, my flashlight is brighter than yours ) from a Tiny13A to a Tiny85 and all I had to do was recompile the code with the Tiny85 processor type flag. There are a lot of enhancements in the Tiny85 that you can take advantage of if you want.

[/quote]

-------------------------------------------------

Tanks for the tip texas, a very tempting switch, but I wish I were at least 20 years younger. Can the job be done with an air blower, pliers and solder paste or are more sophisticated tools needed?

That is one awesome "flashlight" you made out of that Bridgelux, not for any kids to play with.

to brted: Congratulations with getting it to work!

I never managed to read stock drivers programs properly, only unusable code came out. I even tried to change fuse settings before reading to "unlock" the code. Only after flashing the driver I can read back my own program.

I don't know if I downloaded it correctly or not, but I did get the 4 files anyway.

I went ahead and flashed the programmable UI into a AK-47 that one of my lights uses. The Low is very impressive, about equal to the iTP A3 which is only 2 lumens. But I think the Low Battery is set too high or something because I was having a hard time with programming new modes. I don't think the Low Battery should be included by default since the settings involved are specific to whatever resistors the board is using.

I have no idea how to get started modifying and re-compiling programs. I had WinAVR and Eclipse installed, then decided that was too complicated, so I tried out AVR Studio 5 which people seem to like, but I don't even know what to do with it. There is only one driver.c program, but it seems to generate Simple, Extended, and Programmable?

I'd like to set up a 2-mode light with one of the modes being High and the other being one of several different lows: an indoor low of 1 or 2 lumens, an outdoor low of about 10 lumens, and a medium of maybe 50% in order to extend battery life. So what I'd like to get is set up some way of easily switching the Low mode only by tweaking and simplifying the programmable interface. With only 2 modes, I don't know that I would need memory, it could just always start in Low. Then I could single-click for Low or double-click for High. Or vice-versa, I kind of like the idea of the light not coming on immediately until you've had time to double-click, in which case a double-click for Low might work and you wouldn't be blinded by High flashing on first.

But right now I'd just settle for being able to turn off the Low Battery and recompiling the code.

. . . Think I'm getting a little closer. There was a "for" loop that AVR Studio didn't support (said to use c99, but I don't think that is supported), so I declared the variable before the loop and it seems to have compiled without any errors. I'm not sure what actually compiled though.

. . . 1 step forward, 2 steps back. Now one of the pins in the teeth of my clip has slid back, so the clip isn't making contact with the chip anymore. These clips are the worst pieces of crap I've ever had the displeasure of working with. Another $12 down the drain. I'll try to repair it when I'm less likely to throw it at a wall.

You can probably do it with just some small lead cutters, a fine point soldering iron, and fine point tweezers (and geezer goggles). Easy way to remove the chip is to cut the leads to the chip. Then use the soldering iron and some tweezers to pick off the lead nubs. Easy on the heat... most cheap boards have poor adhesive holding the pads down. Refresh the chip pads with a small blob of solder. Put the new chip down and reflow a corner pin. Tweak the chip position and reflow the opposite corner pin. Then do the other pins. It helps to push the pin down into the solder with the tweezers as you heat it.

Other useful things to have are liquid solder flux and/or solder wick. The liquid flux helps prevent solder bridges. The solder wick helps remove them. I solder surface mount chips by flooding the pads/leads with solder. Everything gets blobbed together. Then I use a fairly wide tip and the solder wick to wipe down the length of the leads (from the package towards to tip of the leads). This removes the solder bridges and leave enough solder to mount the leads.

texaspyro,

Where do you get the LED and the lens?

DigiKey and Newark both have them. The C4500 array runs around $45 and the reflectors around $5. Bridgelux has recently updated the line with some new units (and some of the older ones no longer show up in their datasheets). They now have an 8800 lumen array... delivery date keeps slipping out on it. Bridgelux parts are made in the USA. They have proper data sheets and verified specifications (no Chinese bogo-specs and pseudo-lumens). I get more light out of a 60 watt Bridgelux array than any Chinese 100 watt array.

The older arrays have a volatge rating that is almost perfectly matched for unregulated direct drive with LiFePO4 cells. The newer ones are a bit problematic there. That 8800 lumen array wants to be driven by a 9.5 cell pack. A 10 cell pack might cause it to draw too much current. I might need to add some diodes in series with it to tweak the drive level... wastes a bit of power.

1 1 976-1011-ND LED ARRAY COOL WHITE 5000LM 0 46.02000 $46.02
2 1 711-1077-ND REFLECTOR FOR BRIDGELUX BXRA 0 5.19000 $5.19
3 1 711-1078-ND REFLECTOR FOR BRIDGELUX BXRA 0 5.19000

$5.19you

The driver from here should work corret http://www.dalewheat.com/news/12v-dimmer-kit-v2-now-available/?

Thanks for your help.

Yes, that is the dimmer that I started with. I modified it quite a bit. I replaced the voltage regulator with an LM2936 ultra low standby power device that also can work at a higher input voltage, I changed the FET to a higher voltage one, I added a second FET for controlling the fan, I added an LM34 temperature sensor, I added a voltage divider to measure the battery voltage, I rewrote the firmware.

It really is a neat little dimmer board. You can't beat the price. Buy a bunch... Dale is a great guy and can always use the business (even if he hates to kit up parts). I have modified them to do all sorts of things. I even have one driving a 2000+ watt heater in a composite curing oven with millidegree level temperature control.

Quoting myself here. Does not work. That goddamn solderblob between the legs very effectively prevents the Soic clip of getting contact on that side (legs 1-4). It's just not possible to get the connection with that stupid lump on the way. No way no how. I got my clip today and arranged the wires accordingly. I've DMM:ed all the wires and the clip and all of them shows they have contact to programmer. But still, no connection to the chip.

Funny thing is, not only I have couple of those pre-blobbed buggers (both 1,4 and 2,8 amps) here that are now about as useful to me as penis-flavoured lollipops, I have also more of them on the way. Splendid. Well, guess I'm off to KD or DX or MF to order more same drivers, only ones that are not ruined in advance.

Too bad just about the only thing exceeding my lack of soldering skills is my lack of un-soldering skills. But I might still try that, after good nights sleep. After all, I have plenty of them to practice with.

I've never had any luck unsoldering with copper braid, but recently got a solder sucker. Tried it out and didn't seem to do much better, but I was worried about melting the plastic tip. After watching a YouTube video of a guy using a solder sucker, that doesn't seem to be a big worry because it looked like he put it right on there (though he also went very fast; video wasn't zoomed in enough to get a lot of detail and doing it fast from the same angle over and over again added very little to my understanding).

I've added a lot to the Wiki page on this topic lately, though I'm stuck again now that my clip isn't working.

http://flashlight-wiki.com/AVR_Drivers

Don't think I will every try another lollipop. Thanks for that image . . .

You need to get a copy of Nick Earls' "Batchelor Kisses".

It seems to be out of print everywhere except Australia where the author comes from. Nick seriously gets it about what I do for a living.

Buy it. Read it.

Laugh a lot! I just about wet myself.

Then ask me about strawberry jam....

:bigsmile: