Interfacing to circuit which grounds the input

I set it up the first way, that is to continuously count the number of times the pin is high out of a fixed number (3000). This appeared to work really good and smooth out any problems!

It works better than pulseIn, as the time interval is dependant on knowing the timebase, whereas merely counting the number of times in a fixed number gives you a good percentage.
Thanks heaps for that tip - worked really well.