-->
Page 2 of 2

Re: How to measure frequency ( 30-35 Khz ) ?

PostPosted: Mon Jan 02, 2017 8:06 pm
by aphawk
Hi Heckler,

Yes, I know that this can be made by other small 8 pin like Attiny, but in fact this is what I have done !

I want to use one Lightining sensor based in AS3935, with one ESP8266, powered by one battery, charged with a small solar panel, this will sending the data via WIFI to ThingSpeak. All this will be at top of my antenna tower, to be more protected against human generated noises. If using sleep mode, this can works for many weeks without sun, and adding another processor, like Attiny, will difficult the programming and assembly of the project.

In the calibration of this sensor, I must measure the frequency generated. Because this I opened this topic.

But in really, one time calibrated, even with another hardware, I need only to use the same calibration value measured, and this can work for years without other recalibration.

I have one good oscilloscope, but my goal is share my project to others HAM made this too, and if the ESP8266 had the precision about 1% in time, this will be sufficient to permit the self-calibration.

Anyway, thanks a lot for your recommendations !

Paulo

Re: How to measure frequency ( 30-35 Khz ) ?

PostPosted: Tue Jan 03, 2017 10:07 am
by bugs
aphawk wrote:The problem is assure that I have one exact millisecond.

The command you have posted catch the milissecond, but not at its start. I can get the 1.0000 millicond, but I can get the 1.7456 millisecond too !

I need the exact time of 1 millisecond to make the calculation without error.


You could look at the Arduino library for their calibration method:-
https://github.com/pkourany/AS3935-Spark-Library/blob/master/AS3935/AS3935.cpp
This just counts your 35kHz input pulses for 100mS.

Re: How to measure frequency ( 30-35 Khz ) ?

PostPosted: Wed Jan 04, 2017 7:56 am
by bugs
Ignore that last about the Arduino library. I tried it in interpreted BASIC and the loop is too slow to read even 100Hz.
ATTiny looks the way to go... :(