You need to use EasyEDA editor to create some projects before publishing
Mini LED PCB board project. Use BSS138 for logic level shifting?
982 6
diybrit 2 years ago
Yet another LED board project… My 1st attempt failed, working on 2nd… Does this BSS138 based logic level shifter schematic and layout look okay to you? Trying to boost data signal from QTPY ESP32 to first WS2812B RGB LED. Maybe shifter isn’t required for such a tiny project? Am trying to minimize failure risk. This is my 1st custom PCB design, my goal is to learn and have fun, so any feedback/suggestions are appreciated. Currently using [BSS138AKDW\-TP MCC\(Micro Commercial Components\) \| C779245 \- LCSC Electronics](https://lcsc.com/product-detail/MOSFETs_MCC-Micro-Commercial-Components-BSS138AKDW-TP_C779245.html). Came up with my schematic based on info mostly from Adafruit learning docs/discord, [https://www.digikey.com/en/blog/logic-level-shifting-basics](https://www.digikey.com/en/blog/logic-level-shifting-basics) and the YouTube rabbit hole. Didn’t realize EasyEDA forum existed until recently. ![schematic](https://canada1.discourse-cdn.com/free1/uploads/wled/original/2X/a/a6f092e4399227256780d06742ad48242146be45.png) ![schematic.2](https://canada1.discourse-cdn.com/free1/uploads/wled/original/2X/7/7a563a50200443e98384dfde695b4c15b427cdc5.png) ![layout.v1](https://canada1.discourse-cdn.com/free1/uploads/wled/optimized/2X/8/880868040f12c9621eb07fa10b62cdf76fc5a957_2_497x500.png) ![layout.v2](https://canada1.discourse-cdn.com/free1/uploads/wled/optimized/2X/8/86210c36ae455fbcb314ffe3875baea80b6d2d0e_2_538x500.png) Can just about visualize ~3V3 data signal on my cheapo DSO138 scope, but am unable to reliably visualize boosted ~5V signal with enough clarity to inspire confidence that the level shifter fragment of the circuit is good enough for ‘neopixel’ frequencies. Not sure if scope and/or BSS138 and/or me are the issue. I did temporarily hack code to set pin constantly high, this helped verify ~3v is boosted to ~5V. However success at constant 0hz doesn’t mean the circuit works at neopixel frequencies. Mentioning this, because am seeing misc interweb info saying BSS138 are only good up to 2mhz(?). Currently using 10K pull-up, anyone think lower value e.g. 2.2K would be better and help with working well at the 800khz that WS2812B use? ![inspecting_fail](https://canada1.discourse-cdn.com/free1/uploads/wled/optimized/2X/5/529e025c9c935ff33e454126d840bb7fa15b8959_2_690x403.jpeg) My 1st batch of boards failed/partially-fail various reasons. Found and fixed several problems as I work on 2nd version, for example: * Used WorldSemi WS2812B-mini 3535 RGB, the LEDs fail in various spots. Would use SK2812 (seem to be more reliable?) but no stock for size I want. Might use jlcpcb’s global part sourcing option. * Larger traces, 0.4mm or larger (was 0.254mm). * Larger clearances for traces and copper fills, so less antenna GND copper fill in tiny nooks. * Removed VIAs under LEDs, my poor attempt at thermal management. * Made board larger, so parts are >=2mm from board edge (was just 1mm). In addition to my design issues, am concerned LEDs are being damaged during jlcpcb SMT assembly, or panel cutting. * Increasingly leaning towards using 5050, feels like assembly will be easier and more reliable. * Currently drooling over Amzn’s top selling scope ($400!), but trying to find something good enough and much much cheaper. Suggestions appreciated! Thanks for reading, articulating a problem can be cathartic if nothing else :-)
Comments
JLCPCBsupport 2 years ago
Hello Thank you for your post. Kindly change the topic of this post to "General Discussion" section to get more attention and useful replies. If your previous board failed due to JLCPCB manufacturing process then please specify the faults made by JLCPCB and we will check this as soon as possible. <br> Thank you.
Reply
diybrit 2 years ago
@jlcpcbsupport thank you for following up and the suggestion.  Have moved to general discussion.
Reply
andyfierman 2 years ago
@diybrit, About the cheapest good quality scope you can get is a PicoScope 2204A: [https://www.picotech.com/oscilloscope/2000/picoscope-2000-overview](https://www.picotech.com/oscilloscope/2000/picoscope-2000-overview)
Reply
andyfierman 2 years ago
[@diybrit](https://oshwlab.com/andyfierman/bss138-level-shifter), Below is a simulation of the BSS138 in a couple of simple logic level shifters based on: Figure 1: Basic, single bus, level translation MOSFET circuit. and: Figure 7: Isolated bus lines in a translated data communication circuit. in: [https://www.digikey.co.uk/en/blog/logic-level-shifting-basics](https://www.digikey.co.uk/en/blog/logic-level-shifting-basics)<br> <br> [https://oshwlab.com/andyfierman/bss138-level-shifter](https://oshwlab.com/andyfierman/bss138-level-shifter)<br> <br> How well it suits your purposes depends on how fast you need to clock your data and how tolerant the WS2812B-MINI chips are of that spiked slow upper rising edge section. However since you only need to level shift from the 3.3V QT PY data output signal to the 5V WS2812B-MINI data input level you only need to use the non-isolated version and you can omit R1 (10K). BTW, 1. your schematic is of the non-isolated version anyway as you have left the second BSS138 device unconnected;  2. do not leave the pins on the unused second BSS138 device floating: connect the unconnected pins to ground; 3. you could avoid any question of the spike in the rise time if you used a simple common source inverting level shifter where the circuit if essentially the same as the non-isolating shifter but the BSS138 source pin is grounded and the output from the QT PY goes directly to the BSS138 gate. The logic sense is inverted but that should be a simple coding change to correct. Try it in the simulation! :)
Reply
andyfierman 2 years ago
@diybrit, The exact value of the decoupling caps for the WS2812B-MINI chips is not critical. If you have used ceramic caps then 1uF or 100nF should be OK as long as they are X7R or X5R dielectric and rated at 10V or more. If they are rated at 6.3V then use the 1uF parts you have already as they will still have more residual capacitance at 5V than a 100nF 6.3V part. If they are Y5V or Z5U dielectric then apologise to them before putting them in the WEEE bin because they are not capacitors. They are tiny little disasters waiting to cause chaos in your circuits. This is a good introduction to the issues with modern ceramic caps: [https://www.edn.com/temp-and-voltage-variation-of-ceramic-caps-or-why-your-4-7-uf-part-becomes-0-33-uf/](https://www.edn.com/temp-and-voltage-variation-of-ceramic-caps-or-why-your-4-7-uf-part-becomes-0-33-uf/)<br> <br>
Reply
andyfierman 2 years ago
Don't forget to decouple the supply into the QT PY too.
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,建议访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice