A nightstand noise generator based on M5Stack Atom Echo and integrating with Home Assistant
1# Atom Echo (C008-C / "Atom Voice") Pin Map
2
3## Speaker + Microphone
4
5| ESP32 Pin | Component | Function |
6| --------- | -------------- | --------- |
7| G22 | NS4168 amp | I2S DATA |
8| G19 | NS4168 amp | I2S BCLK |
9| G33 | NS4168 amp | I2S LRCK |
10| G23 | SPM1423 mic | PDM CLK |
11| G33 | SPM1423 mic | PDM DATA |
12
13Note: **G33 is shared** between the amp's LRCK and the mic's DATA line — this is why the stock firmware can't record and play simultaneously ([confirmed in community docs][m5-docs]). Not a problem for our use case (output only), but something to remember if the design ever wants local wake-word.
14
15## Human interface
16
17| ESP32 Pin | Component | Function |
18| --------- | -------------- | --------- |
19| G27 | SK6812 RGB LED | Data |
20| G39 | Button | Input (input-only pin) |
21
22## GROVE connector (HY2.0-4P)
23
24| Pin | Color | Signal |
25| --- | ------ | ------ |
26| 1 | Black | GND |
27| 2 | Red | 5V |
28| 3 | Yellow | G26 |
29| 4 | White | G32 |
30
31## Reserved pins — do not reuse
32
33From the M5Stack docs ([pinmap section][m5-docs]):
34
35> "G19 / G22 / G23 / G33 have been predefined. Do not reuse these pins; otherwise the Atom Echo may be damaged."
36
37## Available for external hardware
38
39- GROVE: G26, G32 (plus 5V / GND)
40- Button G39 is reusable if we want a different button function
41
42## Key takeaways for this project
43
44- **I2S output for our external DAC**: route to free pins (G26/G32 on GROVE, plus one more — likely borrowed from the side header) rather than the reserved G19/G22/G33. This avoids driving the NS4168 entirely. See [disabling-internal-speaker.md](./disabling-internal-speaker.md).
45- **NS4168 shutdown**: not needed — just don't send it I2S data (software-only solution in ESPHome, no hardware mod).
46- **Button** on G39 is our "start/stop bedtime routine" trigger.
47- **RGB LED** on G27 is a nice status indicator (idle / playing / HA unreachable / etc.)
48- **GROVE G26/G32** can be used for I2S out to the external DAC, or repurposed for a secondary input.
49
50## Sources
51
52- [Atom Echo product docs (M5Stack)][m5-docs] — pin map table, reserved-pin warning
53- [ESP32-PICO-D4 datasheet](../datasheets/esp32-pico_series_datasheet_en.pdf) — for confirming GPIO capabilities (input-only pins, drive strength, etc.)
54
55[m5-docs]: https://docs.m5stack.com/en/atom/atomecho