Blinky with ESPHome ESP32-S3

Updated on 19 November 2022
dev board ESP32-S3-DevKitC-1
chip ESP32-S3-WROOM-1-N8R2
features esphome esp32s3 blinky
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Pre-requisites

Try these simpler or similar examples:

Buy the components

Code

Download config blinky-esphome-esp32s3.yaml
esphome:
  name: blinky

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  framework:
    type: arduino
    version: 2.0.3
    platform_version: 5.1.0

logger:
  level: VERBOSE
  baud_rate: 115200
  deassert_rts_dtr: true

switch:
  - platform: gpio
    pin:
      number: 5 # default LED on-board GPIO48, does not seem to work
      mode: output
    id: led

interval:
  - interval: 2s
    then:
      - switch.toggle: led
      - logger.log: "LED toggling"

Makefile

YAML_FILE=blinky-esphome-esp32s3.yaml
UPLOAD_PORT?=/dev/cu.usbmodem14*
SERIAL_PORT?=/dev/cu.usbserial-14*

.PHONY: default compile upload log clean

default: clean compile upload

help: ## Show help message
	@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n  make \033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

compile: ## Compile esphome
	esphome compile $(YAML_FILE)

upload: ## Upload the firmware to the board
	@echo "Ensure you plug in the board into the USB port"
	esphome upload --device $(UPLOAD_PORT) $(YAML_FILE)

log: ## Start the logs
	@echo "Ensure you plug in the board into the UART port"
	esphome logs --device $(SERIAL_PORT) $(YAML_FILE)

clean: ## Remove all build files
	rm -r .esphome

Prototype

A photo of the actual setup.

Blinky with ESPHome ESP32-S3 prototype

Schematic

Wire up the hardware accordingly

Blinky with ESPHome ESP32-S3 schematic

Serial console

Serial output from the firmware.

Blinky with ESPHome ESP32-S3 serial console

Blinky with ESPHome ESP32-S3 browser

Use GPIO5 to add a simple external LED

Description

LED

The default RGB LED on-board which is GPIO48, does not seem to work with ESPHome. So, wireup a simple LED and resistor to GPIO5 pin on the board.

Compile and upload

  1. Compile firmware for this board

     esphome compile blinky-esphome-esp32s3.yaml
    
  2. Plug into the USB port of the board and check the port address

     $ ls /dev/cu.*
    
     /dev/cu.Bluetooth-Incoming-Port  /dev/cu.usbmodem14101
    
  3. Upload the firmware

     esphome upload --device /dev/cu.usbmodem14101 blinky-esphome-esp32s3.yaml
    

Access logs

  1. Unplug and plug into the UART port of the board
  2. Check the new port address

     $ ls /dev/cu.*
     /dev/cu.Bluetooth-Incoming-Port  /dev/cu.SLAB_USBtoUART  /dev/cu.usbserial-1410
    
  3. Access the logs

     esphome logs --device /dev/cu.usbserial-1410 blinky-esphome-esp32s3.yaml
    

References