Detecting if a pulse is present

Hi all,

I hope this is the right forum. I need a way to monitor some serial data. I'm trying to monitor if a fog machine is still warming up. The signal starts at high logic for about 1ms and then drops to low. Then during the next approximately 1ms there is three short pulses and then one more short one if it's still warming up. Then it starts all over again.

The only difference is that pulse, so ideally I guess I just need a way to count the pulses. I know I've probably got to use interrupts but otherwise I'm pretty clueless of where to go from here.

Here is the picture of the scope the circled pulse is the one I'm try to detect. When that pulse is not present the rest of the signal is still identical.

Thanks in advance!

Maybe you cn use the pulseIn() function?

THat spike immediately after the signal goes low could be awkward. Is that actually a pulse, or just noise? Is it consistent?

PeterH: THat spike immediately after the signal goes low could be awkward. Is that actually a pulse, or just noise? Is it consistent?

Hi, I'm not sure if that is noise or signal but at least it's consistent so hopefully I won't run into an issue with it.

Anyone with specific examples on how I might do this?

I would feed that signal to an interrupt pin, attach an interrupt using mode CHANGE, record the times of the most recent rising and falling edges in the ISR, and design a state machine to track the recognition of the signal.

cjonesyyc: Hi, I'm not sure if that is noise or signal but at least it's consistent so hopefully I won't run into an issue with it.

Well, it's really short and makes me worry that whatever solution you adopt may not pick it up consistently. Maybe it will be OK, but if you run into problems with the pulse count being picked up inconsistently that's where I'd look.