Author Topic: Why does the ESP32 DevKit schematic has a green box?  (Read 1998 times)

0 Members and 1 Guest are viewing this topic.

Offline crgarciaTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Why does the ESP32 DevKit schematic has a green box?
« on: December 27, 2021, 12:08:50 pm »
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 only
When the USB is not plugged, the ESP should be powered from the PSU. This is how the board will be used in normal operation

While studying the DevKit schematics (link), I see there is a green box and I am not sure why is that circuit marked:


Looking at the CP2102 datasheet (link), I think it is wiring it like in page 6 and 9:




Thank you!
 

Offline I wanted a rude username

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: au
  • ... but this username is also acceptable.
Re: Why does the ESP32 DevKit schematic has a green box?
« Reply #1 on: December 27, 2021, 08:58:03 pm »
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 reset
  • nSUSPEND pulled low, presumably taking it out of suspend
  • VBUS connected to the middle of a voltage divider, so that the chip can measure USB voltage greater than the 3.3 V VDD
 
The following users thanked this post: crgarcia

Offline crgarciaTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Re: Why does the ESP32 DevKit schematic has a green box?
« Reply #2 on: December 29, 2021, 10:30:14 am »
Thank you!
I think I don't need SUSPEND, so I will not add that resistor. Will copy the rest.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 11561
  • Country: ch
Re: Why does the ESP32 DevKit schematic has a green box?
« Reply #3 on: December 29, 2021, 12:07:57 pm »
I'm working on a project with a remarkable amount of overlap with this! :P

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 needs very careful 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.

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 reset
  • nSUSPEND pulled low, presumably taking it out of suspend
  • VBUS connected to the middle of a voltage divider, so that the chip can measure USB voltage greater than the 3.3 V VDD
SUSPEND is an output, not an input.

I think I don't need SUSPEND, so I will not add that resistor. Will copy the rest.
I 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.
« Last Edit: December 29, 2021, 12:26:10 pm by tooki »
 
The following users thanked this post: crgarcia

Offline crgarciaTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Re: Why does the ESP32 DevKit schematic has a green box?
« Reply #4 on: February 28, 2022, 09:55:13 pm »
Crap, I never say thanks for your answer @tooki!
I'm working on a project with a remarkable amount of overlap with this! :P

I 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-v17

Thanks!

 
The following users thanked this post: tooki


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf