Author Topic: First project (WiFi LED strip controller). Would like some feedback.  (Read 2926 times)

0 Members and 2 Guests are viewing this topic.

Offline r-sTopic starter

  • Supporter
  • ****
  • Posts: 7
  • Country: de
Hi.

I'm working on my first real electronics project: an LED strip controller that handles up to three independent LED strips, controllable via WiFi + MQTT.

I've already got a prototype running at home, so I know the basic idea works. Right now I'm working on the schematic of the final circuitry. Once that's done, I'll layout the PCB, and then it's production time (i.e. handsoldering time ;)).

This is an open-source project, and I have already put the current state on GitHub: https://github.com/rschaeuble/led-strip-controller. Besides the main README, which contains a general description of the project, there's also some documentation about the hardware (linked from the main README; direct link: https://github.com/rschaeuble/led-strip-controller/blob/master/hardware/led-strip-controller-esp8266/README.adoc). That file also links to a PDF export of the schematic, so it can be viewed without KiCad.

As I said, this is my first electronics project, so I only partly know what I'm doing ;).  I would be really happy for any kind of feedback, be it about the general idea, the schematic, or about the design considerations in the hardware documentation.
Also, as English is not my native language: if I have misused any technical terms, please tell me!

Thanks in advance :)
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #1 on: June 03, 2018, 12:05:27 pm »
It generally looks OK at the schematic level.

- What's the purpose of the capacitor between EN and ground? Do you really need it?

- Check exactly what is required, or not required, in terms of external pull-up or pull-down resistors on EN, RESET, GPIO0, GPIO2 and GPIO15.
It really depends exactly what kind of ESP8266 board you're using, as they're not all the same internally, some may include resistors and some may not.
You've got GPIO15 tied to ground and EN pulled up, so that's OK, and I think GPIO0 and GPIO2 have weak internal pull-ups on-chip so they're probably OK.
Check whether you need to pull the reset pin high.

Put a 0.1uF decoupling capacitor at pin 28 of the PC9685 chip. As a general rule, have 1 separate decoupling capacitor for each chip, near the main power pin.

I would bring out the 3.3V rail onto the "programming header" so you can power the system from the programming interface, and this one single interface provides all the interfaces and power you need for programming with just one cable.
 
The following users thanked this post: r-s

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #2 on: June 03, 2018, 12:32:11 pm »
That looks very familiar to a project I have on my desk (slowly progressing). For the 12V->3.3V regulator: There are switching units available that are drop in compatible. That reduces the power consumption and also allows to operate at 24V as higher power LED strips using this voltage.

Thought of using SMDs for the FETs? Save lots of space on the PCB. For some reason I placed diodes parallel to the LEDs to prevent any problems.

Think about adding a decoupling cap at the PWM chip.
 
The following users thanked this post: r-s

Offline r-sTopic starter

  • Supporter
  • ****
  • Posts: 7
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #3 on: June 03, 2018, 02:21:50 pm »
Thanks, LukeW and Twoflower, for your responses.

You both mentioned the bypass cap for the PC9685 that I've forgotten to add. That's fixed now.

Quote from: LukeW
- What's the purpose of the capacitor between EN and ground? Do you really need it?
I'm not completely sure about the purpose of this cap. It exists in the manufacturer's datasheet (https://www.espressif.com/sites/default/files/documentation/0c-esp-wroom-02_datasheet_en.pdf, section 5, figure 5.2), so I added it as well. My best guess is that it delays activating the chip for a short time, to give the power supply some time to stabilize the output.

Quote from: LukeW
I would bring out the 3.3V rail onto the "programming header" so you can power the system from the programming interface, and this one single interface provides all the interfaces and power you need for programming with just one cable.
That sounds like a really useful addition => added.

Quote from: Twoflower
For the 12V->3.3V regulator: There are switching units available that are drop in compatible.
I've already put a switch mode regulator in the schematic. I'll just have to replace that with its 1 A sibling (the one in the schematic is a 0.5 A model)

Quote from: Twoflower
Thought of using SMDs for the FETs? Save lots of space on the PCB
I'll look into this. I was planning to put the through-hole MOSFETs in a dense 3x4 grid pattern, with only a small distance between them, to keep the PCB area small. As those MOSFETs stay pretty cool at the loads I want to throw at them, that should not cause and heat problems.

I have updated my schematics in the GitHub repo.


 

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #4 on: June 03, 2018, 02:47:16 pm »
If you're placing the FETs that dense it might be a interesting task to fan-out that to the connectors. What's your target current per channel?

Try this regulator: R-78B3.3-1.0 It has 4.5...32V input voltage with 1 Amp. I'm using the 5.0V because my ESP module accepts this and provides the 3.3V for a level shifter. This allows me to drive the PCA and FETs with 5V (lower Rdson). So far it works perfectly.
 

Offline r-sTopic starter

  • Supporter
  • ****
  • Posts: 7
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #5 on: June 03, 2018, 03:18:04 pm »
If you're placing the FETs that dense it might be a interesting task to fan-out that to the connectors. What's your target current per channel?

Try this regulator: R-78B3.3-1.0 It has 4.5...32V input voltage with 1 Amp. I'm using the 5.0V because my ESP module accepts this and provides the 3.3V for a level shifter. This allows me to drive the PCA and FETs with 5V (lower Rdson). So far it works perfectly.

I'm planning for an overall power consumption of about 36 W. In the "worst case", these are consumed by one strip alone. This makes 12 W => 1A per channel.
What consequences that has on things like required trace width I do not yet know. That's something I'll have to look into.

The regulator you have mentioned is actually one of my top candidates right now. As my ESP module does not tolerate 5 V, I'll have to stick to 3.3 V.

What FETs are you using in your design?
 

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #6 on: June 03, 2018, 03:58:52 pm »
Yes my ESP board has a build on 5V to 3.3V supply build in. But the I/Os are 3.3V only. THat's the reason the SPI needed a level shifter too. So a lots of overhead for a few mOhm lower Rdson ;-)

I'm using the PSMN1R6-40YLC but they're EOL in the meantime. The replacement (PSMN1R4-40YLD) is a bit worse at 3V gate voltage, but I think with less than 4mOhm it's still completely in the green area. The with of 5mm is a bit unfortunate for a 2.54mm pitch on your connector (two rows probably won't work out well). So you should look for one with a package of max 4.5mm width to allow two rows of FETs. So a SOT89 might work well. With the 1A requirement that shouldn't be a problem to find a candidate.
 

