Schematic for environmental sensors, mics, and speaker

Thread Starter

n4te

Joined Mar 11, 2023
6
Hello! Long time lurker, finally posting.

I've made a number of daughterboards to use with ESP32 dev boards. Now I have a more ambitious project: a flush wall mounted device that has 2 microphones, a speaker, and a bunch of sensors (temp, humidity, pressure, VOC, CO2, PM2.5, light, and LIDAR). I'll use it for home automation voice commands, as an intercom, and for the air quality sensors.

I'll still use an ESP32 dev board, mainly because I want PoE (using a wESP32). I briefly looked at integrating an ESP32, but PoE is just too daunting for now.

For the mics and speaker I'm hoping to use MicroChip's ZL38051 for hard to implement features like beamforming and echo cancellation. I'm a bit worried they won't give me access to the docs/tools needed for the firmware. I guess I need to talk to their sale people. This is a personal project, not commercial, so we'll see how that goes.

The schematic is attached (image and PDF), any feedback would be appreciated!

A couple places where I'm not sure:

  • I have 7 sensors and the audio IC on a single I2C bus. I think all of those have pretty low bandwidth needs. The audio IC firmware is transferred over I2C on boot and that can take ~5 seconds, but after that there shouldn't be much traffic. Do you think it's worth it to split the devices over a second I2C bus?
  • I put some 1uF and 4.7uF bypass capacitors based on datasheet recommendations. I have 10uF for the whole board, is that plus the many 0.1uF enough? Should I keep the 1uF and 4.7uF since they don't hurt?
  • Is my PoE ESP32 going to handle powering all this stuff?
    • The audio IC is ~17mA and the sensors aren't much individually.
    • The speaker amp can output a max of 3W of the 5W budget I have on 5V (shared with 3.3V). That's for stereo though, so I guess the max is half that ~1.5W. Also audio is rarely playing (only for beep-boops and intercom) and surely not that loud (speaker is 4W, 8ohm, 84db sensitivity).
    • For the LEDs, most often they will be off. I'll use them for animations and indicators. They are RGB and I probably won't turn on all 3 LEDs to max. They say 0.1W, 0.5W max, 24.5mA and there are 28 of them. 0.1W*28=2.8W, seems OK. 0.5W*28=14W, doesn't seem OK! What is the right way to judge this?
 

Attachments

Audioguru again

Joined Oct 21, 2019
6,692
Powered from 5V, the MAX speaker amplifier you selected produces 3.7W of severe distortion per channel into a 3 ohms speaker.
It produces 1.3W per channel into your 8 ohms speaker without clipping distortion.
 

Thread Starter

n4te

Joined Mar 11, 2023
6
Good point, 10% THD would sound bad. Looks like 1.4W at 1% THD for 8ohm speaker at 5V.

Is the 1.4W really per channel? I don't see it mentioned explicitly, is it just known that these specs are per channel?

6699-Y0zl[1].png

Do you think 1.4W will be loud enough? At 89dB sensitivity, this calculator is telling me I'll get 69.8dB at 20' away. If that's true, that seems pretty OK, but quieter than ~70dB would probably be too quiet. I'm only using the speaker for beeps and voice.

I looked at many amplifiers and the MAX98306 seemed like an OK pick, but I'm open to better ideas! It'd be nice to have some volume control, as I may want to play beeps at different volumes than voice. Mono is fine.

I found some amps that have a boost converter, like the MAX98390. It gives 5.1W for 8ohm speakers and 4.3V, 1% THD. The amps with a boost converter are all aimed at battery driven devices. It isn't clear if it's a good idea to use them in my case, or what downsides there might be.

My tentative speaker pick is this RAN22WP-8A, mostly because it fits through my tiny 66.6 x 22.6mm opening and then can be tilted into place. It's really hard to find a decent speaker for such a tight space. I'll compare with the T1-1931S. That has more range but awful 76dB sensitivity. 2W would give 63.3dB and even 4W only 66.3, so I'm guessing it won't be loud enough. Do you know a good small speaker? The bummer is it can't be taller than 22.6mm.
 

Audioguru again

Joined Oct 21, 2019
6,692
The 1.3W or 1.4W into 8 ohms for one one stereo channel from the MAX amplifier is for the loudest parts of speech with low distortion. The average power will be much less.

The tiny speaker has no audio specs or curves and will be a shrieker, not a speaker.
A small speaker sounds awful if it does not have a proper fairly large enclosure.
 

Thread Starter

n4te

Joined Mar 11, 2023
6
One of my design goals is a very small opening on the wall. I will use a 3D printed flush mount that gets taped and mudded flush with the drywall:

6625-RzaN[1].jpg
6626-tvHw[1].jpg

This looks cool, but means I have to fit the speaker through the 66.6 x 22.6mm opening. I'm able to just barely slide this particular 2.5" speaker in, stand it up, and have it drop into a slot. I'd happily modify the mount for a different speaker, if it were better and would still fit. I could increase the opening height slightly, but not much. Maybe 26mm.

I know a small speaker won't be great. My hope is it can be passable for voice. Maybe the faceplate and the PCB it covers will attenuate some of the shrieking. :D The PCB will have some holes and the faceplate is 1mm thick with a 1 x 45mm slot. Here's the PCB without the faceplate (WIP):

6702-GA8m[1].png
 

Attachments

Audioguru again

Joined Oct 21, 2019
6,692
I was given an Amazon Fire 7 Tablet. Its sound for voices is so bad that many words are unintelligible and my dog runs away when it plays known voices. Its speaker is tiny with low power.
 

Thread Starter

n4te

Joined Mar 11, 2023
6
Not too surprising, though speakerphone on a (quality) cell phone is usable, yet is also a tiny speaker. 2.5" is a whole lot bigger than both of those. I know better than to expect it to sound great, but I hope it can be decent for voice. I look forward to testing it.
 

Thread Starter

n4te

Joined Mar 11, 2023
6
I managed to finish the layout! It was really hard on such a tiny board. Any feedback before I submit it to be made? I'll do the soldering. Layers are top, gnd, 3.3v, bottom.
 

Attachments

Thread Starter

n4te

Joined Mar 11, 2023
6
Using a 3W amp (KAB-23), I tested the T1-1931S speaker and it was about as expected. It goes reasonable low, music even sounds OK (obviously for noncritical listening), but the low sensitivity keeps it from getting very loud -- too quiet for my needs.

The RAN22WP-8A does not go low, but speech sounds OK. It is clear and loud enough, so I think I'll use it as planned.

For kicks I also tried a $2.69 2" speaker, Visaton K50-8, and it sounded like absolute garbage. It is not good for anything except maybe a buzzer, and even then a quiet one.

I'm a bit bummed about not having any feedback on other aspects of my project. Is there a more appropriate community I should try? I tried on the Arduino forums but that seems to have mainly unhelpful pricks. Maybe I'll try on Reddit.

In other news, Microchip does not support their audio ICs anymore. It isn't possible to get the ZLS38508 or ZLS38508LITE software and the ZLE38470BADA hardware is not available. I'll redo my design using the Xmos XVF3610.
 
Top