The fatal flaw of my second revision motorcycle turn signal bulb was that I chose to control the power running through the LED's with a resistor placed at each individual LED. The logic behind this was that I could lose an LED here and there without causing a whole string to go out. The resistor method works well enough on the large first revision board, but these particular LED's are very high power and they are packed tightly on the second revision board. This caused a significant amount of heat build up in a short period of time which shut the LED's down until they cooled off. This was not an ideal situation and improvements would need to be made.
The purpose of this LED dimmer board is to test alternative methods to control the amperage running through these high power LED's. The method I'm utilizing is a MOSFET current source. I can set the current through the LED's with a single resistor placed between the source pin of the MOSFET and ground. In theory, I should be able to significantly reduce the amount of heat these boards see. I'll do this by chaining two sets of LED's together in order to first bring the voltage down, decreasing power across the MOSFET, and reduce the number of resistors that would build up heat.
Screenshot of the first revision LED Dimmer Schematic
I'll give a quick run through of this schematic from left to right. Starting at the barrel jack (J1), I've chosen a standard jack to make testing simple. I've got plenty of jacks laying around. Moving on from the supply input I've got a few smoothing capacitors (C1/C2/C3) in place to help with any fluctuations that may occur on input or even be caused by the high power LED's turning on and off. I've also included an indicator LED (D1/R1) to be sure the board is actually being supplied.
Moving on from the power input we have an op-amp (U1) being used to generate some waves. It's not typically advisable to dim LED's by varying the current or voltage through them, so I'll be Pulse-Width Modulating them instead. More can be read about the topic here. U1A is creating a sawtooth wave to set the PWM frequency for the circuit which is set with a capacitor (C4) and resistor (R5). I'm using a frequency around 1kHz to make sure that there is no perceptible flicker seen since these lights will be on a moving vehicle. It's worth noting that the switching freqency should also be kept below 20kHz to avoid any measurable EMI. From there the signal is fed into U1B's inverting input and a trimmer (RV1) into its non-inverting input. The trimmer sets the duty cycle that U1B outputs to the MOSFET (Q1).
On the output side of the op-amp is a zener diode (D2) that is used to snub any transient voltages that may occur. This ensures that the current seen by the LED's is constant. A pulldown resistor (R8) is put in place on the gate of the MOSFET to ensure that the FET turns off dependably. One more resistor (R7) is used to limit power at the gate of the MOSFET. This particular resistor needs to be a smaller than typical value to ensure that the switching speed is not reduced significantly, especially in this application. More can be read about it here.
Finally, I'll be using four identical resistors to set the current through the LED's. I did this in order to split the amount of power that would have to be dissipated in each resistor in order to reduce the physical size, saving space on the board and keeping heat from building up in a small area.
For this project I've decided to try KiCad rather than Eagle. What prompted this switch was KiCad releasing version 6 of their software which has received very good reviews. Version 6.0.7 was used for this project. That and the fact KiCad is open source was what compelled me to try it. Overall, I really enjoyed the software. It is fairly intuitive, good looking, and I especially like how easy it is to bring images into the file for things like logos and custom symbols.
Screenshot of the first revision LED Dimmer PCB
Another very interesting feature that KiCad 6 supports is a plugin called "Round Tracks". It's a new feature (at the time of writing this) that produces some very good looking results! You can check out the video for it here. The author takes you through a little history lesson, describes why circuit boards look the way they do now, and finally discusses his plugin with a few photos and demonstrations. One thing that I think got skimmed over in the video was the fact that the teardrop shape on the pads is a separate plugin. I wasn't aware of it when I started testing and was a bit confused as to why it wasn't producing the tear drop in round tracks, but I didn't mind too much. I liked the results.
As you can see, between the image above and the following image, the round tracks plugin takes your board with the standard track layout and smooths it out. You can control how much smoothing is applied and even save it as a new file if you're concerned about wreaking havoc on your board. This was the first time I've tried the plugin and I am really pretty happy with the results. I think I'll continue using it for any future boards I layout. A demonstration video applying the curved traces to a KiCad board can be found here.
LED Dimmer Board with Round Tracks Applied
Trace width calculators and information listed here.
Below is an interactive version of the circuit (best viewed on PC). You can adjust the duty cycle using the slider on the right. I don't suggest adjusting the simulation and current speed as the simulator is a bit sluggish, but you can give it a try and see how it goes. You may need to alter the steps under "options" if you decide to play with the simulation speed.
If you're having trouble zooming in on the circuit, try selecting the "Edit" menu and choose "Center Circuit".
First and foremost, I've made a mistake on revision 1 of the LED Dimmer board. When creating the footprint for the trim potentiometer I managed to mix up the pad numbers, causing the board to appear not to function at all after assembly. To correct this for testing I simply de-soldered the trim-pot and soldered wires directly to the pad to attach another potentiometer.
Something that I changed during testing was the frequency. I decreased it from around 600Hz to approximately 100Hz by changing R5 to a 4.7K resistor. The reason I did this was because I wanted to confirm that the LED's were turning completely off during the dimming process. By lowering the frequency for the test I was able to record a slow motion video of the lights dimming and confirmed that they did indeed shut off. I've also decided to drop the gate resistor (R8) down to 10K, as suggested by digikey. I did not insert the zener diode (D2) for the initial test, nor did I insert the filtering capacitors C1/C2.
After the initial test I'm considering changing the schematic to include a gate driver for Q1. Considering that I'm driving directly from an op-amp there could be issued providing the required current to properly trigger the MOSFET at high frequencies. However, the fact that the frequencies I have chosen for this design are relatively low, I don't think that it's necessary. It is something to think about though.
Below are a couple screenshots of the USB oscilloscope test results.
Oscilloscope measurement taken between U1B pin 7 and ground, producing a decent square wave
Oscilloscope measurement taken between VCC and pin 3 of J2 showing an odd dip at square wave trigger
Some notable moments from the initial test. I'm seeing a maximum current of 280mA through the LED board, which is only 10mA shy of what I was expecting to see. Each string of LED's are being driven at ~140mA, which is within the rating of the unit. I think I'll bring down the current by approximately 50mA as the LED's are extremely bright, which is fine for the turn signals, but I don't think I want the running lights to be that bright. The other issue that I'm having is the resistor array (R9/R10/R11/R12) is getting much warmer than I hoped it would, so bringing down the current should help with that issue. According to calculations, the resistors are seeing approximately 358mW each. I've used 1/2W resistors, but they are packed into a small area and heating up more than I'd like. I think when I arrange them for the motorcycle bulb I'll attach ground to the can and sink any excess heat directly into the bulb housing. Another thing that could be attributing to the heat issue is that I connected the resistors with thermal reliefs. I don't know how much this can affect heat distribution, but on the next revision I will delete the reliefs and use solid connections.I am happy with the MOSFET, it's barely warming up at these levels even with no thermal vias in place. I think I'll play around with a few more MOSFETs and see if I can get better results or find some smaller packages for the final design.
Below are a couple photos of the board setup during testing. Revision 1 of the LED Dimmer board was soldered by hand, but I have plans to reflow the next board.
Photo showing the soldered wires correcting design errors
Closeup photo of Revision 1.0 LED Dimmer board
For revision 2 of the LED Dimmer board I've decided to make a couple changes after testing. I will be changing out Q1 as I've opted for a smaller footprint. I had another MOSFET on hand and found that it was handling the current and switching frequency very well. I will go with the STN3NF06L. I have reduced the pulldown resistor at the gate of Q1 from 330K to 10K as suggested in an article by digikey. Resistors R9/R10/R11/R12 of revision 1.0 schematic will be increased from 68R to 120R, reducing the current through the LED's which should help with the thermal issues. I will remove the terminal (J2) and place the LED's directly on the board in this revision. I found it unnecessary to have separate boards for these tests. All the PTH devices will be replaced with SMD components, with the exception of the barrel jack as I didn't think to change it at the time. One final change I'll be making on this revision is the addition of thermal vias to help keep the temperatures down.
Things that will not change include the 11V zener diode, although I have decided after testing to go with the SMD version and I will continue to run the circuit at approximately 600Hz, so no change to R5 and C4 of revision 1.0 schematic. I will also not be reducing the size of Q1 gate resistor as I found no differences were made in changing its value during testing.
Errors that have been corrected on this revision are the footprint for the trim potentiometer (I've actually replaced the original trim-pot entirely) and I've corrected the hole sizes on the barrel jack as they had too much slop in them on the first revision.
LED Dimmer Revision 2.0 Screenshot
Another thing I'm working on is improving my board cleaning process. I will start with a short dip in acetone (less than 10 minutes), followed by a deep water rinse in distilled water which will be immediately followed by a compressed air blow dry. Once dry, I will scrub off the board with a static free brush to remove any particulates and residue. After this I'll give it a quick rinse in isopropyl alcohol followed by another compressed air blow dry. This has given me good results in the tests and I'll continue this method unless I see that it's causing problems. The most concerning part of the process is the acetone dip and some people have concerns about compressed air and static.
For revision 2 of the LED dimmer I've decided to try out OSHStencil's service. OSHPark has been associated with them for a while now and I've been interested in attempting the solder reflow method, but for some reason I've never done it. I figured as long as I have all the components on the top of this board that I might as well give it a try. The only thing I should have done differently is converted the barrel jack to an SMD device, but that can be done in the next revision. I've picked up a hot plate and I'll give it a try when the boards arrive. I also purchased a jig and some solder paste directly from OSHStencils. I'm pretty excited to see the results of this process and I'll post pictures when it's done.
A Stencil for LED Dimmer Revision 2.0 created with OSHStencil
I plan on releasing a Bill Of Materials (BOM) here soon for anyone interested in component choices. If I see any kind of interest in this project I may also release it on OSHPark so it can be built by others. One last thing I wanted to drop here was a link to an extremely useful article describing the process of selecting decoupling capacitors for boards as well as their placements. That article can be found here.
I also wanted to note that I've received the stencil for revision 2.0 of this board and assembled the them. It was very simple to set up and I'm extremely happy with the results! Below is an image carousel showing the process and I plan on releasing a video demonstration during the next revision update. The video will be posted at the bottom of the page.
After testing revision 2.0 boards I was very happy with the results. Everything is working as expected. There are a couple minor changes that I'm going to make for the final revision of this board before I close out the project and post all files and BOM information. You can view the Revision 2.1 Circuit Board using the drop-down arrow below.
LED Dimmer Revision 2.1 Screenshot
The most important change that I'm going to make is for resistors R9/R10/R11/R12. After testing I've determined that 330R is a good value. It offers a decent trade-off between brightness and heat. One other somewhat significant change that will be made is that the barrel jack is going to be converted from a through-hole component to a surface mount version. I had actually intended to do this on the last revision, but it slipped by unnoticed, unfortunately. The reason for this change is ease of assembly. No hand soldering will be required after this change.
The remaining changes are purely cosmetic and they include:
Add a 12VDC notice to the silkscreen at the barrel jack input
Mark the "+" and "-" direction on the dimmer in the silkscreen along with an arc of dots to show rotation
Insert the QR Code into the copper layer instead of the silkscreen.
I think that I'll also order a few different colors of the Cree x-lamp LED's to try out on various boards. These include different color temps of white (In an attempt to find a color that will come close to matching the factory headlight color for the front running lights). I'm also going to order 6 of the OSHPark after dark PCB's for the final revision, really just because I like the look. I also though it would be nice to include a short video demonstration of the solder paste application and reflow process. All the resources for this project can be found below the video.
For anyone interested, the video was quickly put together using Blender's internal Video Editor.
Video Editing Done Entirely Inside Blender