Hello,
I'm working on a minimal ESP8266 board which should control 64 WS2812b LEDs. The board should be very small size and as less components as possible. So I made a layout and ordered it on JLCPCB, unfortunately I made on the go and made some mistakes.
I had some Problems with it:
- Mayor Problem: the Esp was heating up a lot (yes it was powered by 3.3v not 5v ). It is in a small enclosure, which made it even worse, so I had to open the enclosure to not worry about the ESP. But it has to be in a small closed Enclosure.
- Control of WS2812B LEDs: (common problem), short explanation: every LED takes about 30μs to update, 64 LEDs take about 2ms to update. As I ran it with 60FPS (120ms/sek just LED update) I faced of course some Problems, because the Wifi needs in irregular intervals some time to update (and the sketch want to be processed also). I made three things against it: 1. I used the "Metro" library to update the pixels with 60fps, the "Ticker" library works much better with the ESP. 2. I reduced the FPS to 30 3. I had a problem that the LEDs also flickered, thats because of the Interrupts in the LED update. I solved it with adding "#define FASTLED_ALLOW_INTERRUPTS 0" before I included Fastled. But that probably caused my third and fourth problem :(.
- ESP resets about every 10 minutes (I think Watchdog resets). I probably can solve it with "#define FASTLED_INTERRUPT_RETRY_COUNT 1", instead of forbidding all interrupts.
- Wifi works sometimes not. I think thats also because of the interrupts, because when Fastled updates the LEDs, Wifi wont work. maybe, also working with Retry count, but not tested.
- Because I wanted to have a minimal board, flashing was very complicated. I had to flash the ESP12 before I soldered it into the PCB and than using OTA. But when the code was not working properly I had to desolder the ESP with a heatgun, flash it again over serial and resolder it.
So now my improvements I made:
- Biggest Error in PCB design cap between 3.3V and GND 100nF instead of 100μF - shame on me ;). Exchanged it in the new Schematic of course
- Improvements in power supply. Used instead of MCP1700, AMS1117. More caps / tantals (probably a little bit too much, but I wanted to be sure)
- bigger PCB traces for LED power
- used two pins to control the LEDs (2x1ms is better than 1x2ms Update), also used the UART pins to use hardware if necessary (pins are buffered)
- leave Antenna area as free as possible
- Add boot / flash button + Serial pins for flashing without OTA
- Connected GPIO16 and RST to make a sleep-wakeup with reset possible (ESP has to reset after sleep) (is that layout ok, because I wasn't sure?)
- more resistors for pullup / pulldown pins, instead of hard pullup/pulldown Esp pins
- Used USB C instead of micro USB, because its physically stronger (see picture)
Finally my questions :
- The most important one: Is the new Schematic correct? It's every time very disappointing finding out, after waiting a month for the PCBs, that they are not working properly. (I didn't make the new Layout yet, but I wrote my improvements down.)
- Is the heat problem probably solved with the new Layout? It should be definitely better or? But even the NodeMCU gets a little bit more warm, than what I would define as "normal"
- The "metal case" on the ESP is probably for shielding the electronics from the trace antenna, but between the metal and the chip is a little bit air, because the external SPI Flash is thicker. That is for thermal reasons not very good and could lead to an heat jam. Is it maybe a good idea to leave the metal shielding and directly place the ESP12 components on my PCB with an ceramic antenna. (I know that will be much more complicated when it comes to the layout, and I need to use 4 layers). Is it maybe also possible just to remove the shield, because the ESP-01 doesn't has one either.
- I think for my heat problems the best option would be to use the ESP just for wifi and let it communicate over serial to an ATMEGA328, which controls the LEDs. Because I just need an Wifi update every 5 minutes, the ESP could sleep in the meanwhile, while the Atmega does the rest. But I really dont want to do that, because it would take more space, would be more expensive and more complicated to control. Or is it by far the best option?
The power supply I'm using is an normal 5v smartphone charger with USB cable.
I hope I helped somebody who also wants to make a similar project to figure out some potential errors before. And of course I also hope somebody could help me with my questions
See the Shematics and pictures!
Thank you very much in advance!
PS: sorry for my bad english
Schematic version 1.pdf (23.1 KB)
Schematic version 2.pdf (40.9 KB)