0
\$\begingroup\$

I have recently started a project where I need to drive some relays and needed wireless connectivity and a few more parameters. My original idea was to design the PCB for the relays with their components and simply leave a place for the ESP32 DevKitC v4.

Much to my dismay I couldn't find the devkit as a whole sold commercially from any of the stores where I would be ordering the parts I require. However looking through the devkits schematics I found that I can find all components separately that the devkit uses, and even some I have at home.

So my idea now is simply to make my own board based around the ESP-32-WROOM (the ESP32S2-WROOM-I-32 in particular). Only big difference I would want to make from the original design is the use of a different USB-UART module, the CH340G.

So I have 2 questions:

  1. What are some general guidelines when I should be following when designing the PCB itself, e.g thicker traces for power, USB lines should be as short and equal as possible etc.
  2. I am not very familiar with the chip, so my next question is about software. I know that the arduinos have a special bootloader for their ATMega chips which you need if you wish to use the arduino IDE. I have become quite comfortable with the IDE and would wish to use it with this board too - so is some bootloader required for it, or can I just follow most of the tutorials on the internet about using the ESP32 with the arduino IDE with no previous software steps required ?
\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Your question might be considered too broad and opinion-based, so might get closed, but I'll offer some tips.

I have designed and built several different PCBs using ESP32-WROOM modules. These modules have the antenna and other essential support components on board, but no USB-to-serial converter. I used the CP2104, but your CH340G alternative should work fine.

The ESP32 does not require any bootloader to be burned onto it, but to engage upload mode, IO0 must be pulled down when the reset line is released. You can install buttons, but I find that fussy, and instead use a 2-transistor timing circuit that is included in many of the Dev Kits. This makes the upload automatic with the Arduino IDE. Of course, OTA upload is even easier once you get your code on the chip. I've posted a schematic of my most recent design below.

For PCB layout of wireless projects, start with the RF/antenna requirements. The ESP32 module has a trace antenna at one end, and it should be located along an edge of the PCB. Pay attention to the keep-out area for best performance. Once the module is positioned, you can lay out the less critical components. Put the USB-to-Serial chip near the USB receptacle if possible. It's ideal to have the USB data traces short and perfectly symmetric, but the upload speed at 1 MHz is reasonably forgiving, and you probably won't have any of the high-current lines like relay coils radiating noise during the upload. Do consider current draw when sizing the power traces, and have as much ground plane as possible to reduce noise and improve antenna performance. I've included a layout and a rendering of the PCB as well. Good luck!

Schematic PCB Layout PCB Rendering

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you very much for the indepth answer, clear explanations and the provided schematics!! This was very helpful and informative. \$\endgroup\$ Jul 28, 2023 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.