Introduction: How I Made the Most Advanced Flashlight Ever
PCB design is my weak spot. I often get a simple idea and decide to realize it as complex and perfect as possible.
So I once looked an old "military" 4.5V flashlight with regular bulb that was collecting dust a. The light output from that bulb was pretty miserable and the batteries were non rechargeable, battery life was non existent. But its case was nice.
So I decided to give it a new high-tech heart.
So I asked myself: "How many functionalities do I want to build in?"
and I said: "Yes. All of them."
- excellent battery life which was archived with 3.7V 6000mAh ( 3x NCR18500A) rechargable Li-Ion battery. The battery life ranges from 20hrs to 6 hrs, depending on the power setting.
- highest possible efficiency LED diode I could find - Ultra efficient Cree XP-G3 (187lm/W)
- highest possible efficiency LED driver IC (more than 90%) - consumer LED drivers are only around 60% efficient
- I wanted to charge it through USB and with external adaptor up to 40V, so I could charge it anywhere with anything
- I wanted it to serve as powerbank as well, so I could charge my phone with it
- I wanted a state of charge indicator, so I could see how much juice is still inside
- and I wanted to fit everything inside that small case
So I needed to design a custom PCB that would fit inside its case and I needed to fit everything described above on that board.
Above is a video showing the whole design process. Feel free to watch, share, like and subscribe to my youtube channel :)
I will further describe the design steps in this instructable.
Hopefully this instructable will give some people perspective on what can be done and how much work it takes to do it and maybe even inspire some kids to become electrical engineers :)
Step 1: The Old Flashlight
This was a cheap-ish light, running off an 4.5V battery and was as bright as a regular candle.
It had cool, manually operated red and green filters which were very cool.
Step 2: Gutting the Flashlight
I gutted all the parts out and measured the internal dimensions. I needed to design the board that would fit in perfectly.
I decided to use 3 lithium batteries in parallel. The case was too small to use the classic 18650 cells. So I decided to use a little bit shorter 18500 cells - Panasonic NCR18500A with around 2000mAh each. So I had pretty good capacity of 6Ah total
This meant a space for the PCB was rather small. But they say: "one could manage if he tried" :)
Step 3: The Schematic
So I made this incredibly complex schematic. Don't ask me on hours I spent for this :)
I was searching and selecting the appropriate components for quite some days, before I settled to conclusion. This means browsing the manufacturer( Texas Instruments, Microchip, Analog Devices...) sites for the ICs by the category and selecting one that fits my needs. And the IC needs to be available to buy in smell quantities on sites like Farnell, Mouser and Digikey.
Wiring all the ICs is not as difficult as it seems, because the manufacturers always include one basic wiring diagram in the IC datasheet. I will not go into details here on the schematic, if any question arises, feel free to ask in the comments.
The schematic includes the following sub-circuits:
- Battery over-charge/over-discharge and over-current protection that keeps the battery within safe operating limits.
- USB slow charge controller - used for charging the flashlight slowly via micro USB port. This is added convenience, but the flashlight could charge for up to 12 hours via this option I added a switch to select the charging current between 100mA (USB 1.0 current limit) , 500mA(standard USB current) and 800mA (wall charger)
- Fast charging controller - this IC controls the charging via the DC jack connector mounted on the battery case. It can handle input voltage from 5V to 40V, has a reverse polarity protection and can charge the battery in few hours max. I added a switch to select two different charging currents depending on the limitation of the power source. The current is selectable between 1A and 3A. This way you can not overload a lower powered DC wall adapter. I wanted it universal :)
- LED driver - I chose a high efficiency (90%) LED driver, capable of driving the LED with up to 1A of current (around 3W). This is pretty low power, but I chose highest efficiency LED I could find - Cree XP-G3 (187lm/W) which makes up for low driving power. I wanted highest possible efficiency and battery life. The driver supports 4 settable power settings. I chose Off, 1W,2W and 3W.
- The rotating switch to binary decoder - this is because the LED driver power outputs were binary coded and I needed to convert the output from a switch to 2 bit binary code with dual OR gate IC.
- Battery fuel gauge indicator I designed discretely with 4 comparators, precision voltage reference and precision resistor dividers. It indicated the remaining capacity based on battery voltage. I found a discharge voltage curve for a similar battery cell and calculated the resistor dividers so they light up the LEDs accordingly.
- USB powerbank function and fast charge controller. The first IC generates a stable 5V IC from the 2.5V - 4.2V battery voltage. The second IC is a nice addition - it is a USB charge controller. When you connect the phone to charging port, this IC communicates the phone and tells it what this is a smart charging port and tells the phone that it can take up to 1.5A of charging current. Without this IC many phones would charge only with the USB default current of 500mA. When fast charging is established it lights up an LED so you can see that the phone is fast charging. A little switch on the PCB is used to enable powerbank functionality.
If you believe or not, on this schematic there are 125 components :)
I order to fit them on a very small board I had to use miniature 0402 sized passive components - one resistor size is 1mm x 0.5mm or 0.04 by 0.02 inches. Hence their size 0402.
Step 4: The PCB
Then, when the schematic is complete, it is time to shape the PCB area to the desired dimensions and place the components on the PCB.
This is quite lengthy task, but you will enjoy doing it. It is a nice and relaxing job.
A little knowledge about particular component placements comes in handy. It is mostly obtained with books and tutorials and some come in practice. The more PCBs you will make the better you will become at doing it.
I use Altium Designer which is a professional program and I get a license from my job. But for a hobbyist, an Eagle, Kicad, designspark PCB and many other are a better solution since it is much easier to get started.
I work with components also drawn in 3D, which helps a lot for visualizing and for designing the enclosures, because you know where things are and how high they are. But drawing the component footprints with 3D bodies takes 3 times as much work. But it is worth it in the long run.
Here is the PCB design data including gerbers, larger schematic files, assembly and bill of materials:
I use JLCPCB for making my boards.
The cost of this board is only a few $ for 5pcs (plus shipping) which is a bargain! Sign up to get $18 new user coupons: https://jlcpcb.com/IAT
You can use coupon code "JLCPCBcom" at checkout for a small discount.
Step 5: Manufacturing the PCB
The days of etching the PCB at home are numbered. In high school 10 years ago I used to etch my PCBs at home. It was way cheaper that way. But then there were no Chinese companies offering PCBs for almost free. :)
Now you can get 2 layer PCBs made for 2usd + shipping at sites like JLCPCB.com. It is way more convenient this way and you get professional grade boards.
You just need to export the gerber files (which contain information about copper layers on the PCB) and upload them to their site and wait a few weeks for your favorite postman to deliver your masterpiece.
Step 6: Soldering
Soldering components this small is no easy task. But with a good soldering iron and good vision it can be done.
I use Ersa Icon soldering station which does the job very well.
For this project I chose ridiculously small components because I was very low on space. Otherwise I would choose 0603 or 0805 components which are much easier to solder.
Step 7: The Heatsink for LED
I needed to fit some aluminum mass into the enclosure in order to distribute the heat from the LED.
Since I had the 3D model of my board, I could easily model the piece in 3D and manufacture it with my hobby router.
I could cut out all the holes and cutouts to fit it perfectly.
Step 8: Starting the Assembly
Then the assembly started and everything suddenly fit perfectly.
Under the PCB I taped the Kapton tape so the board was electrically isolated from the aluminum so no short circuits could occur.
Step 9: A Few Hours of Cable Crimping Later...
The beast was almost complete!
I crimped the cables,, mounted the switch and power connector, connected all the things, mounted the lens for the LED and mounted the batteries inside the battery holders, glued the thermistors for measuring the battery temperature. The charging ICs keep the battery inside the safe limits. If the temperature is too low or too hot, the charging current is reduced in order to not damage the battery.
Step 10: And Then...
The flashlight was complete! See the video on the top of the instructable to see it in action and how bright it shines!
The only thing needing upgrading is that I need to somehow seal the hole around the USB connectors for dust.
But I have not yet figured how to do it properly. If you have any idea, tell it in the comments.
So.. Now you think I'm a professional and you are not able to create such thing. But you are wrong. When I started with electronics in middle school, I also did not have any idea on what I was doing. I was looking online for schematics and I tried to solder them when I didn't even know what a transistor was and how it worked. Of course most of them did not work. Through trial and error I was getting better and better. I read some books, went to study electrical engineering and started to make many PCBs. With each one I got better. And so can you!
Thank you for reading my instructable! Please also check my other instructables!
You can follow me on Facebook and Instagram
for spoilers on what I am currently working on, behind the scenes and other extras!
Runner Up in the
PCB Design Challenge