Offline r-sTopic starter

  • Supporter
  • ****
  • Posts: 7
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #7 on: June 05, 2018, 06:56:06 pm »
I checked out the PSMN1R4-40YLD. While I think that it wouldn't safe me that much space on the PCB compared to the IRLZ44n (which I planned to mount vertically), it made me realize that the IRLZ44n isn't the most efficient part for my usage.

What could really safe me some space: dual-MOSFET packages like the BUK9K5R6-30E. A bit less effizient than the PSMN1R4-40YLD, but the space savings might make it worth it. I'll postpone the final decision until the rest of the schematic is finished and I have looked at a few potential enclosures.

Next task: ESD protection. I guess some protection of the programming interface wouldn't hurt, but I'm not sure whether it's worth the effort protecting the 12 V power supply jack and the LED connectors. Not sure how sensitive MOSFETs are on drain and source (I know they are quite sensitive on the gate poin).
 

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #8 on: June 05, 2018, 08:07:37 pm »
As mentioned the ones I use are oversized for your application. You don't need 4mOhm Rdson if you only drive 1A (4mV voltage drop and 4mW thermal losses). You probably can safely take one with 50mOhm and you're still a good distance of the need of a heatsink and such. Maybe you should think about what losses you can accept and look what the marked provides in that range.

A dual or multiple FET arrays might be OK as well.

About the ESD protection: How about something like a SRV05-4 for the data interface (but I haven't fully checked if they're suitable). The power-supply usually has tons of decoupling caps: No need for additional protection, unless you're expecting surges from the power supply. About the FETs: yes, they're sensitive. But mainly on the gate. As these are not 'accessible' to the outside world: Usually you're fine.
 

Offline r-sTopic starter

  • Supporter
  • ****
  • Posts: 7
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #9 on: June 10, 2018, 10:22:05 am »
Yeah, you're right. Obsessing too much about Rdson isn't worth it. I've check for other MOSFET arrays, and I think I'm going to settle on the DMN2029USD-13. It's a 2x array with a single-unit price of about 0,42 €.

About the TVS: the TVS3V3L4U seems like it should work. I think I'm going to also add a 1K series resistor on the data lines (between the TVS and the ESP8266). That should be more than enough protection.

Next stop: finding a suitable case.
 

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #10 on: June 10, 2018, 11:26:06 am »
That array looks good. Only the max. Vds is a bit low for my taste. Totally OK if you're stay with the 12V LEDs. But many higher power are using 24V. They have the advantage of lower voltage drop along the stripes. Especially if you have longer ones. I would look for a 30V or a 40V type. There are drop in compatibles around you should point to as alternative.

The resistor is not required. As this devices are used for USB and they don't allow such resistor especially as it reduces the speed you can archive. But if the 1k (which is much too high IMHO) gives trouble with the datarate you still can still reduce the resistance, even down to 0. From my point of view I'm happy that my ESP reaches the 115kBit. Going to lower speeds start to get annoying. You can do a bit of math here: Check the input capacitance of the ESP, adding some pF for the PCB and calculate the RC-time. Compare the result with the frequency of the datarate.

I just noticed: Your power estimation states 40mA for one or two status LEDs. Don't! They're just to bright. Depending on the type, less than a mA is enough and allows you to still look at the board for measurements without sunglasses.

What's the reason for using the lower 12 outputs of the PCA? Sure that's no problem, just curious. And maybe you should add a LED to one of the unused outputs of the PCA to help coding without the LED-stripes attached.

