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:
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.
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:
- You can become my sponsor on Github.
- If you prefer, you can also become my Patreon.
- You can buy me a coffee on Ko-fi,
- or you can buy something from my Tindie store (also see below),
- Or you can just share my work!
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.>