Skip to content

M5Stack Atom Echo

The M5Stack Atom Echo is a compact ESP32-based smart speaker development kit. It serves as the voice satellite for Schakel -- capturing audio from its built-in microphone and playing back responses through its speaker.

What You Need

  • M5Stack Atom Echo
  • USB-C cable
  • ESPHome CLI or Dashboard
  • WiFi network credentials

Flashing the Firmware

The ESPHome configuration is included in the repository at esphome/atom-echo.yaml.

Using ESPHome CLI

# Install ESPHome if you don't have it
pip install esphome

# Create a secrets.yaml file for WiFi credentials
cat > esphome/secrets.yaml << 'EOF'
wifi_ssid: "your_wifi_ssid"
wifi_password: "your_wifi_password"
EOF

# Flash the firmware (connect the Atom Echo via USB-C first)
cd esphome
esphome run atom-echo.yaml

Using ESPHome Dashboard

  1. Open your ESPHome Dashboard (usually at http://homeassistant.local:6052 if using the HA add-on).
  2. Click "New Device" and choose "Skip" for the wizard.
  3. Paste the contents of esphome/atom-echo.yaml into the editor.
  4. Set up your WiFi secrets in the ESPHome secrets configuration.
  5. Click "Install" and choose your connection method (USB for first flash, OTA for subsequent updates).

ESPHome Configuration Explained

The full configuration file:

esphome:
  name: schakel-satellite
  friendly_name: Schakel Satellite
  platform: ESP32
  board: m5stack-atom

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

api:
ota:
  platform: esphome
logger:

i2s_audio:
  - id: i2s_shared
    i2s_lrclk_pin: GPIO33
    i2s_bclk_pin: GPIO19

microphone:
  - platform: i2s_audio
    id: atom_mic
    i2s_audio_id: i2s_shared
    adc_type: external
    i2s_din_pin: GPIO23
    pdm: true
    channel: left
    sample_rate: 16000
    bits_per_sample: 16

speaker:
  - platform: i2s_audio
    id: atom_speaker
    i2s_audio_id: i2s_shared
    dac_type: external
    i2s_dout_pin: GPIO22
    mode: mono
    sample_rate: 16000
    bits_per_sample: 16

light:
  - platform: esp32_rmt_led_strip
    id: status_led
    pin: GPIO27
    num_leds: 1
    rgb_order: GRB
    chipset: SK6812
    name: "Status LED"

binary_sensor:
  - platform: gpio
    id: atom_button
    pin:
      number: GPIO39
      inverted: true
    name: "Button"

Breakdown

I2S Audio Bus

The Atom Echo uses a shared I2S bus for both the microphone and speaker. The bus is configured with LRCLK on GPIO33 and BCLK on GPIO19.

Microphone

  • PDM (Pulse Density Modulation) microphone on GPIO23
  • Captures audio at 16 kHz, 16-bit mono -- matching Schakel's expected input format
  • Left channel only

Speaker

  • DAC output on GPIO22
  • Plays back audio at 16 kHz, 16-bit mono
  • Schakel's TTS engine resamples to this format automatically

Status LED

  • SK6812 RGB LED on GPIO27
  • Can be used to indicate wake word detection, processing state, etc.

Button

  • GPIO39 with inverted logic (active low)
  • Can be configured for push-to-talk or other actions

Audio Format

Schakel expects and produces 16-bit PCM audio at 16 kHz, mono. The ESPHome configuration matches this format on both the microphone and speaker, so no format conversion is needed on the satellite side.

Custom external component required

The ESPHome configuration above sets up the hardware, but you need a custom external component to bridge the Atom Echo to Schakel's raw WebSocket protocol. The built-in ESPHome voice_assistant component speaks Home Assistant's native pipeline protocol, which is a different format.

The external component must:

  • Connect to Schakel's WebSocket at ws://<schakel-host>:8000/ws/audio
  • Stream raw PCM bytes from the microphone
  • Receive raw PCM bytes and play them through the speaker

WiFi Secrets

ESPHome uses a secrets.yaml file for sensitive values. Create esphome/secrets.yaml:

wifi_ssid: "your_wifi_ssid"
wifi_password: "your_wifi_password"

Do not commit secrets

The esphome/secrets.yaml file should never be committed to version control. Add it to your .gitignore if needed.

Troubleshooting

Device not found during flashing

Make sure the USB-C cable supports data transfer (not charge-only). Try a different USB port or cable.

No audio captured

Check that the microphone PDM pin (GPIO23) matches your hardware revision. Some early Atom Echo units may have different pin assignments.

WiFi connection issues

The Atom Echo only supports 2.4 GHz WiFi networks. Make sure your SSID is on the 2.4 GHz band.