I's probably a good idea to add some decoupling caps to the regulator too. First you should select a type of regulator and then look what are the requirements. Some won't work well if too low ESRs are attached, others require close-by caps, ...

The power-connector you're intend to use is it usable for 12Amps? And adding some caps on the 12V line won't hurt.
 

Offline r-sTopic starter

  • Supporter
  • ****
  • Posts: 7
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #11 on: June 10, 2018, 01:28:24 pm »
Wow, thanks for all that input :)

Quote from: Twoflower
That array looks good. Only the max. Vds is a bit low for my taste. Totally OK if you're stay with the 12V LEDs. But many higher power are using 24V.
So far I didn't consider support for 24 V strips. But a quick look resulted in the DMN3018SSD-13, which is only a few cents more expensive. So I might just go for that one. Also, the DC-to-DC regulator I planned on using goes up to 28 V, so nothing else would have to change for 24 V support.

Quote from: Twoflower
The resistor is not required. As this devices are used for USB and they don't allow such resistor especially as it reduces the speed you can archive. But if the 1k (which is much too high IMHO) gives trouble with the datarate you still can still reduce the resistance, even down to 0. From my point of view I'm happy that my ESP reaches the 115kBit. Going to lower speeds start to get annoying. You can do a bit of math here: Check the input capacitance of the ESP, adding some pF for the PCB and calculate the RC-time. Compare the result with the frequency of the datarate.
To be honest: I have no idea whether that resistor would work. I have seen suggestions of 100-1000 Ohms for digital input lines, so I thought I might just try it and reduce the resistance if it caused problems.
High frequency stuff is an area I haven't really looked into so far. So I really have no clue how to calculate what kind of datarate would be attainable (and it doesn't help that I can't find any info on the ESP's input capacitance). Do you know some good, easy to understand introductionary material?

Quote from: Twoflower
I just noticed: Your power estimation states 40mA for one or two status LEDs. Don't! They're just to bright. Depending on the type, less than a mA is enough and allows you to still look at the board for measurements without sunglasses.
Don't worry, I don't plan to add a small sun to my circuit ;) I just added that value as a very conservative upper boundary on the power consumption. When I pick the LED I'll take one that is visible when one pays attention, but not more.

Quote from: Twoflower
What's the reason for using the lower 12 outputs of the PCA? Sure that's no problem, just curious. And maybe you should add a LED to one of the unused outputs of the PCA to help coding without the LED-stripes attached.
I don't really remember. Probably because that looked best on my first attempts with the PCB layout. When I'll make the final PCB layout (once I have picked a case), then I'll assign the pins so that it's easiest to layout.
During coding I just attach my oscilloscope so I can see the duty cycles. That worked quite well so far. That's also why one of the unused pins of the PCA is constantly set to a 50% duty cycle, so I always have a good signal for triggering.

Quote from: Twoflower
I's probably a good idea to add some decoupling caps to the regulator too. First you should select a type of regulator and then look what are the requirements. Some won't work well if too low ESRs are attached, others require close-by caps, ...
I think I'll pick the R-78E3.3-1.0. It's small and cheap. I'll add 10uF bypass caps on both sides, as suggested in the datasheet.

Quote from: Twoflower
The power-connector you're intend to use is it usable for 12Amps? And adding some caps on the 12V line won't hurt.
I never intended to go up to 144 W power consumption. So far I planned with 36 W maximum, freely distributable between three strips (including using the whole 36 W for one single strip).
But if it doesn't drive up costs too much, I might as well use a beefy power connector (and use wider traces on the PCB).
About the caps: I thought I'd "reuse" the 10uF bypass caps I'll add for the DC converter for that purpose, as I'll most probably place the DC converter nearby the power supply connector. Do you think that would be OK, or would another 10 or 100 uF cap be better?

Again, thanks for all your input so far!
 

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 745
  • Country: de
Re: First project (WiFi LED strip controller). Would like some feedback.
« Reply #12 on: June 10, 2018, 02:36:35 pm »
About the resistor: That 115kBit/s far from high frequency. The calculation for the cut off frequency is 1/(2*pi*R*C). Since this calculation is just to get an idea a starting point for an CMOS input is about 5pF. I would add another 5pF for the traces. So the cut off frequency is about 16MHz. If you have trouble with the units: Check Wolframapha. So that's actually far enough away from the maximum frequency of 57KHz of the data signal (115kBit/s -> max frequency is half of it). Still I would not do that.

Keep in mind that the peak power is all channels on during the PWM cycle. To my understanding and experience you cannot shift each channel to a different time-point. Even as the datasheet indicates so. It's more complicated. Especially if you ramp the signals up/down you get in some kind of over/underflow in the device that causes very ugly flickering during the ramps. Unless I did made some coding mistakes. But the connector rating is average power consumption not peak. So you might be fine.

In my case I have 2x 100µF for the input filtering. I had the space and it doesn't add too much to the bill. But probably the 22µF is more or less obsolete. I just wanted to be sure in this case. It also reduces the electrical noise on the supply lines. Especially as all LEDs will light up at the same time during the PWM cycle.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->