Dear all,
I am using a Tiny85 to measure a "simple" high/low Situation on one of ist Input (see attached handwritten schematic).
After failing to do so with using Interrupts on rising/falling edges I realized that the Input Signal is a square wave with 200Hz frequency and 50% Duty cycle.
The Signal shall be measured as high when the Amplitude is 9.4V and low when the Amplitude is close to 0V.
Due to the square wave the Interrupt was triggered 200 times per second ,-)
Then I used a low pass filter which worked fine in Terms of clear enough high/low-input for the Interrupt. But the Feedback from the capacitor induced unwanted effects into the inputting signal-circuit.
So I used a Diode to not Feedback into the sourcing circuit but with the effect that the capacitor needed to unload via the Tiny85 which takes too Long.
Finally I ended up with using the ADC. The ADC is measuring 10 times (roughly two square wave periods) and then Building a mean value of that. The mean values are compared and I have my high/low-categorization.
It works and it could be fine. But Maybe there are better Solutions...
The Question is: are there smarter ways? Anything where the ADC does not Need to work all the time? The low-situation will appear only quite seldomly every few Hours but Needs to be detected within maximum 500ms.