christandlg / AS3935MI

mirror of https://bitbucket.org/christandlg/as3935mi (master branch only)
2 stars 0 forks source link

Resonance Frequency Calibration failed. #1

Closed md88x closed 4 years ago

md88x commented 4 years ago

Dear all,

I am testing my AS3935 (CJMCU) with the example sketch "AS3935_LightningDetector_SPI.ino". I rechecked everything but the resonance frequency continue to fail.

If I skip the while(1) to continue the program here it is my serial monitor with a lot of noise:

15:15:46.102 -> SPI connection check passed. 15:15:46.102 -> IRQ pin connection check passed. 15:15:47.759 -> Resonance Frequency Calibration failed. 15:15:47.806 -> RCO Calibration passed. 15:15:47.806 -> Initialization complete, waiting for events... 15:15:49.163 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:49.210 -> increased noise floor threshold 15:15:50.012 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:50.112 -> increased noise floor threshold 15:15:50.165 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:50.266 -> increased noise floor threshold 15:15:50.313 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:50.413 -> increased noise floor threshold 15:15:50.466 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:50.567 -> increased noise floor threshold 15:15:51.068 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:51.115 -> noise floor threshold already at maximum 15:15:51.215 -> Disturber detected. attempting to increase noise floor threshold. 15:15:51.268 -> increased watchdog threshold 15:15:51.315 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:51.369 -> noise floor threshold already at maximum 15:15:51.415 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:51.516 -> noise floor threshold already at maximum 15:15:51.569 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:51.616 -> noise floor threshold already at maximum 15:15:51.669 -> Noise floor too high. attempting to increase noise floor threshold. 15:15:51.716 -> noise floor threshold already at maximum

christandlg commented 4 years ago

This may actually be a faulty module. I have 2 CJMCU-3935 modules, one of them fails calibration every time, even with other libraries.

I’ll see what can be done to get more info in case this error occurs, but I am afraid the error is only fixable by a hardware modification of the module.

christandlg commented 4 years ago

I have extended the function calibrateResonanceFrequency() to return the resonance frequency of the antenna. This is implemented by the examples which will produce output like (in the case of my bad CJMCU-3935 module):

Resonance Frequency is 475840 Hz

The resonance frequency should be 500 kHz +- 3.5%, that is between 482500 Hz and 517500 Hz.

md88x commented 4 years ago

Thankyou christandlg for you quick and very helpfull reply!

My module is even worse: 470320 Hz! I wanted to save money with a cheap module and now I need to spend more! Which one do you suggest?

Thankyou again

P.s. By the way, the noise problem was simply due to the sensor close to the PC.

christandlg commented 4 years ago

I only ever used my two CJMCU-3935 modules, so I can't give a recommendation. Sorry!

My sensors are also very susceptible to noise, for example by nearby I2C bus lines.