Filter 5v pulse from micro input
It would be straightforward to do it in the micro- say you have a counter that counts down to 0 at (say) 50Hz. Whenever a pulse edge is detected, you preset the counter to (say) 150. If the counter gets to zero, you stop decrementing. If the counter == 0, then the pulses can be considered to have stopped. 

You could do a similar thing in hardware by using a retriggerable monostable multibrator such as one half of a 74HC123. In the below timing diagram, note the retriggering from the falling edge of the /A input (far right part of the timing diagram showing \$t_{rr}\$). 

You'd want \$t_w\$ to be something like 3 seconds, so the timing components would work out to be something like 10uF and 300K (for the Toshiba part, might be different for other makers). 

In this case, the Q output will go low and the /Q output high if the pulses stop.