ESP32R4 controller is built and powerful with the ESP32 microcontroller, 2.4 GHz Wi-Fi, and Bluetooth LE 4.2 (BR/EDR + LE). Two CPU core(s) with adjustable clock frequency, up to 240 MHz, for controlling 4 relays, 4 buttons, the sound buzzer, and additional embedded modules for additional interface and color TFT touchscreen.

ESP32R4 with ESP32 microcontroller can perform as a complete standalone system or as a slave device to the cloud or server, reducing communication stack overhead on the main application. ESP32R4 can interface with other systems to provide Wi-Fi and Bluetooth functionality through its UART, I2C, SPI, and SDIO interfaces.

Variations

Board description

Feature list

  • ESP32-DOWD-V3 microcontroller module with 4MB or 16 MB FLASH and 8 MB PSRAM
  • Embedded or External WiFi/Bluetooth antenna
  • 4 active relays for commutate load 10A, 240AVC/30VDC with LED indicate
  • 4 functional buttons
  • AC 90~204V or DC 7~36V power IN
  • Programming buttons: PROG and RESET and UART programming header
  • Sound Buzzer
  • Status LED
  • Socket for RF433/315 receiver module
  • Pin headers and RJ-12 sockets for connection additional equipment with I2C, SPI, Serial UART, RS232 or RS485 interface.
  • Enclosure or board variation.

MCU ESP32 – 32-bit 2.4 GHz Wi-Fi & Bluetooth/BLE

  • Two CPU core(s) with adjustable clock frequencies, ranging from up to 240 MHz
  • +19.5 dBm output power ensures a good physical range
  • Classic Bluetooth for legacy connections, also supporting L2CAP, SDP, GAP, SMP, AVDTP, AVCTP, A2DP (SNK) and AVRCP (CT)
  • Support for Bluetooth Low Energy (Bluetooth LE) profiles including L2CAP, GAP, GATT, SMP, and GATT-based profiles like BluFi, SPP-like, etc
  • Bluetooth Low Energy (Bluetooth LE) connects to smart devices, broadcasting low-energy beacons for easy detection
  • Peripherals include capacitive touch sensors, high-speed SPI, UART, I2S and I2C

Hardware block diagram

Dimension diagram

MCU GPIO Allocation

GPIOFunction
ENMCU Enable. Button RESET. Pin EN. Press this button to reset the system.
IO0MCU Boot. Button PROG. Pull-up 10K. Holding down the Boot key and momentarily pressing the Reset key initiates the firmware upload mode. Then you can upload firmware through the serial port or USB.
IO1UART1 TXD. Pin Serial TX.
IO2LED status. Pin IO2.
IO3UART1 RXD. Pin Serial RX.
IO4Sound Buzzer. Pin IO4.
IO5Pin IO5. SPI(RJ12) -CS(board jumper). * read section: board jumpers
IO6FLASH memory. SD CLK. No available.
IO7FLASH memory. SD0. No available.
IO8FLASH memory. SD1. No available.
IO9FLASH memory. SD2. No available.
IO10FLASH memory. SD3. No available.
IO11FLASH memory. CMD. No available.
IO12I2C(RJ12) – Interrupt. Pin IO12.
IO13RS module header. UART2-CS. Pin IO13.
IO14RS module header. UART2-RXD(board jumper). Pin IO14. * read section: board jumpers
IO15RS module header. UART2-TXD(board jumper). Pin IO15.* read section: board jumpers
IO16RS module header. UART2-RXD/PSRAM-CS(board jumper). Pin IO16.* read section: board jumpers
IO17RS module header. UART2-RXD/PSRAM-CLK(board jumper). Pin IO17.* read section: board jumpers
IO18SPI(RJ12) -CLK(board jumper). Pin IO18.* read section: board jumpers
IO19SPI(RJ12) -MISO(board jumper). Pin IO19.* read section: board jumpers
IO21I2C(RJ12) – SDA. Header I2C: Pin SDA.
IO22I2C(RJ12) – SCL. Header I2C: Pin SCL.
IO23SPI(RJ12) -MOSI(board jumper). Pin IO23.* read section: board jumpers
IO25Relay 1. Pin IO25.
IO26Relay 2. Pin IO26.
IO27RF315/433MHz data pin.
IO32Relay 4. Pin IO32.
IO33Relay 3. Pin IO33.
IO34Button 1(board jumper). Pull-down 10K. Pin IO34.* read section: board jumpers
IO35Button 2(board jumper). Pull-down 10K. Pin IO35.* read section: board jumpers
IO36Button 3(board jumper). Pull-down 10K. Pin IO36.* read section: board jumpers
IO39Button 4(board jumper). Pull-down 10K. Pin IO39.* read section: board jumpers

This section provides instructions on how to do hardware and software setup and flash firmware onto the board to develop your own application.

Pin Headers

Board 0.1′ pinheader

  • GPIO pinheader: Direct connection to GPIO of MCU ESP32. With VDD pins 5V and 3.3V.
  • Serial UART programming pinheader, with serial UART1 RXD and TXD connection to MCU. For programming MCU ESP32. The header have a connecting jumper of power VDD3.3V to MCU ESP32. Can direct powering 3.3V of ESP32 from serial programming module or from board power distribution. For programming read the instruction: Software Setup.
  • I2C pinheader, for direct connection of external I2C (SDA, SCL) modules like LCD screen, GPIO expanders, sensors, and modules. VDD 5V for powering I2C modules.
  • RF315/433MHz pinheader. For connection the radio RF315/433MHz receiver or transmitter modules. Direct connection to GPIO27 and 5V for powering module.

