Author Topic: AMS1117 3.3 and ESP32 circuits - help  (Read 2809 times)

0 Members and 1 Guest are viewing this topic.

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
AMS1117 3.3 and ESP32 circuits - help
« on: November 27, 2024, 08:25:53 am »
Hello everyone! I was redirected from KiCad forum here.

I have few questions if someone is willing to help me.
(yes, I've searched the Internet for some answers but people tend to give different answers so I'm not sure is it OK or not)

I have some previous knowledge about electronics from school (but mostly I forgot alot of things),
I've been working as a software engineer for a long time.

I'm trying to design ESP32-S2 MCU circuit and PCB in KiCad. The purpose of this project is - to learn something new about circuit / PCB design (and electronics in general)
and second - I have an old Vaillant VRT30 temperature regulator for Vaillant central heating.

I want to design a PCB with ESP32 that will have a relay (I'll add it later) and it will be powered over USB (for programming)
and I'll later add additional power supply socket. (5 to 12 V)

First of all I'd like to know - will this circuit(s) work?

ESP32 must be able to boot and I only want to upload programs over USB.
No SPI, I2C and other things ...
WiFi antenna will be added later.

Could you please tell me (besides that I accidentaly switched D_BUS + and D_BUS -) what is wrong?
Will ESP32 be able to boot and could I programm it?

Could you help me with advices (and also if you e.g. say "remove this capacitor" or "remove this resistor" - I'd like to know why.
I'm not an expert in this area. Explain it in layman terms if possible.)


ESP32 image: https://ibb.co/6RsX9bW
Voltage regulator image: https://ibb.co/2jKq46J

(I put links because images are not shown for some reason ...)

P.S.
- I will use JLCPCB to print the PCB.
- I don't care that it is "waste of time or money" - I'm learning (hobby project)!
- I know there are ESP32 units and modules I could buy for lower price - that's not the point of my project.

Thank You in advance.
I hope someone is willing to help me with some advices.
Remember, you were also a begginers at some point in time ... :)

Best regards!

« Last Edit: November 27, 2024, 08:43:33 am by NightRider92 »
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #1 on: November 27, 2024, 10:06:15 am »
Anyone? So much views but nobody helps ..
Please, help :)
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #2 on: November 27, 2024, 12:03:17 pm »
  • Reset circuit very strange (and definitely not working)
  • C6 & C7 not needed
  • Some capacitors across power of ESP32 module preferable
  • Double check pullup/pulldown resistor on USB line (take look in ESP user guide in USB section)
  • R2 value is too small. 1mA for modern LED is enough (R2 should be in 1-1.5K range)
« Last Edit: November 27, 2024, 12:36:15 pm by xvr »
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 8180
  • Country: nl
  • Current job: ATEX product design
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #3 on: November 27, 2024, 12:11:17 pm »
Hi. These ESP modules like to quickly drain a lot of current, therefore a large 100uF-1000uF electrolytic capacitor is recommended on the 3.3V line.
Your USB data pins are reversed.
You should include at least a 100nF capacitor for each power pin.
Making an RF circuit is very difficult. You should listen to those people who tell you to use a module. Pilots also have to learn to land, before they are allowed to fly a plane for a reason.
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #4 on: November 27, 2024, 12:48:08 pm »
  • Reset circuit very strange (and definitely not working)
  • C6 & C7 not needed
  • Some capacitors across power of ESP32 module preferable
  • Double check pullup/pulldown resistor on USB line (take look in ESP user guide in USB section)
  • R2 value is too small. 1mA for modern LED is enough (R2 should be in 1-1.5K range)

Why C6 and C7 are not needed?
What is wrong with reset circuit?
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #5 on: November 27, 2024, 12:50:54 pm »
Hm, is it better then to make a PCB that will have ESP32 socket (to plug ESP32 in)
with relay and other sensors I need?

I mean, I'd really like to learn all of that ...
For RF circuit I'd take schematics that works (found on Internet?)

P.S.
https://docs.espressif.com/projects/esp-hardware-design-guidelines/en/latest/esp32/_images/esp32-sche-core.png
Schematics (includes RF circuit) - it does not look so hard to make.

But, please, try to understand, my problem is that I want to learn WHY do I need to place e.g. capacitor, resistor, coil, etc ...
How would you design such circuit? By looking other schematics? Or do you do in from top of your head?
Maybe stupid questions, but I did not have chance to learn such things in real life.

