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.
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?
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.
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.
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"