ESP32 WROOM model with Lora SX1278 for gas sensing - Page 1
Forum section: electronics / general

author: iambstha
author_rank: Contributor
timestamp: September 01, 2023, 06:38:48 am
content: Hello,I have designed the circuit using KiCAD already. Just some knowledge gathering from internet and stuffs. I want to build it professionally and for commercial use, since it's one of my client's project. I have attached the KiCAD design image, can anybody help be redesign the circuit professionally?

author: newto
author_rank: Regular Contributor
timestamp: September 01, 2023, 03:59:51 pm
content: Firstly, you should probably start inhttps://www.eevblog.com/forum/projects/for advice on the circuit, and then go over some tutorials on how to do PCB layout (and I recommend building it on a breadboard first to make sure everything works if you can).Some immediate notes:1) You're using a bare ESP32 WROOM module, but your circuit has no way of programming it, you need to either add a USB-UART bridge and USB port, switch to an ESP32 with a built in USB interface like a ESP32-S3, or switch to a prebuilt module with that integrated already.2) your ultrasonic sensor needs 5V, not 3.3V.3) the LORA module uses SPI, so you will need the SCK pin connected as well.4) you don't have any power supply on the board, so you'll need to feed it 3.3V externally (and 5V for the ultrasonic sensor), or add a voltage regulator.5) You should add bypass caps to the power pins of the chips connected to ground, 0.1uF or 1uF is usually fine, but some chips may recommend higher (I think the ESP32 asks for 22uF)Mostly I recommend getting an ESP32 dev module and build the circuit on a breadboard before trying to manufacture this, it would solve problems 1 and 2 (they generally take 5V in via USB, and have a 3.3V regulator, and you can draw from pins on the module to power your other parts.

author: iambstha
author_rank: Contributor
timestamp: September 01, 2023, 06:41:23 pm
content: Noted. I would certainly make changes as you said and soon will be posting the new circuit design. Thanks a lot.

author: iambstha
author_rank: Contributor
timestamp: September 03, 2023, 04:37:33 am
content: And by the way, the circuit as I have presented works perfectly. I want to maximize the efficiency, I guess.

author: nvmR
author_rank: Regular Contributor
timestamp: September 03, 2023, 07:28:43 am
content: Welcome to the forum.I would add more debug capability - test points.Also, consider to save money, add the circuitry for using the ESP32 itself, and not the module. You would need to copy the design from the WROOM. It is doable as a dual footprint, so either the WROOM or the ESP32 may be assembled. It could save a few $ per PCB.Also, consider adding some decoupling capacitors to the power rails, for good measure.

author: iambstha
author_rank: Contributor
timestamp: September 04, 2023, 04:00:37 am
content: Thank you. I would certainly try to use ESP32 chip itself rather than the WROOM model. Let me try and I will let you know if that works. And, yes, I have been designing the circuit with added decoupling capacitor to the power signal lines. I will soon post the new design.

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 10:26:46 am
content: Quote from: iambstha on September 04, 2023, 04:00:37 amI suspect that using the bare ESP32 chip is well beyond OP’s abilities, given that it requires skill in antenna design (and RF certification, if the thing is to be sold!!).It’s FAR wiser to use the module, since it’s already certified by the radio authorities.For those who don’t know ESP32 terminology, this is the hierarchy in the ESP32 world:1. Bare chip: requires user to supply all support components2. Module: chip on a very small castellated PCB, with necessary support components like quartz crystal, (optional) external RAM, Flash memory, wireless antenna and/or antenna connector, etc preinstalled. In many modules, the circuitry is under a shield can.3. Dev kit: module on a small breakout PCB with voltage regulator, power LED, USB programming port (and native USB port on some models), boot mode and reset buttons, and headers.

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 10:27:44 am
content: Quote from: iambstha on September 03, 2023, 04:37:33 amHow do you know if you haven’t built one?Quote from: iambstha on September 03, 2023, 04:37:33 amMeaning what exactly?

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 10:33:06 am
content: Quote from: iambstha on September 01, 2023, 06:38:48 amNo power supply, no programming interface (including delay capacitor to ensure reliable programming), no I2C pull-ups…Have you verified that the pins you chose for SPI can actually be used for SPI? There are some limitations… Since you have more than enough free GPIOs, I would avoid using GPIO2 (it’s one of the bootstrap pins) and GPIO >30 (some have restrictions).

