English
English
简体中文
日本語
pdf-icon

AtomS3R-M12 Home Assistant Integration

This tutorial introduces how to integrate AtomS3R-M12 into Home Assistant.

Preparation

Note

This tutorial uses ESPHome 2025.12.5 to compile and upload firmware. If you encounter compilation/upload issues, please consider switching the ESPHome version.

Quick Start

Click the button below to flash the firmware with one click. Follow the on-screen instructions to complete the configuration and quickly experience AtomS3R-M12 integration with Home Assistant.

Create Device

  1. Click the green button in the lower-right corner to create the device.
  1. Click CONTINUE.
  1. Click New Device Setup.
  1. Enter the device name, then click NEXT.
  1. Click ESP32-S3.
  1. Click SKIP.
  1. Click EDIT, we can customize device functions through the YAML file.

Modify Configuration

The following is the core part of the code. Related references and instructions are provided below.

Basic Information and Boot Operation

Add on_boot component:

esphome:
  name: atoms3r-m12
  friendly_name: AtomS3R-M12
  on_boot:
    priority: 800
    then:
      - lambda: |-
          gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT);
          gpio_set_level(GPIO_NUM_18, 0);
          vTaskDelay(pdMS_TO_TICKS(1500));
Note
Due to the hardware circuit design, AtomS3R-M12 needs to pull GPIO18 low after power-on to enable correct I²C communication. If GPIO18 is not set to a low level before I²C bus initialization or access, I²C communication may fail. Therefore, GPIO18 control must be assigned the highest priority to ensure it is pulled low during the early stages of system startup.

PSRAM Configuration

Add PSRAM component:

psram:
  mode: octal
  speed: 80MHz

External Components

Add External Components component:

external_components:
  - source: github://DennisGaida/m5stack-atoms3r-components/components@main
    components: [bmi270_bmm150]
Note
Since ESPHome does not yet provide official BMI270 / BMM150 components, this project uses a third-party component library contributed by community developers. We express our sincere thanks to the author for their contribution.

I2C Bus Configuration

Add I2C component:

i2c:
  - id: BMI270_150
    sda: GPIO45
    scl: GPIO0
  - id: camera_i2c
    sda: GPIO12
    scl: GPIO9
    frequency: 100kHz
    timeout: 10ms

Sensor Configuration

Add Sensor component:

sensor:
  - platform: bmi270_bmm150
    i2c_id: BMI270_150
    address: 0x68
    update_interval: 3s
    acceleration_x:
      name: "BMI270 Accel X"
    acceleration_y:
      name: "BMI270 Accel Y"
    acceleration_z:
      name: "BMI270 Accel Z"
    gyroscope_x:
      name: "BMI270 Gyro X"
    gyroscope_y:
      name: "BMI270 Gyro Y"
    gyroscope_z:
      name: "BMI270 Gyro Z"
    temperature:
      name: "BMI270 Temperature"

Camera Configuration

Add ESP32 Camera component:

esp32_camera:
  name: "OV3660 Camera"
  external_clock:
    pin: GPIO21
    frequency: 20MHz
  i2c_id: camera_i2c
  data_pins: [GPIO3, GPIO42, GPIO46, GPIO48, GPIO4, GPIO17, GPIO11, GPIO13]
  vsync_pin: GPIO10
  href_pin: GPIO14
  pixel_clock_pin: GPIO40
  resolution: 640X480
  jpeg_quality: 10

Download and Flash Firmware

  1. After modification, click SAVE and INSTALL in the upper-right corner, then select Manual Download in the pop-up window.
  1. Select Factory format(Previously Modern).
Tip
Click AtomS3R-M12 to view the complete example configuration. The first build may take some time, depending on the performance of the Home Assistant host and network quality.
  1. Connect the device to the host via a USB Type-C data cable. Open ESPHome Web and click CONNECT to connect to the device.
  1. Locate the corresponding serial port number.
  1. Click INSTALL.
  1. Select the compiled firmware to upload.
  1. After the download is complete, restart the device.

Quick Start

  1. Click Settings -> Device & services to check the device.
  1. We can find the corresponding device in the Discover section.
  1. After adding the device, the data will be displayed correctly.
  1. Finally, we add these entities to the Dashboard; the following are the display results.
On This Page