Blinky with Micropython on ESP32-C3

Updated on 11 October 2023
dev board ESP32-C3-DevKitM-1
chip ESP32-C3-MINI-1-N4
features blinky led esp32c3 micropython rshell
This tutorial is more than 6 months old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting


Ensure the following dependancies are downloaded and available:

Buy the components


Download code
from machine import Pin
import time
led_pin = 3  # Default on-board RGB LED GPIO08 does not work

led = Pin(led_pin, Pin.OUT)
for i in range(10):
  print("Blink ", i+1)


.PHONY: help default upload log

default: 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)

upload: ## Erase flash and then upload the micropython binary
	@echo "Ensure you plug in the board into the USB port"
	@ls /dev/cu.* --chip esp32c3 --port $(PORT) erase_flash --chip esp32c3 --port $(PORT) --baud 460800 write_flash -z 0x0 $(BIN_FILENAME)

log: ## Access the serial monitor with rshell
	@ls /dev/cu.*
	@echo "Ensure you plug in the board into the USB port"
	@echo "Then upload the python file with command: cp /pyboard"
	@echo "Then entier the REPL with command: repl"
	@echo "Then enter command: import blinky"
	rshell --port $(PORT)

	@ls /dev/cu.*
	@echo "Ensure you plug in the board into the USB port" --port $(PORT) erase_flash
	@echo "Flash in ESP-IDF blinky"


A photo of the actual setup.

Blinky with Micropython on ESP32-C3 prototype


Wire up the hardware accordingly

Blinky with Micropython on ESP32-C3 schematic

Serial console

Serial output from the firmware.

Blinky with Micropython on ESP32-C3 serial console



The default RGB LED on-board which is GPIO8 does on work. So, wire up a simple LED to GPIO3 with a 1k resistor to the ground.

Upload the Micropython binary

  1. Plug in the board via the USB port to know the port number
     $ ls /dev/cu.*
     /dev/cu.SLAB_USBtoUART  /dev/cu.usbserial-1410
  2. Download the *.bin file for the board esp32c3-*.bin
  3. Erase the entire flash --chip esp32c3 --port /dev/cu.SLAB_USBtoUART erase_flash
  4. Flash the firmware starting at address 0 --chip esp32c3 --port /dev/cu.SLAB_USBtoUART write_flash -z 0 _tutorials/code/blinky-micropython-esp32c3/esp32c3-*.bin

Access the Serial monitor with rshell

  1. Download rshell and ensure it is available
     pip install rshell
  2. Plug in the board
  3. Check the port number of the board
     ls /dev/cu.*
  4. Connect to the board
     rshell -p  /dev/cu.usbserial-1410
  5. Upload the python file in rshell
     cp /pyboard
  6. Enter the RELP with repl
  7. Type import blinky or whatever the filename is
  8. See the external LED blink 10 times

Rollback from Micropython to Arduino

  1. Follow the rollback steps to erase the flash.
  2. Flash in blinky with ESP-IDF.
  3. Flash in blinky with Arduino.