I'm thinking, how else I'm supposed to learn?
The best way would be to make the PCB and someone explain me why I must do (e.g. remove capacitors or make something in different way) so I could use that knowledge in other projects.
« Last Edit: November 27, 2024, 01:03:22 pm by NightRider92 »
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #6 on: November 27, 2024, 01:30:17 pm »
Quote
Why C6 and C7 are not needed?
Capacitors used to store energy and to provide decoupling for local IC. There is no any energy consumer here and no IC to decoupling. Only one consumer of power from VBus is LDO, but it has it's own capacitors for this purpose on its input.
Quote
What is wrong with reset circuit?
Everything. Capacitor should be connected between ESP EN pin and ground but not in series with it and reset button.
Button itself should be connected in parallel with capacitor. And pull up resistor for EN pin also desired.
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #7 on: November 27, 2024, 01:42:16 pm »
What would you suggest me to do?

I still want to learn.
What is the best way to learn how to design such circuits except
"buy module that exist"?
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #8 on: November 27, 2024, 01:52:45 pm »
Quote
What would you suggest me to do?
ESP products available in 3 different ways:
  • Raw chip. Using it in this form require deep knowledge of RF circuitry (including PCB layout), and it is not recommended for beginners (and frankly speaking not recommended for everyone, unless you want to produce your ESP32 MCU based device in billions)
  • ESP module. This is more preferable form to create your own PCB for your product. This module already includes all RF circuitry, so you can concentrate your development around peripheral and system in a whole
  • Dev board. It consists of ESP module and all needed to run it. This form suitable for breadboard prototyping, because in implemented in DIP for factor with all pins to connect already in place. This form not very suitable for PCB because it itself ready made PCB made for easy use of ESP module, but customer PCB includes the same circuitry and partially implement the same functions.
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #9 on: November 27, 2024, 02:18:56 pm »
So, if i pick option 2, how would I do that?  I'm afraid I don't understand.

I'm designing PCB in KiCad. I could get "finished" schematics of ESP32 that works and continue working on it?

Should I make a socket that accepts entire ESP32 module (or something like that) and do other things I want on
that same PCB (like adding a relay, sensors, etc ...) ?
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #10 on: November 27, 2024, 02:28:50 pm »
Quote
I'm designing PCB in KiCad. I could get "finished" schematics of ESP32 that works and continue working on it?
Yes

Quote
Should I make a socket that accepts entire ESP32 module
No. ESP32 module should be soldered directly to PCB (without sockets)

Quote
and do other things I want on
that same PCB (like adding a relay, sensors, etc ...) ?
Yes. You can use raw chips/sensors, soldered directly on PCB or install sensors/modules as separate modules in special sockets on PCB (sometimes ready made modules can be preferable over raw chips, soldered directly on PCB)

If you have some hesitations you can always prototype your system in advance on breadboard and standalone modules (here DevBoard of ESP32 (v3) can be used). After successful prototyping you can transfer design to PCB in any form
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #11 on: November 27, 2024, 02:31:25 pm »
Hm..and where should I get "entire schematics"?

If I get it from the internet - isn't that the same way as continuing working on my current PCB
and just add e.g. RF circuirty (by copying it)?
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #12 on: November 27, 2024, 02:36:26 pm »
'entire schematic ' depends of your design. Nobody in Internet can't say what you will connect to your ESP32 and how you will use it. You should developed it himself
 

Offline PGPG

  • Frequent Contributor
  • **
  • Posts: 390
  • Country: pl
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #13 on: November 27, 2024, 02:36:54 pm »
(I put links because images are not shown for some reason ...)

With images, someone suggested editing the message after posting it.

Or do you do in from top of your head?

From head.
About PCB design I have posted in 2020 some (very valuable in my opinion) links at KiCad:
https://forum.kicad.info/t/decoupling-capacitor-via-placement/25132/14
https://forum.kicad.info/t/decoupling-capacitor-via-placement/25132/19
After reading these articles you should understand why my typical 2 layer PCB have one layed destined only to GND and looks like this:
https://forum.kicad.info/t/approaching-pcb-track-routing-for-a-newbie/36302/8

Only one consumer of power from VBus is LDO, but it has it's own capacitors for this purpose on its input.

In your schematic you didn't specified values for these capacitors but capacitance at VBUS is limited (USB documentation - don't remember the max C) because USB is intended to be connected during main PC operating and too high capacitance will be generating too high temporarily voltage deeps.

I know nothing about ESP32 so will not be writing about it.
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #14 on: November 27, 2024, 02:49:41 pm »
Sorry for misunderstanding - I meant "entire schematics" for bare ESP32 (nothing else).
So, in that case, I could finish what I already made and also copy RF circuitry from "working" schematics in that way ... isn't that so?
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #15 on: November 27, 2024, 02:50:45 pm »
(I put links because images are not shown for some reason ...)

With images, someone suggested editing the message after posting it.

Or do you do in from top of your head?

From head.
About PCB design I have posted in 2020 some (very valuable in my opinion) links at KiCad:
https://forum.kicad.info/t/decoupling-capacitor-via-placement/25132/14
https://forum.kicad.info/t/decoupling-capacitor-via-placement/25132/19
After reading these articles you should understand why my typical 2 layer PCB have one layed destined only to GND and looks like this:
https://forum.kicad.info/t/approaching-pcb-track-routing-for-a-newbie/36302/8

