DIY Calendar House Review Request

Thread Starter

TehoorMarjan

Joined Nov 21, 2024
4
Dear all,

first, thanks for greating me in your community and sorry if I'm posting in the wrong section ! For a quick presentation, I'm from France, I'm 38, I'm an engineer in IT, mostly embedded safety SW for automotive. I've got some basics in electronics from school, but lost most of it in the past years, which means I'm still very prone to incredibly noobie mistakes.

My little DIY project is based on a wooden advent calendar in for of a house. Goal is to detect the opening of the drawers, have lights for each of them, and some audio. The whole is driven by an ESP32 NodeMCU module. I thought I would go with pre-made modules just wiring them together, but in the end, I have a number of small components that need serious integration and thus a little PCB. I'm planing on ordering on PCBWay, in the hope it arrives on time.

CalendarHouse_1.pngCalendarHouse_2.pngIMG_20241118_192447.jpg

My first question is about the Audio Module (Click for link). There is a blog post "Internet radio with the ESP32 update" from the vendor that includes a 22k and 4.7k resistors on the I2S lines as a divider bridge and I can't figure out why. So after long research (and given that the module board includes a serial capacitor and serial 10k resistor already), I finally decided to get rid of them. But I'm really unsure.

My second question is about the MOSFET usages. There is a first one on the "ESP 32" block, and its role is to cut out the power for almost all external modules. It is driven by a GPIO of the ESP32. The second one is the "Hall Power Switch". I stupidly ordered A3144 hall sensors, which means they are active when the magnet is there, which for me means the drawer is closed, in other words, it's always active except rare times. To lower current consumption, I'll use polling instead of interrupt. Each 1/4s (or so), the ESP 32 will activate the MOSFET to activate the two IO expanders and the 24 hall sensors. After a settling time, the state will be read and the power will be cut. The last MOSFET, in the "Power KeepAlive" block is to drain some power from time to time so that the power bank doesn't go to sleep (yeah, I thought it would be cheaper...). Idea is to drain about 150-200mA for 10ms every 1 to 5 seconds. I'm not entirely sure of my wiring there, though.

Then, of course, any suggestion, other mistakes, remarks, ... are very welcome!

Below are just some illustrations to give a more concrete idea, but beware that this correspond to an old version. These images don't match the current state of the schematics. I still have to redo the PCB, as I learned a lot from my last attempt and I modified quite substential features.

CalendarHouse_bb.pngCalendarHouse3D.png

Thank you very much, don't hesitate to ask, comment, ...!

Tehoor
 

MisterBill2

Joined Jan 23, 2018
27,159
The two resistors are to reduce the audio signal to avoid over driving the amplifier. It might be possible to change the magnetic arrangement to reverse the logic on the hall effect devices. It is worth a few minutes of thought, at least.
OR you might be able to use your keep-alive current pulse to only power the hall sensors for a few milliseconds every second, and save power doing something useful at the same time.
 

Thread Starter

TehoorMarjan

Joined Nov 21, 2024
4
Thanks for your remarks and time!

IIRC my computations, the hall sensors together pull 12mA (the expanders draw a somewhat negligible current), but you're right, I didn't think about it. Anyway, that's still 80mA too short. Besides, the hall sensors will be polled at 2 or 4 Hz, while the power bank should not need more than a "tickle" every 1s or so. So the idea is good, but I think for these reasons, I cannot "merge" the two blocks.

I had a "brainstorming with ChatGPT" (so with a grain of salt) about reversing the hall sensors arrangement, but the power drain is still there anyway. Even using some "not gate" (one or two transistors in fact), the current has to go somewhere anyway. The only thing possible was to increase the pull-up resistor, but this had impacts on other part. TBH I don't recall what. Maybe the minimal current necessary to flow in the open collector (?).

About the audio signal, I thought I2S was a digital bus, not an analog one... Or is there something I missed in the design/the way the module works?
 

Thread Starter

TehoorMarjan

Joined Nov 21, 2024
4
Oh, well... I understand now... It's not I2S at all, that's just the DAC. Very nice, now I'm dealing with analog strips... So you're totally right, this is a tension divider to reduce audio signal. But it means I really need to protect these lines from interferences too. TBH, I was also wondering how a bus could work like that with just one line, not even a differential pair, no clock... Stupid mistake :s
 

MisterBill2

Joined Jan 23, 2018
27,159
You could add resistors to make up the balance of the current draw.
And for the audio, you will also need to connect to that module's GND, possibly the (gnd1) located near the two audio outputs. And that should be a dedicated single circuit connection.
 

Thread Starter

TehoorMarjan

Joined Nov 21, 2024
4
Thanks, here is a corrected schematics after some thoughts, reviews and changes around the audio module.

CalendarHouse_1.png
(Nothing specific on second page except updated resistor references)
 
Top