author: iambstha
author_rank: Contributor
timestamp: September 04, 2023, 10:37:33 am
content: I have built the prototype first. I have the prototype ready in my breadboard.Communications through LORA sender is fine.Even Lora Receiver is fine.Code is ready.Data has been transferred and already been pushed to the database.API is ready.Almost everything for prototyping is done, but the problem is that, I am new to designing these circuits in KiCAD or any other circuit modelling software. So I am having the issue. I am not sure how all these symbols and footprints work.

author: iambstha
author_rank: Contributor
timestamp: September 04, 2023, 10:41:29 am
content: Quote from: tooki on September 04, 2023, 10:26:46 amThank you for clearing that up. So should I stick with the dev kit?

author: iambstha
author_rank: Contributor
timestamp: September 04, 2023, 10:42:23 am
content: Quote from: tooki on September 04, 2023, 10:27:44 amI have built the prototype first. I have the prototype ready in my breadboard.Communications through LORA sender is fine.Even Lora Receiver is fine.Code is ready.Data has been transferred and already been pushed to the database.API is ready.Almost everything for prototyping is done, but the problem is that, I am new to designing these circuits in KiCAD or any other circuit modelling software. So I am having the issue. I am not sure how all these symbols and footprints work.

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 11:23:01 am
content: Quote from: iambstha on September 04, 2023, 10:41:29 amI probably would for now, until you have more experience with PCB design.If you do decide to use a WROOM module, you’ll have to provide power supply circuitry and a programming header, or include the USB circuitry. From experience, I can tell you that bad USB layout can cause USB to fail altogether. So if you want to use the WROOM module, then I wouldn’t try USB yet, but instead provide a header for use with the ESP-PROG programmer. (Carefully study the DEVKIT-C schematic to understand what you need to provide.)I have designed successful boards with the WROOM module, but on my last project, I used a dev kit, because I was on a tight deadline and didn’t need to optimize for space, cost, or power consumption. (I’ll do that on a future revision by redesigning with an ESP32 module.)

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 11:25:33 am
content: Since you didn’t answer this before:Quote from: iambstha on September 03, 2023, 04:37:33 amMeaning what exactly?

author: iambstha
author_rank: Contributor
timestamp: September 04, 2023, 11:37:59 am
content: Quote from: tooki on September 04, 2023, 11:23:01 amOkay sure. Thank you. I would try out with the dev kit for now. But can you help me with the circuit design in KiCAD? What needs to be changed? Or added? Or anything else?

author: iambstha
author_rank: Contributor
timestamp: September 04, 2023, 11:39:16 am
content: Quote from: tooki on September 04, 2023, 11:25:33 amI guess it was a bad choice of words. Anyway, I meant to get an idea behind adding decoupling capacitors and adding debugging circuitry for less chances of circuit failure.

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 12:18:54 pm
content: Quote from: iambstha on September 04, 2023, 11:37:59 amThe first thing is to replace the symbol for the WROOMmodulewith the symbol for the WROOM (or WROVER)dev kit.I’m not sure what else you need to know. If your circuit actually works on your breadboard, then it should be clear what you need to transfer over.(If you are using breakout boards in your working prototype: if you intend to use breakout boards going forward, then you place connectors to connect the breakout boards with. If you want to put the bare components directly onto the PCB, then you need to copy the entire minimum circuit from the breakout board onto the PCB.)Maybe do some KiCad tutorials, and do some simpler test layouts first, like starting with a simple connector, resistor, and LED. Then a simple LED blinker, 555 timer, or op-amp circuit. Something familiar to get started with. It’s beyond the scope of this thread to explain to you how to use KiCad step by step from the ground up.

author: tooki
author_rank: Super Contributor
timestamp: September 04, 2023, 12:28:17 pm
content: Quote from: iambstha on September 04, 2023, 11:39:16 amI don’t know what you mean by this.Decoupling caps are generally a good idea, but in professional circuit design, you study your components’ datasheets and application notes to see what the manufacturer suggests, too.Debugging circuitry doesn’t have anything to do with circuit failure. Debugging circuitry is so you can debug your code. (If you want debugging, then you need to add a JTAG header connected to the ESP32’s JTAG pins, which are GPIOs 12-15.)

author: iambstha
author_rank: Contributor
timestamp: September 05, 2023, 12:29:52 pm
content: Quote from: tooki on September 04, 2023, 12:18:54 pmThank you so much, I think I would do a bit of research for now. I will study the ESP32 wroom datasheet and KiCAD starting tutorials, I guess. I would soon update the new circuitry after a while.

author: iambstha
author_rank: Contributor
timestamp: September 05, 2023, 12:31:11 pm
content: Quote from: tooki on September 04, 2023, 12:28:17 pmBy debugging, I thought of adding some components in order to prevent circuit failure, but I think I should see the datasheet first. I would do that for now.