Only one consumer of power from VBus is LDO, but it has it's own capacitors for this purpose on its input.

In your schematic you didn't specified values for these capacitors but capacitance at VBUS is limited (USB documentation - don't remember the max C) because USB is intended to be connected during main PC operating and too high capacitance will be generating too high temporarily voltage deeps.

I know nothing about ESP32 so will not be writing about it.

Thank you for the info!
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #16 on: November 27, 2024, 03:05:09 pm »
Quote
Sorry for misunderstanding - I meant "entire schematics" for bare ESP32 (nothing else).
For bare ESP32 module it is just power, reset circuit (optional) and programming (UART or USB in your case). That is all.
Quote
also copy RF circuitry from "working" schematics in that way
There is no 'RF circuitry' for ESP module - it already contains all required RF (up to antenna) inside.

Take a look - https://github.com/xvrxvr/EventCalendar It is complete ESP32 based embedded device. ESP32-WROOM, LCD with touch, Fingerprint sensor, 8 solenoids.

Unfortunately power supply used in project (ready made blocks from Aliexpress + AC/DC block from Meanwell) provides power with slow power up rate, so I have to install external POR circuit (just capacitor over EN pin is not enough)
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #17 on: November 27, 2024, 03:26:02 pm »
Oh, I misunderstood then because someone said that "making an RF circuitry is hard". So you got the point, I just want USB and power up for the start, and I'll later add antenna, relay and sensors that I need. So, long story short - power supply is generally OK? ESP32 has few mistakes and if I correct them it will be able to boot and be able to be programmed?

Thanks for Your advices and the link!
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #18 on: November 27, 2024, 03:32:14 pm »
Power supply is OK. But before starting you should select suitable for you ESP32 module. There are many different versions exists, but in your original schematic raw MCU used, it is not a module.
And another one, if you decide to add blocks one by one it will be better take DevBoard and prototype everything on breadboard. It much easier than reroute and redo PCB for each new attached device.
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #19 on: November 27, 2024, 04:39:37 pm »
Got home from the job and redesigned the schematics.

Is this better now?

https://ibb.co/hH9fxNz

Response from Copilot:

Assessment:

This circuit is a typical configuration for enabling and disabling the ESP32 module using a push button. The resistor ensures the EN pin is normally high, and the capacitor helps in debouncing the switch. This setup should work correctly for enabling and disabling the ESP32 module.

Based on this setup, it should function as expected. If you have any more specific questions or need further assistance, feel free to ask!
« Last Edit: November 27, 2024, 04:43:04 pm by NightRider92 »
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #20 on: November 27, 2024, 04:43:00 pm »
Better, but C5 should be in parralel with button (now it's just short-circuted). C6 & C7 still here and still useless
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #21 on: November 27, 2024, 04:45:19 pm »
Isn't that C6 and C7 will be used for "debouncing" (at least Microsoft Copilot AI says that)?

Could You, please, clarify why is it useless? I know I'm asking "stupid" questions but I'm really not sure why is ti OK or why is something wrong,
altough answers here on forum really have helped me already.

And I'd like to state my understanding what EN circuit does. Please correct me.

So from 3.3V current goes through 1k5 (small current because of larger resistor) to EN and it keeps it HIGH so the device won't reset.
When button is pressed EN goes to LOW (because of GND connection) because there is too small current flowing from 3V3 and C5 capacitor (corrected now, in parallel between button) is used to "debounce"
the signal (no inteference).

Am I wrong?

Also, this is not ESP32 module I assume (not raw chip), right?
« Last Edit: November 27, 2024, 04:51:10 pm by NightRider92 »
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #22 on: November 27, 2024, 04:50:20 pm »
C6 & C7 & C1 & C2 all connected in parallel. So only 2 of them is enough. Diode in between them doesn't matter, because there is no any circuit on USB side that needed debouncing (from C5 & C6). Only power source there (USB)
 

Offline NightRider92Topic starter

  • Contributor
  • Posts: 36
  • Country: hr
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #23 on: November 27, 2024, 04:52:53 pm »
So I'm doing debouncing twice. First with C1 and C2 and then I did it again with C6 and C7, right?
Nice explanation! Thank You alot! It is kinda abstract to me ...

Could you please look up at my previous post (modified it) and correct my understanding of EN circuitry?
 

Online xvr

  • Frequent Contributor
  • **
  • Posts: 542
  • Country: ie
    • LinkedIn
Re: AMS1117 3.3 and ESP32 circuits - help
« Reply #24 on: November 27, 2024, 04:54:31 pm »
> Am I wrong

Now you are right (almost). C5 used not for debouncing, but to Power On Reset. It keeps EN pin in 0 sone time after powering up (when it charged)

And now you use ESP32 module, yes.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf