AMS1117 3.3 and ESP32 circuits - help - Page 1
Forum section: electronics / beginners

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 08:25:53 am
content: 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 - tolearn something newabout 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 bepowered over USB(for programming)and I'll later addadditional 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/6RsX9bWVoltage 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!

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 10:06:15 am
content: Anyone? So much views but nobody helps ..Please, help

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 12:03:17 pm
content: Reset circuit very strange (and definitely not working)C6 & C7 not neededSome capacitors across power of ESP32 module preferableDouble 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)

author: tszaboo
author_rank: Super Contributor
timestamp: November 27, 2024, 12:11:17 pm
content: 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.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 12:48:08 pm
content: Quote from: xvr on November 27, 2024, 12:03:17 pmWhy C6 and C7 are not needed?What is wrong with reset circuit?

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 12:50:54 pm
content: 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.pngSchematics (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.

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 01:30:17 pm
content: QuoteCapacitors 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.QuoteEverything. 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.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 01:42:16 pm
content: 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"?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 01:52:45 pm
content: QuoteESP 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 wholeDev 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.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 02:18:56 pm
content: 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 onthat same PCB (like adding a relay, sensors, etc ...) ?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 02:28:50 pm
content: QuoteYesQuoteNo. ESP32 module should be soldered directly to PCB (without sockets)QuoteYes. 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

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 02:31:25 pm
content: 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 PCBand just add e.g. RF circuirty (by copying it)?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 02:36:26 pm
content: '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

author: PGPG
author_rank: Frequent Contributor
timestamp: November 27, 2024, 02:36:54 pm
content: Quote from: NightRider92 on November 27, 2024, 08:25:53 amWith images, someone suggested editing the message after posting it.Quote from: NightRider92 on November 27, 2024, 12:50:54 pmFrom 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/14https://forum.kicad.info/t/decoupling-capacitor-via-placement/25132/19After 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/8Quote from: xvr on November 27, 2024, 01:30:17 pmIn 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.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 02:49:41 pm
content: 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?

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 02:50:45 pm
content: Quote from: PGPG on November 27, 2024, 02:36:54 pmThank you for the info!

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 03:05:09 pm
content: QuoteFor bare ESP32moduleit is just power, reset circuit (optional) and programming (UART or USB in your case). That is all.QuoteThere is no 'RF circuitry' for ESP module - it already contains all required RF (up to antenna) inside.Take a look -https://github.com/xvrxvr/EventCalendarIt 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)

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 03:26:02 pm
content: 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!

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 03:32:14 pm
content: 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.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 04:39:37 pm
content: Got home from the job and redesigned the schematics.Is this better now?https://ibb.co/hH9fxNzResponse 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!

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 04:43:00 pm
content: Better, but C5 should be in parralel with button (now it's just short-circuted). C6 & C7 still here and still useless

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 04:45:19 pm
content: 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?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 04:50:20 pm
content: 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)

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 04:52:53 pm
content: 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?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 04:54:31 pm
content: > Am I wrongNow 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.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 04:57:16 pm
content: Umm..ok, C5 charges and keeps EN grounded for a while ...but the thing is I don't get it why does it keep 0 (when you release the button) ...?So ... When button is pressed it charges I assume.But when the button is released it starts discharging (Why excatly? Because of EN pin or resistor?) and provides connection to GND overriding 3V3 until it discharges completely?Update of schematics:https://ibb.co/NNQhzVN

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 05:05:52 pm
content: > When button is pressed it charges I assume.Vice versa. On pressed button it discharged instantly through button. When button released it start charging through resistor.And when it charged voltage on it gradually raised from 0 to 3.3V. And the same voltage applied to EN pin. So during charge process ESP kept in reset state

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 05:20:10 pm
content: I see ...And what in case we don't have resistor (in both cases)?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 05:25:28 pm
content: > And what in case we don't have resistor (in both cases)We need a resistor - it form charge path. Without it capacitor has no current to be charged

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 05:26:25 pm
content: I mean, what is the difference between C3 C4 capacitors that dont have resistor(pretend we don't have LED) ... and EN circuitry capacitors?C1 C2 C3 and C4 have no resistors ... what is the story there then?And additional question, in EN circuitry, why would current rather go through capacitor(to charge it) than to EN pin when the button is released?I mean, now you realise how much I don't know and why do I ask such questions.Stuff like that prevents me from building something "from top of my head" ...

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 05:31:26 pm
content: This is energy storage capacitors, they charged directly from power rail without any resistors. Reset capacitor is a timing circuit, it should charge in time controlled maner, so resistor provide such control. Energy storage and debouncing capacitors do not performed any timing functions

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 05:34:00 pm
content: > And additional question, in EN circuitry, why would current rather go through capacitor(to charge it) than to EN pin when the button is released?Current go through both, as dictated by Ohms law. Input current of EN pin is very low, so most of resistor current will charge capacitor.

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 05:41:45 pm
content: 1. So EN pin resistance is higher than capacitors resistance and thats why most of the current goes through capacitor to charge it?2. Energy storage capacitors - but how do they charge if no resistors? You said we need it to provide current.P.S.Now I'm starting to understand alot of things. I really appreciate Your time for helping me.You're a great teacher.

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 05:48:19 pm
content: QuoteYesQuoteNot exactly. We need a path from power source to capacitor in order to charge it. This path can include resistor (to ensure timed charging) or do not include it (directly connect to power) to provide fastest filling of power reservoir (capacitor).

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 05:53:30 pm
content: Oooh, now I get it! So resistor is like a valve in case of EN circuit. Well now its much easier for me to understand what does every component do .. and I assume that schematics is now correct and It will work if I assemble it?Any other things to care about / advices?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 06:16:36 pm
content: Quote2 already mentioned notes still not resolved:R2 value should be 1-1.5K With current value your LED will illuminate VERY brightlyConnect bulk capacitor (about 100uF) to power pin (3V3) of ESP32

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 06:33:19 pm
content: 1. Someone said that 1mA is enough for SMD LED on KiCad forum. I don't know, really ...2. Bulk capacitor is used for what? Why 100uF? Why not less capacitance? And how to connect it? Parallel I assume?3. How do I know where do I need to connect e.g. bulk capacitor or something? How do you know and why would u decide to do that?Edit: latest schematicshttps://ibb.co/2vKQV4g

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 06:38:30 pm
content: QuoteYes, it' s really enoughQuoteSEP32 can consume peaks of current during operation (when radio actively transmitted, for example). So quite large energy reservoir required hex module to avoid voltage drops on PCB traces and ease live of LDO. Capacitance can vary in wide range. 100uF is a reasonable middle value.QuoteYes

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 06:39:35 pm
content: Please look up the latest schematics in post aboveAnd, please, once again, added question 3Sorry :/

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 06:43:53 pm
content: Low pin of C6 should be connect to ground.Decoupling capacitor required across power pins of DS18B20QuoteIn general any modules required some sort of bulk capacitors (even hot plugged, such as SD card for example)

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 06:47:00 pm
content: Ha-ha. C'mon ...I don't get it.Decoupling capacitor across DS18B20.How did You know that? I'd never add that myself ... That's the problem. I don't know where should I add something ...Is there a way to "realize" where do I need such things? How do You know that?Is 0.1u enough as decoupling?You would do that entire project like in a 10 minutes and I need entire day ...Schematics:https://ibb.co/SQYXvcZP.S.If i want add a small LED for temp senzor data comm (to visualize it), is that possible?What would i need in that case? One wire ----> resistor ----> LED ---> GPIO?

author: xvr
author_rank: Frequent Contributor
timestamp: November 27, 2024, 07:42:45 pm
content: QuoteANY IC require decoupling capacitor.QuoteYes.Now schematic looks OkQuoteYesQuoteGND ---> resistor ---> LED --> GPIO

author: NightRider92
author_rank: Contributor
timestamp: November 27, 2024, 07:55:27 pm
content: Thank You so much for the help!Now I'm trying to replicate and simulate things in National Instruments Multisim according to thethings you teached me.I'm so grateful for Your help and for Your time!

author: tooki
author_rank: Super Contributor
timestamp: November 27, 2024, 08:09:06 pm
content: Quote from: NightRider92 on November 27, 2024, 04:39:37 pmAnd that nonsense answer is why I think it's insane that people use these computer hallucinations to try and verify their work. The circuit you showed it is wrong, no matter what ChatGPT/Copilot/whatever tells you.

author: tooki
author_rank: Super Contributor
timestamp: November 27, 2024, 08:13:37 pm
content: Quote from: NightRider92 on November 27, 2024, 06:33:19 pmIt depends on the LED, but for a simple indicator, for use indoors, that is enough for many modern LEDs. I use some modern emerald green LEDs that are very bright at 0.5mA!!

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 01:11:25 pm
content: I added G5LE-1 relay, I assume that is correctly connected over the 2N3904 NPN transistor?So I use R4 1k to control the base of 2N3904 transistor, emitter is connected to GND, so from GND (emitter) to G5LE-1 coil terminal iscurrent flowing when the transistor is activated. Pin 1 of relay is connected to 3V3 (it should be rated for 3V) and Relay PIN3 si COM (L wire for 230VAC).I won't use Pin 4 (NC) but NO (pin 5) on relay that will go to the LOAD part.Is that ok?https://ibb.co/hHwh0XZ

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 01:22:29 pm
content: QuoteIt's OkQuoteThat is not. 3V3 should be connected to other pin of coil - 5. Also reverse connected diode (any impulse diode for relay rated current will suite) needed across relay coli (anode to pin 2, cathode to pin 5)QuoteThere is no 3V rated G5LE relay, minimum is 5V

author: crgarcia
author_rank: Regular Contributor
timestamp: November 28, 2024, 01:24:15 pm
content: why are you pulling up D+?You probably want to add some protections to the USBNotice that after the BAT60, you will not have 5V anymore, so your components need to be able to operate with ~4VYou will also need to configure CCs in some way. The simplest is by adding some specific resistors, in order you get 5VDon't forget that D+ and D- are differential pairs. You will probably not have an issue with this since your PCB will probably be small... but if you want to learn maybe you want to consider itTake a look at this project. It has ESP32, voltage regulator, USB-C and Relays:https://github.com/crgarcia12/electronics-homeassistant-lightscontroll

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 01:33:06 pm
content: Quote from: xvr on November 28, 2024, 01:22:29 pm..1. Yes, you're right, sorry, I've seen somewhere 3V for relay coil but it's 5-24 VDC.2. I was unable to find pinout because I didn't know where to connect what so I asked ChatGPT about relay pinout. Why do I need to connect 3V3 to PIN5 of relay?3. Diode is to protect transistor?4. How to activate the relay then from the ESP32 pin? It's 3V3 and not 5V what I need. Should I take input 5V line?

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 01:43:06 pm
content: QuoteTo energize coil of relay you need to apply voltage across its pins. On relay symbol clearly shown coil connection - 2 & 5 pinQuoteChatGPT is not a right place to ask for technical questions. Nobody known how many of its answer is a real information and how many of its own dreamsQuoteYes. When transistor turned off on relay coli will be generated huge voltage spike, diode helps to avoid this.QuoteYes, just connect pin 5 or relay to 5V (not to 3V3)

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 01:49:10 pm
content: https://ibb.co/JCH5S76Is this what you meant?Why all of it seems so hard ...

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 01:52:11 pm
content: QuoteAlmost. Collector of transistor should be connected to pin 2 of relay, not to pin 1. pin1 should be connected to load

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 01:56:57 pm
content: Where did you find the pinout?Obviously I don't understand the datasheet ... or something ...

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 01:58:01 pm
content: QuoteOn relay symbol in your schematicHere is datasheet -https://components.omron.com/eu-en/sites/components.omron.com.eu/files/datasheet_pdf/K100-E1.pdfThe same pinout

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 02:00:58 pm
content: https://ibb.co/0ZjJn6LOk now?Please, do You have some materials Icould read that are of good quality to learn to design circuits?Something to recommend? I really see that I don't have alot of knowledge regarding circuits ... and that demotivates me ...

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 02:04:19 pm
content: QuoteNo. Collector of transistor now connected directly to 5V power rail, instead or relay pin 2QuoteHmm, I don't know. May be The Art of Electronics (by Horowitz and Hill) ?

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 02:15:18 pm
content: Quote from: xvr on November 28, 2024, 02:04:19 pmThank You.Now I got lost.Relay. My understanding:https://ibb.co/syzJhPwSo, 1 and 3 are for external load or what? (e.g. L wire -----> PIN 1, one side of my LOAD e.g. (bulb) to PIN 3 and other side to NEUTRAL.)?Pin 4 - Not usedPin 5 and Pin 2 are coil plus and minus?Diode should be connected how?I'm really confused right now.

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 02:26:26 pm
content: QuoteYesQuoteYesQuoteDiode connected in right way (directly across coil)Transistor connected to wrong side of diode.

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 02:32:37 pm
content: Something like this

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 02:54:51 pm
content: Then I did it right!Finally I did something that is correct!I also added two 20p capacitors on USB Data lines.I can tell that I'm starting to "follow" things up altough it is kinda overwhelming becauseI try to understand everything at once.

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 02:57:26 pm
content: Congratulations, now it's right!

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 03:00:05 pm
content: Thank You.I'll try to practice with other PCB's ..Is there any other way tocheck correctness of connections?Like I said, I have a Multisim (National Instruments) simulator software butI'm not sure how reliable that is.Btw found on Your LinkedIn: Fundamentals of Embedded systems.I see it is in Russian, but we have same language root (croatian and russian = slavic languages)so I'd probably get it.

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 03:03:49 pm
content: KiCAD has ERC (in schematic editor) and Spice simulator. You can have some check right there. You can't simulate whole schematic in Spice - there is no ESP32 model there

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 03:05:13 pm
content: Well, like I said, I'm still learning. KiCad is something new to me .. I've never designed PCBs so ...

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 03:09:37 pm
content: Just a question regarding relay spikesWon't this happen? I mean .. isn't there still a possibility that spike goes to collector?

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 03:14:44 pm
content: There is no spike with diode. It provide path to selfinduction current on relay turn off.

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 03:17:58 pm
content: Quote from: xvr on November 28, 2024, 03:14:44 pmI know it provides one-way path.So, coil can produce (selfinduction) current only on + side so the diode blocks the path to collector?That's You want to say?

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 03:55:27 pm
content: QuoteNot exactly. Any inductor tried to keep constant current through it (like capacitor keep constant voltage on it). So when transistor is turned off inductor current still going, but there is no more path to carry it (in configuration without diode). So voltage on inductor leads starts to increase, until it find a way to close current path (generally by burning out something on the way - transistor for example). When you connect diode it will give path to current flow to continue. So no voltage raise, inductor energy will dissipated quietly by itself (in self resistive part of inductor)

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 04:21:32 pm
content: Thank You for explanation.I can tell I learned alot of stuff in such short time ...So .. I've read a bit about the coils ... so they store the energy in magnetic field (they create magnetic field when current flowing) and when current stops,collapsing magnetic field will produce selfinduction current ... right?

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 04:50:37 pm
content: QuoteYes (strictly speaking it produce selfinduction voltage, not current - current remains the same)

author: PGPG
author_rank: Frequent Contributor
timestamp: November 28, 2024, 05:05:38 pm
content: Quote from: NightRider92 on November 28, 2024, 04:21:32 pmRight, but reasoning that way you have no idea how big that current will be. It is better to think that inductor current can't change at once like capacitor voltage can't change at once.So if relay is on than some current is going through its coil (coil resistance limits that current). When you try to switch it off it just need the current to be as it was (at the moment of switching) so only the current that was during it being on will be searching a way to be closed through something.May be the best explanation for you will be U=L*dI/dt.So if you connect some U to L (when switching transistor on) than current rises dI/dt according this equation. It would rise infinity if there were no some resistance of the coil that limits it.When you want to switch the current suddenly off than you have dI/dt = - infinity so U tries to go to - infinity also. But when there is a diode the current finds its way polarizing diode to its forward voltage (if standard silicon diode it has voltage drop of about 0.7V) and that voltage goes to equation telling you how fast the coil current will drop down until reaching 0. So now there is nothing polarizing diode so we get U=0 and I=0 state.Now to mix you everything - because of small voltage drop at diode the current in coil drops down slowly making contacts are separating from each other more slowly than they could and in some coditions that can lead to generating spark at contacts shorting relay lifetime. Because of this sometimes not diode but bidirectional transil is used at coil making current dropping down much faster.You can't learn electronic in few days.I start learning it from building my first radio receiver when I was 10. I have build dozens of electronic circuits before I start to study electronik at university. My main observation from studying electronics was: "Oh shit, everything I intuitively know can be calculated!"

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 08:03:14 pm
content: Thank You guys for all the info. I learned alot. Now, regarding other things as I'm a guy that learns from examples / practice the most, what if I e.g. want to connect display to ESP32?The questions that crossed my mind are:1. How would you know if ESP32 supports that?2. If it supports (if not, take any other device that supports that) how do you "learn" or know (without looking other examples) how to connect that display?3. Do you guys copy other schematics (or look examples) when doing some new project or with all of your experience you do it from top of your head?Thank You!

author: xvr
author_rank: Frequent Contributor
timestamp: November 28, 2024, 09:04:27 pm
content: QuoteTake a look at display characteristics, interfaces and hardware of ESP32.QuoteIn general it quite straightforward. If some cases additional circuitry may be required.QuoteFrom the top of my head.Some simple step to select display:Decide what display you want. Graphics/alphanumeric? Sizes in pixels/display cols&rows? Touch and type of it.Peek some display with desired characteristics somewhere (Aliexpress, Digikey, Amazon, etc)Check display interfaces and verify that it can be handled by ESP32 (by datasheet and user guides of both of them)If can't - goto 2 (or 1)Couple words about interfaces:Parallel LCD interface supported by ESP32-S3, but it takes a lot of pins. So if you decide to use it you will run out of pins very soon. Double check that rest of pins will be enoughSerial interfaces also supported by ESP32. SPI preferable (as quite fast), I2C also will work, but it will be slowMIPI not supported by ESP32Touch interface can be I2C, SPI or raw resistive. Last one will require to use ADC from ESP32ADC has some limitations for range of measured voltage and accuracy. So double check it if you plan to use raw resistive touchDuring boot process ESP32 will drive some pins. Verify that this activity will not blown out external peripheralSome pins should gave some levels during boot - double check all of them

author: PGPG
author_rank: Frequent Contributor
timestamp: November 28, 2024, 09:09:05 pm
content: Quote from: NightRider92 on November 28, 2024, 08:03:14 pmI have never considered to drive display hardware directly. So if you think about that - I don't know.But if you have in mind display that has its own controller taking care of display hardware and has a communication connection (paralel or serial) to tell it what and where you want to display than if ESP has enough output pins to drive all display input pins and enough input pins to receive signals from display - you should have no problem to drive that display.At PCB I have already shown:https://forum.kicad.info/t/approaching-pcb-track-routing-for-a-newbie/36302/8- in the center there is 8 bit microcontroller,- to the left there is connector to LCD graphic display (3.5", color 320x240 pxl, paralel connection),- at bottom left there is connector to touch panel (in front of this display),- just near it there is Real Time Clock,- at bottom right there is RFID reader,- at top right there is a chip to communicate via Ethernet.If 8 bit microcontroller copes with it all then ESP32 (I assume 32 in name means it is 32 bit) should not have any problems with display (having its own controller, but why to use others).

author: NightRider92
author_rank: Contributor
timestamp: November 28, 2024, 10:00:24 pm
content: I'm impressed with Your knowledge guys.I wish I could do something like that from top of my head without peeking on other similar circuit designs ...I'm asking because it seems like a "cheating" to me, same case like with this circuit (we talked about until now) which was made mostly - by You XVR, not me, because you corrected me for every step I took.Seems that only practice will help me to become better ...

author: PGPG
author_rank: Frequent Contributor
timestamp: November 29, 2024, 09:46:11 am
content: Quote from: NightRider92 on November 28, 2024, 10:00:24 pmExactly!The number of burned/exploded items decreases with practiceAs we are not able to assemble ourselves small elements (like 2x2mm MEMS IC with 12 pads hidden under it) we not make prototypes of PCBs I design. We start from ordering a production serie of 100 pcs.This is different world than software were you can fix bug after bug. In our world if you not get the 100% bug free solution in the first shot you pay dearly for it.

author: tooki
author_rank: Super Contributor
timestamp: November 30, 2024, 12:58:58 pm
content: Quote from: NightRider92 on November 28, 2024, 02:54:51 pmWhy would you do that!?!Capacitance on USB data lines is something to be minimized, not added to!For USB 1.1 speeds, 20pF is themaximum allowed, for USB 2.0 speeds, the maximum is just 4pF.What you want to do is protect the port with TVS diodes, and those for USB are specially selected to have low capacitance.Seehttps://www.ti.com/lit/an/slvaf82b/slvaf82b.pdf