RJ-12 socket

  • I2C socket: for connecting external I2C interface equipment. Pinout (right to left):
    1. NC – no connection
    2. GND
    3. I2C SDA – GPIO21
    4. I2C SCL – GPIO22
    5. I2C interrupt – GPIO5
    6. NC – no connection
  • RS/SPI socket: for connecting external equipment with RS(like RS-232, RS-485) or SPI interface. For switching to RS or SPI mode use the board jumpers (*read section board jumpers). Pinout (right to left):
    • VDD 3.3V
    • GND
    • RS mode: RX (B-). SPI mode: MOSI (GPIO23)
    • RS mode: TX (A+). SPI mode: MISO (GPIO19)
    • RS mode: CS Chip select/interrupt. SPI mode: CLK (GPIO18)
    • RS mode: No connection. SPI mode: CS Chip select (GPIO5)

Board jumpers

The controller ESP32R4 have boards jumpers for customization of hardware and functionality for your project.

  • LED status jumper: (on default connected) disconnecting the LED status from GPIO2. If you need GPIO2 for other functions and don’t need LED, cut off the connection line of board jumper and use GPIO pin 2 for connecting any DIY modules or sensors. If you need to return the connection to LED status, solder the soldering pads of the jumper.
  • Buzzer jumper: (on default connected) disconnecting the sound buzzer from GPIO4. If you need GPIO4 for other functions and don’t need buzzer, cut off the connection line of board jumper and use GPIO pin 4 for connecting any DIY modules or sensors. If you need to return the connection to buzzer, solder the soldering pads of the jumper.
  • Buttons jumpers: (on default connected) If you don’t need the functional buttons on board B1, B2, B3, B4 and need additional GPIO34, GPIO35, GPIO36, and GPIO39 for other functions, cut off the connection lines of board jumper and use GPIO pin 34, 35, 36, 39 for connecting any DIY modules or sensors. If you need to return the connection to the buttons, solder the soldering pads of the jumper. Also can use pins 34, 35, 36, and 39 for external buttons with pull-down resistors on board.
  • RS/SPI switch jumpers: For use embedded modules can use serial UART or SPI interface. On board have jumpers for select RS (serial) or SPI mode.
    • VDD 3.3V jumper: SPI mode (on default NOT connected). For powering external modules via RJ-12 pin 1
    • G jumper: (on default connected to RS module). RS mode: connection of RJ-12 pin 2 and Ground of embedded RS module. SPI mode: connection of RJ-12 pin 2 and GND of ESP32R4 controller
    • 23 jumper: (on default connected to RS module). RS mode: connection of RJ-12 pin 3 and RX (B-) of embedded RS module. SPI mode: connection of RJ-12 pin 3 and MOSI (GPIO23) of ESP32R4 controller
    • 19 jumper: (on default connected to RS module). RS mode: connection of RJ-12 pin 4 and TX (A+) of embedded RS module. SPI mode: connection of RJ-12 pin 4 and MISO (GPIO19) of ESP32R4 controller
    • 18 jumper: (on default connected to RS module). RS mode: connection of RJ-12 pin 5 and CS of embedded RS module. SPI mode: connection of RJ-12 pin 5 and CLK (GPIO18) of ESP32R4 controller
    • 18 jumper: (on default NOT connected). RS mode: No connection. SPI mode: connection of RJ-12 pin 6 and CS (GPIO5) of ESP32R4 controller
  • UART2 I/O select jumpers: (On default RS-RXD NOT connected to GPIO14 and NOT connected to GPIO16, RS-TXD NOT connected to GPIO15 and NOT connected to GPIO17). For the controller with 4MB flash memory, the RXD needs to connect to GPIO16, and TXD to GPIO17. For the controller with 16MB flash memory and PSRAM, the RXD needs to connect to GPIO14, and TXD to GPIO15. (PSRAM uses GPIO16 and GPIO17).

Power Distribution

  • Power IN AC: AC 90~204V. Power out DC: 5V 0.7A, 3.3V 0.55A
  • Power IN DC: DC 7~36V. Power out DC: 5V 1.7A, 3.3V 0.8A
  • MCU power consumption: MCU ESP32 required 0.45 for stable work (including WiF)

Software setup. UART interface

Update over the serial connection using a serial-to-USB adapter: CH340, FTDI FTR232,  CP2102/2104, PL2303…

Some adapters can be switched between 3.3V and 5V for the data pins, but still provide 5V on the power pin which will irreparably destroy your device. You MUST make sure the data (RX and TX) logil level 3.3V and VCC pins are set for 3.3V.

Serial adapterESP32R4
3.3VMCU3.3V or use power from the board (jumper connected)
TXRX
RXTX
GNDGND

ESP32R4 needs to be put into programming mode before the firmware can be uploaded:

  1. Push the button PROG;
  2. Push the button RST;
  3. After 1-second release button RST;
  4. Release button PROG;
  5. After uploading firmware push the button RST.

Embedded module installation. Serial/SPI jumpers.