Face the Fail: Piezo or Not to Piezo?

Share via

In the last week I’ve been working on a device, which uses an electronic compass. I chose HMC5983, so no rocket science happening – I used the recommended layout, made a prototype PCB, populated it and wrote the firmware. Everything went smoothly on the first try.

Then I adjusted position of the components on the board, repositioned few wires and made a batch of 6 new PCB. After I populated them, the compass stopped working – the X axis showed fixed value, the other one were working properly. Strange, right? If it was one board, I would thought about damaged component. But all 6 boards featured the same behavior. After two hours I finally localized the cause of the troubles – a piezo buzzer. At least I thought it was a piezo buzzer.

My board uses a pizeo to notify the user via beeping. I used the standard 12 mm piezo in a plastic housing:

A standard 12 mm piezo buzzer
A standard 12 mm piezo buzzer

However the piezos I used weren’t piezos – they were actually a small speakers with a magnet inside, as I found out after I crack opened one. It is impossible to tell the difference between piezo and a speaker in the same package. In the first revision, the piezo buzzer was concentric with the HMC5983, so only Z axis, which a I didn’t plan to use, was I affected. However in the second iteration I moved the piezo a little bit – assuming it has no significant magnetic field. But the parts I used, actually had a quite strong magnetic field.

A piezo or not a piezo?
A piezo or not a piezo?
Actually a small speaker with a magnet inside
Actually a small speaker with a magnet inside

Luckily, the magnetic field from the speaker didn’t saturated the sensor, so a software compensation was possible.

I learned a lesson – inspect the parts before using them in your project.


Recent news: My open letter to the 3D-printing community

I love the 3D-printing community, but I think there is room for improvement. Let's get better in 2023! Read the full letter.

Support my work!

If you like my work (these blog posts, my software and CAD models) and you would like to see more posts on various topics coming, consider supporting me in various ways:

If you are interested in knowing what I am up to and recent sneak-peaks, consider following me on social media (Twitter, Instagram, Facebook).

My store offers

I launched new tank cleaning kits for Elegoo Saturn, Saturn S, Mars 1, and Mars 3. You can find them in my store.

Share via
Back To Top