Why does the ESP32 DevKit schematic has a green box? - Page 1
Forum section: electronics / beginners

author: crgarcia
author_rank: Regular Contributor
timestamp: December 27, 2021, 12:08:50 pm
content: I am trying to copy the ESP32 DevKit USB behavior in my own PCB (my pcb project).When the USB is plugged, ESP should be powered from USB. I will use this to program the board onlyWhen the USB is not plugged, the ESP should be powered from the PSU. This is how the board will be used in normal operationWhile studying theDevKit schematics (link), I see there is a green box and I am not sure why is that circuit marked:Looking at theCP2102 datasheet (link), I think it is wiring it like in page 6 and 9:Thank you!

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: December 27, 2021, 08:58:03 pm
content: No obvious reason why those nets should be in a green box, but they're all things the CP2102 requires:nRST pulled high, taking it out of resetnSUSPEND pulled low, presumably taking it out of suspendVBUS connected to the middle of a voltage divider, so that the chip can measure USB voltage greater than the 3.3 V VDD

author: crgarcia
author_rank: Regular Contributor
timestamp: December 29, 2021, 10:30:14 am
content: Thank you!I think I don't need SUSPEND, so I will not add that resistor. Will copy the rest.

author: tooki
author_rank: Super Contributor
timestamp: December 29, 2021, 12:07:57 pm
content: I'm working on a project with a remarkable amount of overlap with this!I don't know why there's the green box. I haven't found any note explaining it. But if you've copied the schematic exactly, it'll work as you expect.Some other comments:- why the dual 3W resistors on the sense optocoupler inputs? As configured, you're using a drive current of 0.575mA, so you're only dissipating 132mW across two resistors (so 66mW per resistor).- the optocoupler datasheet rates it at 1mA, but the characteristic curves and typical Vf values are rated at 1mA up to 20mA+. Given that you're using these as switches, you're better off letting the output transistors saturate by using a bit higher. (When using BJTs as switches, one normally "overdrives" them to 2-5 times the saturation current.) I'd perhaps do 1.5mA. At 1.5mA you're still only dissipating around 350mW, easily handled by a few small resistors in series (e.g. three 51K resistors in series) or one 1/2W resistor. You can make the resistor happy by using fat traces to and from it, which will help it dissipate heat.- the USB side of the CP2102N needsverycareful layout. If, like me, you don't know exactly what you're doing (which you say you don't in the review document), then copy the exact layout used in the dev board. A colleague of mine tried laying out a copy of the same dev board, but didn't know that USB traces need care, and his boards simply did not work. An exact copy worked fine. USB traces need to be length-matched, and ideally need to be controlled-impedance traces. So copying that layout is the lowest-risk option.- if you're using electromagnetic relays, then you need freewheeling diodes across them. Dave just did a video on this exact topic. (I haven't watched it yet). In my project, I opted for solid-state relays (SSRs) to reduce switching noise (since most SSRs have built-in zero-crossing circuitry, so the relay always switches at the point where the AC waveform is at 0V). SSRs are also optocouplers in and of themselves, so they eliminate the need for a driver since you only need to drive a small LED instead of a coil.Quote from: I wanted a rude username on December 27, 2021, 08:58:03 pmSUSPEND is an output, not an input.Quote from: crgarcia on December 29, 2021, 10:30:14 amI assume the “NC” next to it means “no connection”, i.e. not populated. As best I can tell, the suspend signal ("Active") isn't used anywhere in the dev board design.

author: crgarcia
author_rank: Regular Contributor
timestamp: February 28, 2022, 09:55:13 pm
content: Crap, I never say thanks for your answer @tooki!Quote from: tooki on December 29, 2021, 12:07:57 pmI did a lot of changes since my last post.The 3W resistors are because before I was using another optocoupler that looked really interesting (HCPL3700). It ended up not being a good idea for high voltages (mains) and it heated the resistors quite a bit (2x39k).The LDA210 worked with up to 4MOhms, Incredible!. Anyways, I went with 2 x 150kOhms resistors.You were right with the USB part. I took a lot of care and it worked fine. Now I am changing to USB-C in my next version, hope it works:https://github.com/crgarcia12/electronics-homeassistant-lightscontroll/tree/main/PCB/schematics-v17Thanks!