Twig magnetic compass HCM5883

Hello, does someone have been making this thing work ? because for me it is very unstable : all the value of each axes varies permanently even i don’t move the board !!
do you have an idea about it ?
thank you for your response.
ie :
x:21 y:-21 z:-235
x:12 y:-14 z:-230
x:7 y:-23 z:-219
x:27 y:-24 z:-236
x:15 y:-26 z:-237
x:25 y:-20 z:-233
x:23 y:-22 z:-215
x:20 y:-24 z:-235
x:21 y:-12 z:-235
x:26 y:-19 z:-235
x:32 y:-23 z:-234
x:30 y:-10 z:-234

Usually there are two reasons that can cause this phenomena. First, the chip is not soldered well. Second, the 4.7uF capacitance is damaged. Resolder the chip or change the capacitance to see if it works.

Thank you for your response, i’ll try to verify it but for a new module i think it’s not normal, what about the quality test ??? before sending the product to the customer.

Sorry for the issue, all the product have passed serious test before shipped, if you have any quality problem, please contrat me via email.
I will provide the test code to you for confirming.


Today I received I2C 3-axis Compass and I have the same issue - values are coming almost randomly without any movement of sensor.
I tested the same location with my Android compass and it runs just fine. So this is not the case of some interference.
Are there any solution without soldering as long as I have no proper equipment for such tiny components.
Or I just have to send device back for replacement?

P.S. for testing I used code from your wiki: … pass_v1.0b

I have 3 axis compass v1.0b and I don’t understand how calculate degrees. If I use formula:
angle = atan2(y,x)*(180/3.14) i get value from 0 to 90, but in some part, when i rotate compass i have jump from 60 or 30 degrees(value in angle) to 0. I don’t calibrate my compass.