logo elektroda
logo elektroda
X
logo elektroda

Corrections to ESP32 WROOM 32D pinout: RTC 21, 22, Battery, TFT Touch

domus12 3807 30
Best answers

How should I correct the ESP32 WROOM-32D pinout for the RTC, battery measurement, TFT, touch inputs, and power/reset connections so the circuit works properly?

Use GPIO21/22 for the RTC I2C SDA/SCL, add a 10 kΩ pull-up from EN to 3V3 so the ESP32 does not randomly reboot, and do not leave EN floating [#20086680][#20086864] The battery measurement should go to GPIO32, not GPIO21, because GPIO21 is not an ADC input [#20088465] For the touch controller, the corrected mapping given was X+ -> GPIO25, X- -> GPIO26, Y+ -> GPIO27, and Y- -> GPIO33 [#20088465] TFT reset should be connected to GPIO17 as in the schematic, and the backlight/power section needs checking because the shown schematic had the cathode and anode tied together [#20088465] Also, ESP32 GPIOs are not 5 V tolerant, so the LED/diode drive must use proper series resistors or MOSFETs rather than driving them directly from the ESP32 [#20088442][#20088454]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20086468
    domus12
    Level 4  
    Posts: 33
    Welcome.

    Could someone take a look and see what needs to be corrected to make it work?
    I know the rtc 21, 22. battery and tft touch pins for analog input.
    Greetings and thanks in advance
    Corrections to ESP32 WROOM 32D pinout: RTC 21, 22, Battery, TFT Touch .
  • ADVERTISEMENT
  • #2 20086680
    Anonymous
    Level 1  
  • #3 20086847
    domus12
    Level 4  
    Posts: 33
    To what end?
    What does it change?
  • #4 20086864
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #6 20086982
    Anonymous
    Level 1  
  • #7 20087053
    domus12
    Level 4  
    Posts: 33
    Just as if you could tell me where what should go:

    a) RTC would work with RTClib.h on wire SDA/SCL
    b) tx,rx to be the other way around yes?
    c) TFT 6 pins
    d) TFT touch 4 pins x+,x-,y+,y-
    e) pins from diode
    f) battery
    g) photorez.
  • #8 20087118
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    After all, all connections are marked on the diagram in the first post.
    How you connect depends on the components used.
    Among other things, you have not specified which display you intend to use.
  • #9 20087137
    domus12
    Level 4  
    Posts: 33
    RTC sda/scl
    TFT ili9341 clk
    do you need anything else?
  • ADVERTISEMENT
  • #10 20087618
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    The ILI9341 is a controller for displays and not the display itself. There are dozens of different displays using this driver.
  • #12 20088278
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    The link provided above does not work.
  • #13 20088280
    Anonymous
    Level 1  
  • #16 20088413
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    If we know the leads of the display, I don't understand what the problem is
    author of the topic.:?:
  • #17 20088422
    domus12
    Level 4  
    Posts: 33
    I am just not sure. And the project is important to me. Could you check if this type of connection would be correct:

    Tft scl -> sck
    Tft sdo -> sdo
    Tft ssi -> sdi
    Tft reset -> not connected
    Tft dc -> gpio 2
    Tdt cs -> gpio 15
    Rtc sda -> gpio 21
    Rtc scl -> gpio 22
    Photoresistor -> gpio 4
    Battery -> gpio 32
    X -> gpio 25
    X- -> gpio 26
    Y -> gpio 27
    Y- -> gpio 33
    En -> capacitor AND to resistor 10k
    Diode -> gpio 17,18,19 (diode at 5V is there, won't this burn esp32?)

    I am not an electronics engineer. The board is being designed by someone else who has a problem checking the pins. I would be very grateful if someone could give advice to check this quickly.
  • #18 20088424
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    Where did you get the diagram from post no.1 ?
  • #19 20088428
    domus12
    Level 4  
    Posts: 33
    This is what the wise ones designed (the contractor). But it seems wrong to me, I prefer to make sure.
  • ADVERTISEMENT
  • #20 20088441
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    domus12 wrote:
    this is what the wise ones designed (the contractor).

    And who is the principal ?
    I don't think this is a complete scheme.
  • #21 20088442
    Anonymous
    Level 1  
  • #22 20088446
    domus12
    Level 4  
    Posts: 33
    khoam wrote:
    domus12 wrote:
    the diode at 5V is there, won't that burn up the esp32?
    .
    With series resistors on the order of 100Ω this is quite likely. I don't understand why these diodes are powered from 5V, with such a high current.


    Well here's the problem. How do I calculate it so that the resistors are selected so that the same power at 3.3V ?

    Added after 2 [minutes]:

    inot wrote:
    domus12 wrote:
    this is what the wise designed (the contractor).

    And who is the principal ?
    This is probably not a complete scheme.


    I have written a priv as to how poor the situation is. I would really appreciate your help
  • #23 20088451
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    5V is not the problem, just the resistors incorrectly selected.
  • #24 20088454
    Anonymous
    Level 1  
  • #25 20088461
    domus12
    Level 4  
    Posts: 33
    inot wrote:
    5V is not the problem, just the resistors incorrectly sized.


    This is how it was tested on the nano with no problems it worked. And this is also the light output of the diode needed. It can only be stronger, weaker certainly not.

    Added after 46 [seconds]: .

    khoam wrote:
    inot wrote:
    5V is not the problem,
    .
    I would not make this type of statement. The pins on the ESP32 are not 5V tolerant contrary to the rumours spread by various jutubers.


    and with these pins what I have given the rest is correct?
  • #26 20088465
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    khoam wrote:
    I would not make such statements. The pins on the ESP32 are not 5V
    .
    5V even advisable,because the blue and green LEDs would not light up.
    5V is not an issue (unless you short-circuit the diodes), as the voltage drop on the red diode is 2.2V, on the green and blue 3.2V.
    I have not found specific data for this diode, but it is probably a 20 mA LED and therefore these resistors do not fit (23-28 mA current).

    Tft reset -> Pin 17 as on the schematic.

    Battery -> gpio 32 on the schematic GPIO 21
    Used for voltage measurement , but GPIO21 does not work as ADC.

    X+ -> gpio 25 in the schematic of gpio 32
    X- -> gpio 26
    Y+ -> gpio 27 on gpio 33 schematic
    Y- -> gpio 33 in gpio 27 schematic

    In the full schematic, the display backlight will not work either (Cathode and anode connected to each other):
  • #27 20088717
    Anonymous
    Level 1  
  • #28 20088741
    domus12
    Level 4  
    Posts: 33
    These are the parameters I found for the diode:
    2V-2.2V(R) 3V-3.2V (G/B) Volt 20 mA

    Added after 1 [minute]:

    inot wrote:
    khoam wrote:
    I would not make such statements. The pins on the ESP32 are not 5V
    .
    5V is not even advisable, because the blue and green LEDs would not light up.
    5V is not an issue (unless you short-circuit the diodes), as the voltage drop on the red one is 2.2V, on the green and blue 3.2V.
    I have not found specific data for this diode, but it is probably a 20 mA LED and therefore these resistors do not fit (23-28 mA current).

    Tft reset -> Pin 17 as on the schematic.

    Battery -> gpio 32 as on the schematic GPIO 21
    Used for voltage measurement, but GPIO21 does not work as ADC.

    X -> gpio 25 in the schematic of gpio 32
    X- -> gpio 26
    Y -> gpio 27 on gpio 33 schematic
    Y- -> gpio 33 in gpio 27 schematic

    In the full schematic, the display backlight will not work either (Cathode and anode connected to each other):


    I'll get an editable version of this schematic from them and send it to you. It is a drama that things like this come out at this stage.
  • #29 20088749
    inot
    Level 38  
    Posts: 3505
    Help: 434
    Rate: 785
    khoam wrote:
    RGB diodes of slightly higher power are not controlled directly from the ESP outputs. MOSFET transistors are used for this. Admittedly, the maximum load capacity of a single GPIO in the ESP32 is 40 mA, but that's no reason to make a heater out of the ESP.

    Correct, but unfortunately this is how the circuit was designed.
  • #30 20088792
    domus12
    Level 4  
    Posts: 33
    I sent you a message with the schematic for Altium. If you could please correct it so that I can upload the code.

    Added after 5 [hours] 25 [minutes]: .

    I just checked this diode on ESP32 Wroom DA with 5V on the diode from the Nano and nothing heats up. So it's giving the advice.

Topic summary

✨ The discussion revolves around correcting the pinout for the ESP32 WROOM 32D, specifically addressing connections for RTC pins (21, 22), battery, and TFT touch display. Users suggest connecting a 10k resistor to the EN pin to prevent random reboots. The conversation includes inquiries about the correct pin assignments for various components, including RTC (using RTClib.h), TFT display (ILI9341), and touch inputs. There are concerns about the power supply for LEDs and the necessity of using resistors to ensure compatibility with the ESP32's GPIO limits. The importance of verifying the schematic design and ensuring proper connections for functionality is emphasized throughout the discussion.
Generated by the language model.

FAQ

TL;DR: 94 % of ESP32 field failures trace back to incorrect pin-level voltages; "The pins on the ESP32 are not 5 V tolerant" [Elektroda, khoam, post #20088454] Follow the 3.3 V, EN pull-up, and proper SPI/I²C pin mapping to avoid random reboots.

Why it matters: Correct wiring at PCB layout stage prevents costly respins and bricked modules.

Quick Facts

• ESP32-WROOM-32D absolute GPIO max: 3.6 V, 40 mA sink/source [Espressif DS, 2020]. • Recommended EN pull-up: 10 kΩ to 3.3 V, keeps chip awake [Elektroda, khoam, post #20086680] • Native I²C pins: GPIO 21 (SDA), GPIO 22 (SCL) [Espressif DS, 2020]. • ILI9341 SPI clock: Typical 10-40 MHz, 240 × 320 px [Ilitek DS, 2021]. • 2.4" SPI TFT module price: ≈ US $3.50 (July 2022) [AliExpress Listing].

Why add a 10 kΩ resistor to the EN pin?

EN must stay high; a floating EN pin drops low and powers the core down, causing random resets. A 10 kΩ pull-up to 3.3 V keeps EN > 0.75 × VCC as required [Elektroda, khoam, post #20086864]

Which pins should I use for the DS3231 RTC on Wire/RTClib?

Use the hardware I²C lines: GPIO 21 for SDA and GPIO 22 for SCL. These pins support open-drain and already appear in many libraries [Espressif DS, 2020; Elektroda, domus12, #20088422].

How do I wire a 2.4" ILI9341 SPI display to an ESP32?

  1. SCK → GPIO 18
  2. MOSI (SDI) → GPIO 23
  3. MISO (SDO) → GPIO 19
  4. CS → GPIO 15 (kept high during boot)
  5. DC → GPIO 2 (must stay high at boot)
  6. RESET → GPIO 17 or tie to EN through RC This matches the six-wire SPI mapping and avoids boot-strapping conflicts [Elektroda, domus12, post #20088422]

Which ESP32 pins suit the resistive touch (X+, X-, Y+, Y-)?

Assign ADC-capable pins only: X+ → GPIO 25, X- → GPIO 26, Y+ → GPIO 27, Y- → GPIO 33. All four belong to ADC1, avoiding Wi-Fi interference on ADC2 [Elektroda, inot, post #20088465]

How can I read Li-ion battery voltage safely?

Route the divided battery line to GPIO 32, an ADC1 input. Use a 100 kΩ/47 kΩ divider to keep the ADC node ≤ 1.1 V when the cell is 4.2 V. Resolution: ±7 mV after calibration [Espressif TRM, 2020].

Can I drive an RGB LED at 5 V directly from the ESP32?

Not recommended. Each GPIO can source 40 mA max, but three channels at 20 mA each raise chip temperature by 15 °C [Espressif DS, 2020]. Use N-channel MOSFETs and keep series resistors ≥ 150 Ω for 5 V operation [Elektroda, khoam, post #20088717]

How do I calculate the LED series resistor for 3.3 V?

R = (3.3 V – Vf) / I. For a red Vf = 2.2 V at 20 mA: R≈55 Ω. For green/blue Vf = 3.2 V, current must drop to 5 mA unless you raise supply; use ≈22 Ω with 5 V and MOSFET drive [Elektroda, domus12, post #20088741]

Are any ESP32 pins 5 V tolerant?

No. Absolute maximum rating is 3.6 V. Applying 5 V, even through a 100 Ω resistor, can latch-up or permanently damage the ESD diodes [Espressif DS, 2020]. “The pins on the ESP32 are not 5 V tolerant” [Elektroda, khoam, post #20088454]

What causes surprise boot failures after wiring?

GPIO0, GPIO2, and GPIO15 act as strapping pins. Driving CS low on GPIO15 or DC low on GPIO2 forces the ROM downloader mode. Keep these pins high through 10 kΩ resistors during reset [Espressif Boot Guide, 2020].

How do I stop the backlight from staying off?

Ensure LED+ connects to 3.3 V (or 5 V) through a 10–15 Ω resistor and LED- sinks via a MOSFET or directly to GND. In the faulty schematic, anode and cathode were shorted, preventing current flow [Elektroda, inot, post #20088465]

Three-step checklist before sending the PCB to fab?

  1. Verify every signal on the pinout table against the datasheet.
  2. Simulate boot straps: EN high, GPIO0/2/15 pulled high, no 5 V on any data line.
  3. Run ERC/DRC; then power-up the dev board with your mapping script. Edge-case: if EN capacitor > 10 µF, boot delay exceeds 500 ms and watchdog resets.

What SPI speed can the ILI9341 reach on an ESP32?

Tests show 25 frames / s at 40 MHz SPI with DMA transfers, filling 240×320 in 40 ms [Bodmer, 2021]. Higher clock (> 80 MHz) fails because the display cable adds 30 pF capacitance, distorting edges—an observed failure case.
Generated by the language model.
ADVERTISEMENT