Had a project deadline today, so I had to finish it last night. All the individual pieces were working on the bench, and was quite a collection of cheap parts I've touted here before. Dollar store speaker amp, MP3 player, tilt/impact switches, 10-cent buzzer, etc. Project is a toy which plays various MP3 sounds and flashes LEDs based on user & switch input. I made an auto-off circuit using the cutest little 10-cent reed relay. The 510-ohm coil only pulls a few mA from the 3xAAA cells, so it's powered directly from a micro pin. After 30 seconds of inactivity, the micro switches the relay off, providing 100% isolation, zero battery drain. Works GREAT in the lab, on the bench.
But when I assembled the module for the final installation around midnight, it would turn off anytime there was a loud sound file playing. Electrical noise? Added filter caps. No. Added decoupling caps. No.
Wait, I also have an electromechanical buzzer on the PCB which I use to send occasional confirmation beeps & tones. That could be the source of some EMI. Disconnect buzzer. No improvement.
Reduce amplifier volume, problem goes away. But that's not an option.
Power drain? Is the micro resetting from low power when the speaker/amp is drawing lots of current? Battery wires too small or routed wrong? Rewired. No. Did it get even worse? The LEDs aren't even connected at this point, it will need even more power!
Sweating now, it's 1 AM. Added a transistor switch to drive the relay. No improvement.
The reed relay was opening up for mysterious reasons. But I'm the relay guy, relays usually like me. Not tonight though...
Stared at the assembly for a while. In the assembled form, the circular PCB are screwed to 3 bosses inside the speaker housing. Makes for a beautiful, compact prototype, not that anyone would see it inside the toy. I've mentioned this speaker here before,
it has a huge permanent magnet speaker inside. Hey wait, that huge permanent magnet is very close to the PCB in the final installation, could that be causing the problem?
2 AM, let's add a quick (insulated) metal shield between the speaker and PCB. No steel handy. Recycling's gone, I cut a circle out of my aluminum Diet Coke can. No improvement. Pulled the ferrous pop top off a can of Chef Boy R Dee ravioli and installed it. 100% success. Turns out that sensitive little reed relay was being affected by speaker magnetism at high volumes. DOH!
What's funny is that this was a second-gen circuit. I had made a nearly identical board previously which worked perfectly. The relay was an afterthought on that board, and I mounted it at 90 degrees for pin access. Apparently
the reed contacts were less susceptible in that 90-degree configuration.
So my story ends happily. Finished the job at 3 AM and delivered it to a very happy client at 10:30 who will never suspect that there's a can lid inside.
Now it's time for some sleep. Then I have to build another one. Maybe two.
Note to self: hoard more ravioli.