Hello everyone!
I’m trying to use the teensy 3.2 with PaulStoffregen’s library (https://github.com/PaulStoffregen/FreqCount) to count the number of partial discharges.
Example signal (frequency not higher than 300 kHz):
The problem is, that the amplitude of the signal is very low (about 100-200 mV), so the Teensy doesn’t count it.
I want the teensy to count the signals in some kind of ‘intervals/periods’ (not longer than 0,02 s) in which counted will be only peaks with an amplitude more than the trigger (set on 100 mV for example). And if in this period the teensy find 1 or more peaks higher than a trigger level, it should mark is as a ‘positive’ and add one to the counted pulses.
It is possible to do it with this library?
I’m trying to use the teensy 3.2 with PaulStoffregen’s library (https://github.com/PaulStoffregen/FreqCount) to count the number of partial discharges.
Code:
#include <FreqCount.h>
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 9, d5 = 8, d6 = 7, d7 = 6;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
unsigned long count = 0;
unsigned long prior_count=0;
void setup() {
FreqCount.begin(100);
display.setBrightness(0x0F);
lcd.begin(16, 2);
lcd.print("PULSES:");
}
void loop() {
if (FreqCount.available()) {
count = count + FreqCount.read();
if (count != prior_count) {
Serial.println(count);
lcd.setCursor(0, 1);
lcd.print(count);
prior_count = count;
}
}
}
Example signal (frequency not higher than 300 kHz):
The problem is, that the amplitude of the signal is very low (about 100-200 mV), so the Teensy doesn’t count it.
I want the teensy to count the signals in some kind of ‘intervals/periods’ (not longer than 0,02 s) in which counted will be only peaks with an amplitude more than the trigger (set on 100 mV for example). And if in this period the teensy find 1 or more peaks higher than a trigger level, it should mark is as a ‘positive’ and add one to the counted pulses.
It is possible to do it with this library?