Go to file
Jake 4bd94bcc32 readme update 2026-07-20 10:15:37 +08:00
.vscode streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
build basically working, i2c slave, wifi testing 2026-07-20 10:08:23 +08:00
main basically working, i2c slave, wifi testing 2026-07-20 10:08:23 +08:00
managed_components streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
mp_i2c_master basically working, i2c slave, wifi testing 2026-07-20 10:08:23 +08:00
pc_vision readme update 2026-07-20 10:15:37 +08:00
.clangd streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
CMakeLists.txt streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
README.md readme update 2026-07-20 10:15:37 +08:00
dependencies.lock streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
partitions.csv streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
pytest_hello_world.py streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
sdkconfig basically working, i2c slave, wifi testing 2026-07-20 10:08:23 +08:00
sdkconfig.ci streaming, comms, and basic image processing app 2026-07-17 14:52:46 +08:00
sdkconfig.defaults basically working, i2c slave, wifi testing 2026-07-20 10:08:23 +08:00

README.md

linefollower_eye

ESP32-S3 camera board that finds a coloured blob and reports its position over I2C. Meant to sit on a robot as the “eye”, with something like a Pico as the master.

What it does

The ESP runs HSV blob detection on the camera. A MicroPython master can turn the camera on, set colour, and poll for a target. Optionally it can join WiFi so you can open a browser page to tune the colour live.

Target position from read_target() is relative to the image centre (320x240). Positive x is right, positive y is up. No target returns None.

Hardware

ESP pins for the I2C slave:

  • SDA: GPIO19
  • SCL: GPIO20
  • Address: 0x42

Example Pico wiring:

  • GP0 (SDA) -> ESP GPIO19
  • GP1 (SCL) -> ESP GPIO20
  • GND shared
  • Use external pull-ups on SDA/SCL (about 2k24k7 to 3V3)

Camera and WiFi stay off until the master enables them.

Firmware

ESP-IDF project for ESP32-S3. Build and flash as usual:

idf.py build
idf.py -p PORT flash monitor

MicroPython master

Files live in mp_i2c_master/. Copy vision.py (and main.py if you want the demo) onto the board.

from vision import Vision
import time

eye = Vision(sda=0, scl=1)
eye.start()

# Optional: browser UI for tuning colour
# eye.set_wifi("YourSSID", "YourPassword")
# print(eye.wifi_ip())

while True:
    t = eye.read_target()
    if t is None:
        print("no target")
    else:
        x, y = t
        print(x, y)
    time.sleep(0.1)

Useful calls:

  • eye.start() — camera on and local detection
  • eye.set_hsv(h, s, v) / eye.set_tolerance(...) — colour (or tune in the browser)
  • eye.set_wifi(ssid, password) / eye.wifi_off() / eye.wifi_ip()
  • eye.read_target()(x, y) or None

Web UI

After WiFi is up, open the ESPs IP in a browser. You get the live image, colour picker / eyedropper, mask options, and timing. Colour changes there are what the I2C master reads next.

Other folders

  • pc_vision/ — older desktop viewer; the on-device web UI replaces it for tuning
  • main/ — ESP firmware