My fully custom 18650 Flashlight prototype with a 3D printed body.

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
For the past few months i have been working on this and i finally got some documentation and the prototype done.
This is a completely scratch designed flashlight that is powered by 18650 cells from old notebook battery packs.
It uses a fully custom circuit to drive the LED and manage the battery.

tEquVYv.jpg


Fully 3D printed main body.
Dimmable in 31 steps, no PWM.
Rechargeable with a regular phone charger.
Uses a single 18650 Lihium Ion cell.
Battery level Indicator.
Three button interface.
Arduino IDE compatible microcontroller.
Full battery management and protection.

Light output: 197 Lumen.
Color temperature: 5000K
Color rendering index: 83
Efficiency at 100mA: 159 Lumen per Watt
Efficiency at 250mA: 119 Lumen per Watt
Runtime: TBD

Height: 110mm
Width: 45mm
Depth: 26mm
Weight: 130g (with battery)

Here is the full documentation including a ton of pictures:
https://hackaday.io/project/21001-brightenmacher
 

rayman

Flashlight Enthusiast
Joined
May 6, 2008
Messages
1,219
Location
Germany
Great work ;-).

I had the idea of a flashlight controlled by an Arduino some time ago too. So you wrote the code in Arduino IDE?
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
Great work ;-).

I had the idea of a flashlight controlled by an Arduino some time ago too. So you wrote the code in Arduino IDE?

Thank you, it is technically not an Arduino but the chip is compatible with the Arduino IDE if you add the right board.
Early designs had it programmable through the USB connector but that had to be scrapped for several reasons.

I wrote the code with the Arduino IDE and use it to program the whole thing with ISP adapter, yes.
Once my code is not a huge mess anymore, i will add it to the repository. :)
 

rayman

Flashlight Enthusiast
Joined
May 6, 2008
Messages
1,219
Location
Germany
Great, looking forward to that ;-).

I already did some projects with Arduino but not combined with a flashlight. Your project looks so great, I might have to do something similar ;-).
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
I already did some projects with Arduino but not combined with a flashlight.

This is by no means my first project with a microcontroller, i started playing with them long ago, before they had invented the Arduino brand.
But after i discovered the Arduino IDE i started doing more with them, the available librarys make things so much simpler.
Not having to go through the datasheet and looking up in what register you have to set this and that bit just to get something done, i will gladly deal with the simplified and somewhat stupefied Arduio IDE over that.

If i were better at programing and had to start over i would not use them for this project, a low power Texas Instruments µC would be way better suited to this task.
But what do they say?
If your only tool is a hammer, every problem looks like a nail!
 

rayman

Flashlight Enthusiast
Joined
May 6, 2008
Messages
1,219
Location
Germany
@PeterFH

So what language did you use before you came to the Arduino IDE?

All I did was use three step-down-converter with a PT4115 on it and hook that up with an Arduino over PWM and a RGB emitter and now I can drive it at any color I want.
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
Very nice mod. Love watching people create amazing lights..[emoji106]

Thank you!

@PeterFH
So what language did you use before you came to the Arduino IDE?

The language is the same, almost.
I used AVRStudio from Atmel, i think it is called AtmelStudio now, that used C.
The ArduinoIDE uses something that looks like C/C++ but that is not the important difference.

With AtmelStudio you have to write to the registers and the Arduino IDE provides pre-made functions which makes things so much simpler, you can do the same with C but you will have to write these functions for yourself first.
For example, i want to read the voltage on analog pin 0.

C in AtmelStudio:
void ADC_Init(void)
{
ADMUX = (1<<REFS0);
ADCSRA = (1<<ADPS1) | (1<<ADPS0);
ADCSRA |= (1<<ADEN);
ADCSRA |= (1<<ADSC);
while (ADCSRA & (1<<ADSC) ) {
}
(void) ADCW;
}

uint16_t ADC_Read( uint8_t channel )
{
ADMUX = (ADMUX & ~(0x1F)) | (channel & 0x1F);
ADCSRA |= (1<<ADSC);
while (ADCSRA & (1<<ADSC) ) {
}
return ADCW;
}

