I use espeasy on a esp32board to count pulse coming from a power meter)
The signal (red line) on the GPIO is:
and i get from 1 to 20 pulse every 10s
with the mode set as "falling" it works and seems to count correctly
but with the mode set to "PULSE low" the counting is erratic and much lower
I have tried with different Debounce Time without success.
It did read the doc about that and it seems it should work.
Any idea?
my devices with 3 pulse input
Build: ESP_Easy_mega_20220809_normal_ESP32_4M316k Aug 9 202 (but is the same with all release for many months)
P003 Pulse problem
Moderators: grovkillen, Stuntteam, TD-er
Re: P003 Pulse problem
What is the blue signal?
Is that also being fed to the ESP?
I assume the red scale on the right reflects the voltage of the red signal?
With such a clean signal, I don't think you should be using any debounce filter as it probably will hurt more than it may fix.
I have to check the code (later, maybe this evening) to see if it should work like this.
Can you explain what you expect on the output?
And what is it you're seeing which is erratic?
Is that also being fed to the ESP?
I assume the red scale on the right reflects the voltage of the red signal?
With such a clean signal, I don't think you should be using any debounce filter as it probably will hurt more than it may fix.
I have to check the code (later, maybe this evening) to see if it should work like this.
Can you explain what you expect on the output?
And what is it you're seeing which is erratic?
-
- New user
- Posts: 4
- Joined: 11 Aug 2022, 15:58
Re: P003 Pulse problem
Blue signal is input from my photo-diode, so is not relevant here.
Yes, the red scale is the for the red signal.
So what to put in "Debounce Time" to disable the debounce filter ? put in 0?
If I use the falling mode it seems that the count is correct.
But if I use PULSE Low or PULSE High, I miss many pulse and I did expect to see the same count that for falling. But I got ~half, 1/3 or 0 count comparing to count in falling mode
ex: in falling mode I get 2,3,4,3 count in 4*10s and in Pulse mode i get 0,1,0,2 count in 4*10s
Seems strange to me.
I tried to display some debug informations but didn't understand most of them. But I can send them if you need it.
Regards.
Yes, the red scale is the for the red signal.
So what to put in "Debounce Time" to disable the debounce filter ? put in 0?
If I use the falling mode it seems that the count is correct.
But if I use PULSE Low or PULSE High, I miss many pulse and I did expect to see the same count that for falling. But I got ~half, 1/3 or 0 count comparing to count in falling mode
ex: in falling mode I get 2,3,4,3 count in 4*10s and in Pulse mode i get 0,1,0,2 count in 4*10s
Seems strange to me.
I tried to display some debug informations but didn't understand most of them. But I can send them if you need it.
Regards.
Re: P003 Pulse problem
Hmm, perhaps the pulse-width is too small for properly detecting both edges?
But why do you need both edges? Is the duration of the pulse of any significance?
But why do you need both edges? Is the duration of the pulse of any significance?
-
- New user
- Posts: 4
- Joined: 11 Aug 2022, 15:58
Re: P003 Pulse problem
I want only count the number of pulseHmm, perhaps the pulse-width is too small for properly detecting both edges?
I need only one edge, but I tried with "pulse low" and in a second test with "pulse high" without success.But why do you need both edges? Is the duration of the pulse of any significance?
The duration has no signification and is ~9ms.
Re: P003 Pulse problem
Well then for your use case it is good enough to count either the rising or the falling edges.
Counting a full pulse does involve quite a lot more computational effort in the ESP and double the amount of interrupt calls which may affect other tasks running in ESPEasy.
Counting a full pulse does involve quite a lot more computational effort in the ESP and double the amount of interrupt calls which may affect other tasks running in ESPEasy.
-
- New user
- Posts: 4
- Joined: 11 Aug 2022, 15:58
Re: P003 Pulse problem
Thanks for the explanation
Who is online
Users browsing this forum: No registered users and 115 guests