Introduction: Easy CAT4101 LED Driver
As part of a larger home automation project in my small apartment, I wanted to make a LED lamp. This required making some LED drivers for the high-power LEDs I am going to use. These are my first custom manufactured PCBs, and also my first time doing SMD soldering. There are some great resources online to help people get started, so I won't go over everything in this instructable.
Overall, it was very easy to design and build these drivers. It was also a good learning experience.
These LED drivers are based on the CAT4101 LED driver from On Semiconductor. They can handle up to 25V and 1A, so they are perfect for many high-power LEDs. The 3W LEDs that I bought off eBay have a forward voltage of 3.4 to 3.8V, and a max. current of 700mA. Based on these specs, one of these drivers can power up to 6 LEDs each!
Step 1: Parts and Tools
Here is a list of the parts and tools I used. More information on how and why to use certain things are explained later.
I designed the PCBs with Eagle. This is probably the hardest part of making these LED drivers. I have included the schematic and PCB files with this instructable.
I had the PCB boards made by Seeedstudio. They offer five 5cm x 5cm board for a low price. They took a few weeks to arrive here in North America. The quality, as far as I can tell, is excellent.
- Soldering Iron - I can't stress this enough: don't buy a cheap one! From my own experience, cheap irons don't last, and will end up doing a bad quality job, no matter how good you are.
- Tweezers - I used 1206 SMD parts. They are small, and impossible to hold using your fingers, not to mention soldering them too.
- Magnifying glass - A magnifying glass - especially one that's part of a light with an arm - is handy to inspect soldering.
- Solder wick - It's very easy to use too much solder on small SMD parts. Solder wick will help remove the excess.
All of the parts were purchased from Newark. Delivery was prompt, even if they sent three separate packages from the same warehouse. They only charged shipping for one. Digikey is where I usually purchase parts, however, I found that Newark had cheaper prices. Buying more than needed can make the price even cheaper, and parts like capacitors and resistors can often be used again in other projects easily.
Parts (per board):
- CAT4101 - the most expensive part. I got them for about $3.30 each
- Newark SKU 08R52564
- Manufacturer part# CAT4101TV-T75
- Datasheet: CAT4101
- Newark SKU 70K9167
Manufacturer part# C1206C104K5RACTU
- Newark SKU 06R4217
- Newark SKU 98K2692
Manufacturer part# WCR1206-180RFI
- Newark SKU 59M7004
Manufacturer part# CRCW1206510RJNEA
- Newark SKU 39K0872
Manufacturer part# MC0125W1206110K
- Newark SKU 77K7035
- Manufacturer part# SML-LX1206GW-TR
- These had a picture of the trimpots with the correct pin alignment, but when they came, they were different
All the SMD parts are 1206 (32mm x 16mm metric) size. The PCB board has big pads for the SMD parts, so 1208, 1006, 1406 and 1408 sizes may work, although those sizes are rare and generally cost more than 1206.
- Arduino - this is handy for testing the on-board LED and the PWM function
- Digital Multi Meter - preferably with continuity test (but a low Ohm setting works as well)
- High-power LED - any LED that can handle >100mA of current. It is not recommended to use paralleled LEDs to get a current capability of >100mA
- Appropriate power supply - this needs to have a voltage rating of 0.5V more than the LED forward voltage, and be able to provide equal or more than the LED current. In my testing, using a voltage even +5V more than needed is perfectly acceptable
Step 2: Circuit
These drivers are designed to handle LED voltages up to 25V, and current up to 1A. Exceeding these is strongly not recommended!
The schematic for this LED driver is similar to many that can be found on the web. I designed a few optional features into the schematic and PCB, purely for adaptability to different situations. For example, I plan on using a TLC5940 to provide 12-bit PWM. The TLC5940 has constant-current sink pins, which are different than an Arduinos TTL pins. Adding an optional 10K Ohm pullup resistor to the board, and some sort of inverting logic (not on this board) makes it compatible with the TLC5940.
The CAT4101 is a very easy chip to design with. Unlike most switching drivers (buck, boost, etc), the CAT4101 needs a low external parts count, no inductor, and requirements for trace length and placement of external components are much more lax. This also means that the cost to build them are also lower.
Two of the largest trade-off of not using a switching driver are efficiency and flexibility. This is not to say that the CAT4101 can not be efficient. Later in this instructable, power supply considerations will be looked at.
- VIN - This pin supplies the CAT4101 with power for the internal regulators and other circuits. From the datasheet, the minimum and maximum voltages are 3.0V and 6V, respectively.
- PWM/EN - This pin is used for dimming. If you aren't going to dim using PWM, this pin should be tied to the VIN pin. Alternatively, you can use a simple on/off switch for control. This pin uses a small amount of power. If you don't have other 5V or 3.3V circuits in your design, the datasheet provides a simple circuit for producing 5V - much better than an inefficient linear regulator. For PWM control, you need to know if your controller is a current source, sink, or push-pull. Only the current sink (like the TLC5940) needs special treatment: a 10K pullup resistor between VIN and PWM/EN, as well as an inverted PWM signal.
- RSET - This pin uses resistors tied to ground to set the maximum LED current. The following is from the datasheet, and lists resistor values for specific LED currents. Figure 11 on the datasheet shows a graph of RSET vs LED current as well.
LED Current [mA]---->RSET [Ohms]
In my design, I used a fixed 510 Ohm resistor in series with a 5K trimpot. The trimpot allows me to dial in a specific LED current from <100mA to just over 1A. The fixed resistor protects against accidentally setting zero ohms on the trimpot, and potentially destroying the CAT4101 and your LEDs. The preferred method is to set the maximum LED current you want (and that your LED can handle indefinitely), and then forget it! Dimming should then be done using PWM/EN.
- LED - This pin sinks the LEDs current, as well as regulates it. The LEDs should be set up in series (more on this later), with each LEDs cathode (-) towards the LED pin. This is called low side control, as the control device is on the lower voltage side.
- GND/TAB - This is pin connects to ground, as well as the CAT4101s tab.
Step 3: PCB
There is not a lot of special considerations when designing the PCB. I have included my gerber files and Eagle files. The zipped gerber files are the exact ones I sent to Seeedstudio, so there should be no problem with them, and should come back without problems. The silkscreen on the board that says "18.5V max" was something I put on as part of my larger project. This can, in fact, handle 25V.
The CAT4101 has to drop all the excess voltage that the LEDs do not At high current, this mean a lot of power. The CAT4101 comes in one package called a D2PAK5. It is specially designed to dispose of heat through the pad, and into the PCB. The PCB therefore must have a thermal capacity to handle the heat from the CAT4101.
In my testing of the driver, the CAT4101 never even got warm. The PCB is designed so that there is an exposed area of copper below the CAT4101. This pad can be soldered to the copper to create interface for heat to go from the CAT4101 to the PCB. (see photo)
Soldering the pad to the PCB is easier said than done! In all four attempts, the result was not good! I am still not sure why - it could have been the vias that I placed under the pad, or that my soldering iron just wasn't hot enough - but the solder refused to flow under the CAT4101. As well, the exposed copper pad was not large enough, and soldering on the left and right edges was impossible. I did, however, heat the vias under the pad and apply solder. It flowed through to the other side, but since I could not see the other side between the CAT4101 and the pad, I'm not sure if this helped or not. The bottom line is: when testing each driver with up to 12V and 600mA, there was a noticeable change in temperature of both the CAT4101 or the PCB, but they never got too hot to touch. Always test the temperature of the CAT4101 under normal operating conditions to make sure. Symptoms of an overheating CAT4101, besides the heat, is the LED(s) flashing as the IC goes in and out of thermal protection.
Creating a ground plane(s) on PCBs is a good practice. This allows easy access to ground, as well as creates a slight capacitance between ground and power rail traces. The capacitance is like a decoupling capacitor, reducing noise and transients. The extra vias are to help spread heat from the top layer plane to the bottom layer plane.
However, this can have negative effects. The capacitance between the PWM trace and the ground plane can destroy a high resolution PWM signal. Using the TLC5940 (12-bit resolution, 240Hz PWM) as an example, the signal can have a period of microsecond:
1/240Hz = 0.00416667s
0.00416667s/4096 = 0.000001s
1/0.000001s = 1MHz
As per the datasheet, a 0.1uF capacitor needs to be placed as close as possible to the VIN and GND pins of the CAT4101. This prevents noise and power fluctuations from getting inside and influencing the LED current limit and shutdown mechanisms.
Step 4: Extras
With the right design, one can fit multiple CAT4101s on a single 5cm x 5cm PCB without issue. I designed my drivers to be used in different applications, be it one or four. Having only one CAT4101 per board left quite a bit of room. I used this room in a few different ways. Some, or all of these, can be left out without affecting the core functionality of the CAT4101: driving LEDs at a constant current.
There are two extra capacitors on my boards that are not needed. After testing, C3 and C4 were found not to be critical.
If you are going to use these is a permanent project, and know exactly what current limit you want, the trimpot connected to RSET can be omitted.
I wanted a visual indicator that my LED driver boards were powered and on. I put a 2.2V LED in series with a 180 Ohm resistor. 180 was chosen because it would work with the range of voltages on VIN: from 3.3V to 5.5V.
I did not put an LED on LED+ because of the wide voltage range this could have. If designing for 12V at 15mA, a 680 Ohm resistor is needed. If the LED+ voltage was then lowered to 5V, the LED would only get 4mA. If raised to 24V, the LED would get 35mA, 15 more than the LED is designed to handle.
Step 5: Power Supply
Special consideration should be given to the LED power supply.
The most important thing to remember when choosing a power supply is that the CAT4101 needs 0.5V more than the LEDs. This means that if you have three LEDs, each with 3.6V forward voltage, you need a power supply that provides at least 11.3V under load.
Efficiency is highest when the supply voltage is as close as possible to the LED voltage. This also minimizes the heat generated.
Series vs Parallel:
When powering multiple high-power LEDs from a single driver, series is always preferred. This is due to the variations that can occur from one LED to the next. While one LED may consume 400mA at 3.8V, another, same spec LED may consume 400mA at 4V. Due to the laws of electricity, current is divided between parallel connections through resistive loads. Voltage, however, stays the same. Thinking of the LEDs as resistors with equal values, and using Ohms law (V = I x R), if the voltage is not the same through each LED, then the current must be different as well. This extra current through one LED could cause it to fail. If that LED no longer consumes current, and the CAT4101 always regulates to a constant current, the other LEDs must then consume the extra current. This could then cause failure of the remaining LEDs.
The CAT4101, nor the circuit I designed, has any protection from LED failure. For that reason, always put LEDs in series!
It is easier and cheaper to find a higher voltage supply than a higher current one.
Step 6: PWM Dimming
Having had some time to try out these drivers, I wanted to add my observations about PWM dimming this LED driver. There are many different solutions to PWM dimming. Arduinos have a number of 8-bit PWM capable pins, and 555 timers allow for cheap and easy PWM circuits. Another solution - and the one I intended to use with these drivers - is the TLC5940. It has 16 channels capable of 12-bit PWM resolution.
Arduinos 8-bit PWM is a simple way of dimming these drivers. Connecting the Arduino ground pin and a PWM pin to the driver boards is all that is needed! The key to this simplicity is the Arduinos pins, which are capable of both sinking and sourcing current.
In some situations, one might want to have greater resolution. 8-bit PWM can lead to very noticeable 'steps' between adjacent PWM values. This is especially evident at low values (close to off).
The TLC5940 provides 12-bit resolution, which is 16 times greater than the Arduinos 8-bit! (4096 vs 256)
The hardware and software setup for controlling the TLC5940 with an Arduino can be found here
The most important thing about the TLC5940 is that the output pins can only sink current. The TLC5940 is actually designed to be a LED driver itself, but only up to 120mA for all channels combined. To connect this to our LED driver boards, we need to add a circuit between the TLC5940 and the board.
Note: it is mentioned in this instructable that to connect a TLC5940 to these boards, a 10k pullup resistor must be added to the board in the provided space. However, this is a mistake. While there may be a circuit that works using a pullup resistor, the method I describe below uses a 10k pulldown resistor instead.
In order to get the proper PWM signal, a PNP bjt transistor is needed. I used a 2n3906. Because the TLC5940 has current sinking pins, it cannot provide current needed to turn on a NPN bjt transistor. Instead, we use a PNP bjt transistor, so that the TLC5940 can source current from the base of the transistor. Basically, when the TLC5940 sends a 'high', it sinks current, turning on the PNP transistor, and sending a high to the LED driver. When the TLC5940 send a 'low', no current flows in or out of the pin, turning the PNP transistor off. A NPN transistor will not work, as it requires current at the base to turn on, and the TLC5940 cannot source current.
Since the TLC5940 regulates the current on each pin, no base resistor is needed. For the 2n3906, I found that a 3k3 resistor on the TLC5940 current set pin provides enough current. However, having a 100 ohm resistor on the base of the PNP would not hurt.
The TLC5940 library for Arduino has a default PWM frequency of about 1kHz. While the CAT4101 is a linear LED driver, I found that there is an audible, high-pitched whine coming from the driver. This whine is usually a product of an inductor vibrating at frequency, but since there is no inductor used in this LED driver, I'm at a loss to explain it. Decreasing the PWM frequency down below ~244Hz lessens the noise, but also introduces flickering at low PWM values. Increasing the PWM frequency seems to affect how dim the LED can go before turning off. The average person should not notice the whine beyond about half a meter, and an enclosure should mask it completely.
While testing the PWM dimming, I noticed that there is quite a significant difference between off and a PWM value of 1. At this value, there should be an average of ~0.1456mA = (1/4095)*600mA. Yet, the LEDs show that there is at least a few milliamps through the LED. Substituting a 3mm LED shows a very smooth transition between off and 1, so I think it is my LED that is at fault.
Remember: always connect grounds together. Each device - Arduino, LED driver, etc - may have a different ground potential, and connecting them together will create a common ground. Not doing so may cause damage.
Step 7: Conclusion
I have embedded a short video of the CAT4101 driving two 3W LEDs at ~500mA. A TLC5940, controlled by an Arduino Uno, provides 12-bit PWM dimming.
I hope this instructable was informative! Please remember that I am not an electrical engineer, and have only a little bit of formal education.
Please feel free to leave comments, suggestions, corrections, criticisms and questions! Not only will other people benefit, but I may learn something new as well!