int main( void )
{
uint16_t adcval;
ADC_Init();

while( 1 ) {
adcval = ADC_Read(0);
}
}

And now the same in the ArduinoIDE

int val = 0;

void setup()
{
}

void loop()

{
val = analogRead(0);
}

All that brings overhead with it but you can clearly see why one is way less of a pain in the arse for someone who hates to write code or just wants to get started.
If you need to do it like the first example in the ArduinoIDE you still can do that, nothing stops you from that.
But you do not have to.
 

rayman

Flashlight Enthusiast
Joined
May 6, 2008
Messages
1,219
Location
Germany
It definitely is shorter and easier with the Arduino IDE but I think I will look into C. Already downloaded AmtelStudio now I just have to start sometime ;-).
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
It definitely is shorter and easier with the Arduino IDE but I think I will look into C. Already downloaded AmtelStudio now I just have to start sometime ;-).

Do yourself a favor any buy a AVRISP MK2 of Ebay, they cost around 25 Euros at the moment.
They can measure the target voltage and you do not have to worry about level shifting when working with battery powered devices.

They AVRISP can not program the new stuff but the ATMEL-ICE is much more expensive and i do not think you will want to put one of the new fancy 32 Bit µC in your flashlight :)
 

rayman

Flashlight Enthusiast
Joined
May 6, 2008
Messages
1,219
Location
Germany
Thanks for the advice ;-), I will surely look into that. So what are your next steps with this project?
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
So what are your next steps with this project?

Good question, i still got this running as a "Just for me, just for fun"-thing, but a few people seemed to be interested in this thing.
So my road map looks roughly like this:


  • Finalize the new driver PCB and route the metal core PCB (got 90% done with that today)
  • Create a complete BOM with prices, part sources and part numbers. (Ever so lightly started with that)
  • Order the PCBs and a few parts i am missing.
  • Re-design the body and button mechanics.
  • Assemble the new boards.
  • Print new body.
  • Thoroughly stress test the electronics, characterise and (try to) break them.
  • Thoroughly stress test the plastic parts and (try to) break them.

From there... maybe a small run of boards, see if someone wants a test unit, ship a few to some testers for the cost of material.
That will have to be seen.
I thought about creating a poll or something if someone is interested before building a few since i got to put down a bit of money to get this done but i think ill just take the risk and then see if someone wants some.

Very nice.

Thank you!
 

Str8stroke

Flashlight Enthusiast
Joined
Nov 27, 2013
Messages
5,032
Location
On The Black Pearl
Neat project and good documentation & read. Took me a while to find it, but you didn't forget Heat Management. Good Job, thank you for sharing.
 

rayman

Flashlight Enthusiast
Joined
May 6, 2008
Messages
1,219
Location
Germany
Sounds great ;-), Im really interested in how this project will proceed.
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
Sounds great ;-), Im really interested in how this project will proceed.

I will try to remember to post updates here! :)

Neat project and good documentation & read. Took me a while to find it, but you didn't forget Heat Management.

Thanks!
The part about the heat management i think i will have to write a bit more about, most of the stuff i did not document or just went over in brain-CAD, so there is not much documentation on how i settled on this solution.
Some were really fiddly all tough i do have to admit, my favorite heatsink design was pretty damn nifty and good looking but would have been a pain in the arse to put together.
There had been so many different ideas, even tried thermal simulations but could not get the program to cooperate.

Even how it is now, that is not the final design, one thing that helps are the high efficiency LEDs, way more lumen per watt of heat.

Very cool light. Good luck with the rest of your project!

Thanks!
 

PeterFH

Newly Enlightened
Joined
Sep 23, 2016
Messages
60
For the past days i have been doing some math and i have come up with some numbers, but before i say anything about them...

Who would want to buy a Driver + Metal Core PCB + Nichia LED?

It would be 90% assembled, you would have to solder in the switches and the battery/LED/sensor wires.
A set of 3D printed parts may be possible as well but the Bulk of the cost is made up by the electronics.
The battery you have to get yourself, thanks to laws and regulations i can not ship lithium batteries.
 
Top