Louder ESP32 - ESPHome Class-D amplifier board

While scouring the internet in search of an ESP32 amplifier capable of running ESPHome firmware, I discovered the Louder ESP32. This neat unit comprises an external I2S DAC, perfectly able to drive 2 full-sized speakers, and a external PSRAM chip.

Sadly there was no ESPHome support yet, so with a little help from the boards developer, a little chatGPT magic and myself, I created a custom component to drive this “high power” DAC/AMP. I also filed a feature request here: TAS5805M support · Issue #2666 · esphome/feature-requests · GitHub

This board sounds great. You might want to try this yourself. I have no stock in his Tindy store, paid for this myself but it still recommend this board to anyone looking for a ESPHome capable (stereo) smart speaker.

Check out: GitHub - HA-TB303/ESPHome-Louder-ESP32: ESPhome configuration for the Louder ESP32 board or my blog article: Louder ESP32, a Hi-Fi Class-D audio amplifier running ESPHome! - espthings.io

Ehm… yes, you could also run Squeezelite-ESP32, a multimedia software that supports Spotify’s over-the-air player via SpotifyConnect, an AirPlay controller compatible with iPhone, iTunes, and even multiroom synchronization capabilities, but…why? :slight_smile:

1 Like

There was one in stock - none now :slight_smile:

Thanks for the pointer.

Let is know if you like it :slight_smile:

My opinion is as unbiased as opinions usually get :wink: love to hear yours!

I have an extensive LMS setup so will be able to test synchronisation.

By the way your blog post is incorrect to say synchronisation is only available for airplay. LMS synchronizes all LMS devices if they are really LMS devices.

I was unable to test that, so I had to do with the information I could find about synchronization.

A few things:

  1. The Louder ESP32 is sadly no longer available. I talked to the boards designer and he is going to replace the Louder ESP32 with the Louder Esparangus. That one might get the ESP32-S3 and a mems microphone as well as a header for external LED’s.

  2. I have tried to get the DAC working on esp-idf framework, but so far have not succeeded. Wire.h is not supported on esp-idf so I have to work around that, but my C++ knowledge it not sufficiënt for that. Anybody able to help me out?

This is the current code:

//###########################################################################
//## ESPHome custom component for the Louder ESP32                         ##
//## Get it here: https://www.tindie.com/products/sonocotta/louder-esp32/  ##
//##Check the blog article on www.espthings.io\                            ##
//###########################################################################
#include "esphome.h"
#include <Wire.h>

#define DEVICE_CTRL_2_REGISTER 0x03
#define PWDN_PIN 33
#define I2C_ADDR 0x2D

class TAS5805 : public Component, public Switch  {
  public:
    void setup() override {
      pinMode(PWDN_PIN, OUTPUT);
      digitalWrite(PWDN_PIN, LOW);
      delay(200);
      digitalWrite(PWDN_PIN, HIGH);

      Wire.begin();
      Wire.beginTransmission(I2C_ADDR);
      if (Wire.endTransmission() != 0) {
        ESP_LOGE("TAS5805", "TAS5805 not found at address 0x2D");
        return;
      }
      Wire.beginTransmission(I2C_ADDR);
      Wire.write(DEVICE_CTRL_2_REGISTER);
      Wire.write(0x02);
      Wire.endTransmission();
      delay(50);
      Wire.beginTransmission(I2C_ADDR);
      Wire.write(DEVICE_CTRL_2_REGISTER);
      Wire.write(0x03);
      Wire.endTransmission();

      ESP_LOGI("TAS5805", "TAS5805 initialized.");
    }

    void write_state(bool state) override {
      uint8_t value = state ? 0x03 : 0x00;
      Wire.beginTransmission(I2C_ADDR);
      Wire.write(DEVICE_CTRL_2_REGISTER);
      Wire.write(value);
      Wire.endTransmission();
      publish_state(state);
    }
};

Which is switched on/off in esphome by:

switch:
  - platform: custom
    lambda: |-
      auto tas5805 = new TAS5805();
      App.register_component(tas5805);
      return {tas5805};
    switches:
      name: "Enable Amp"

Checked with a pair of fresh eyes during lunch break :wink:
Works fine on arduido framework, but on esp-idf I get:

Compiling .pioenvs/louder-esp32/app_trace/app_trace.o
In file included from src/main.cpp:28:
src/louderesp32.h:7:10: fatal error: Wire.h: No such file or directory

**************************************************************
* Looking for Wire.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Wire.h"
* Web  > https://registry.platformio.org/search?q=header:Wire.h
*
**************************************************************

 #include <Wire.h>
          ^~~~~~~~
compilation terminated.
*** [.pioenvs/louder-esp32/src/main.o] Error 1
========================= [FAILED] Took 17.27 seconds =========================

about time there are alternatives to the expensive SONOS solutions. Keep up the good work

1 Like