RGB led strip using ESP8266 - first steps in designing  - Page 1
Forum section: electronics / projects

author: Gearloose
author_rank: Newbie
timestamp: April 04, 2018, 09:37:16 am
content: Hello,I'm trying to design a PCB to control an RGB led strip using ESP8266. I guess this is well discussed topic and there are plenty of designs out there but I cannot understand how they select their components. .I try to understand and learn through this project so any help will be appreciated (I’m more a software guy).The led strip is a 12v RGB (common anode supply, controlling the cathode). It has SMD 5050 chips, when switched all colors to maximum need 1.4AI want to go with SMD for this project to keep the PCB small and also try for first time this type of componentsStarting from ESP8266 with 3.3v, I need to trigger an optocoupler for each channel. To select this component, I have 2 major questions:1.What should be the frequency of the PWM to avoid flickering? I found that should be from 50 Hz to 25 KHz (or even higher). Anyone with knowledge/experience on this?2.I have the following candidates but I’m not sure I can read the datasheet correct:a. 4N35: drive them with 1.3v, 10mA with max freq 100Khzb. PC817: drive them with 1.2v, 20mA with max freq 80Khzc. PS2801-4-A: drive them with 1.1v, 50mA with max freq 125Khz (smaller package which I prefer)any hint how to read the important parts of the datasheet?The difficult thing for me is the MOSFET selection.I have no clue here. I think anything over 2A per channel/color will be safe.I have seen people using:1. IRF5402. IRLB87213. 135N03L4. DMN3016LK3Which characteristics should I check in the datasheet to select the right one? Especially for the frequency part and heat generated.Finally, I have available 220V AC, so I can either use a HLK-PM03 to get the 3.3v for the ESP8266 and an external PSU for the 12V for the led strip, or incorporate everything into my design.I would prefer to include them all into my PCB but do you have any useful links to help me with such switching PSU? (3.3v & 12v). I don’t want to go with the transformer, rectifier, capacitor solutionThank you for your help!

author: Twoflower
author_rank: Frequent Contributor
timestamp: April 04, 2018, 07:16:05 pm
content: Why do you need the signal running through OptoCouplers? The 12V supplies are insulated (doublecheck if your specific model isn't).You should check that the FETs are fully switched on with the provided gate voltage. And the Safe-Operating-Area. Depending on the design you can look for 3.3V types and drive it from the ESP directly or use a level-shifter. The ones I mention below has a RDS-on @3.3V of 1.8mOhm and @5V 1.4mOhm.Your selection of FETs:1. IRF540 @3.3V relative high RDS on2. IRLB8721 Safe operating area don't allow enough current at 12V3. 135N03L probably OK, but 25mOhm RDS-on4. DMN3016LK3 Probably OK, but they don't provide the SOA in a form I understand.For a similar project I did go another way: For simplify things on the controller, increased resolution, RGBW plus one additional channel and less IOs occupied I decided to use an PWM device. The PCA9685 is a 16 channel 10Bit PWM generator which also allows to drive FETs directly. With a set of PSMN1R6-40YLC as FET. Works like a threat. With 0.8A the FETs don't even get warm**.** I over-engineered my setup as I used a level-shifter to operate the PCA with 5V and drive the Gates with 5V. The FETs are EOL, but the replacement part (PSMN1R4-40YLDX) don't work very well at 3.3V with about 3mOhm RDS-onEdit: I use a 12V (or in my case 24V) PSU for LED (Constant Voltage). This is fed into a switching regulator. I was Lazy and used these 78xx drop in compatible switching units (the 5V version: R-78B50-10).

author: Gearloose
author_rank: Newbie
timestamp: April 10, 2018, 09:06:43 pm
content: Thank you Twoflower for the detailed answer.I found some TLC59116 I had from a past project. Your idea was great.I'm thinking of designing my solution around this (basicaly because I alredy have them)Can you please give me some hints on selecting the corect Mosfet?which parameters should I check in the datasheet?I need low RDS on, to handle 2A+, to be fully opened with 3.3V, to handle the PWM freq. Right?in some examples they used the IRLML9301 but I'm not sure if it will work with the TLC59116.Regards.

author: hamster_nz
author_rank: Super Contributor
timestamp: April 10, 2018, 09:44:18 pm
content: I am mashing up something similar for somebody as a project - they want it for PWM of 12V/24V LED lighting.My dummy load is a 25W strip of RGBs.MOSFETS are SI4944DY (30V/~9A). This part is EOL, but there is a SI4946EY, that is much the same, but rated for about half the amps.I am also putting in TLP701 opto-isolated MOSFET drivers as the main power's current (6A+) over many meters may cause the ground reference to shift up relative to the remote microcontroller, and if the small SMD MOSFET fails to turn fully on it would be bad.Eventually there will be 6 channels on a PCB, with the control signals connected over RJ45 connector.Here is a picture of the "prove that the Ali Express parts work" prototype - yes, the workmanship is shocking. And the pin headers on the SMD adapters wouldn't go through the scrap of stripboard!

author: Twoflower
author_rank: Frequent Contributor
timestamp: April 11, 2018, 06:15:20 pm
content: The selection of the FETs is looking for the right parameters.Check the Safe Operating Area (SOA) that your selected FET can operate at the given operating conditions. Don't get nervous if you see the diagram. In doubt ask here in the forum.Select one with a matching G-S voltage. You should look one that opens reasonable well at the available G-S voltage (e.g. 3.3V minus some losses so 3.2V)Sufficient DS voltage. Obvious, isn't it?A low Rdson value. That helps to reduce the losses and you might be able to skip the heat-sink (ore reduce the size). So spend a bit more for a FET can save you money and mounting time for the heat-sink.Of course the package. If you're able to solder SMD it's probably a good idea to use a SMD-FET. But they like to have a soldered pad below the package. That's for thermal reasons. But that can be done with a normal solder iron too.*)*) To solder this I used to place a very(!) thin(!) solder-layer on the pad. The less the better, but the pad should be soldered complete. Clean and add some flux. Now hold the solder iron very flat and keep the solder liquid. Now place carefully the FET in the position above the solder iron (light touch) that the 'other side' pins touching the pads at the final position. Now remove the iron (try to keep it close that the solder stays hot) and quickly push down the part. Try while the solder is still liquid to touch the soldered pins with the iron to settle the device at the final position. After this you can solder the remaining pins. I recommend to try this with a cold iron because that should happen quick to not overheat the devices. The picture below shows one not so good (left, not fully flat on the PCB) and one nicely done (right) using this method.Edit: The TLC59116 seems not to be able to drive FETs. Also the build in protection unit might trigger. I haven't read through the complete datasheet. If you insist I would go for a bread-board trial (after reading the complete datasheet). The PCA9685 has a special FET-Driver mode. This and the fact is has 10Bit resolution (I actually would like to get 12Bit as the lowest level is surprisingly bright) made me take this device.