Does ADC in + PWM out = trouble?

You could try the appended circuit - use eg a 74HC14 as the schmidt trigger.

You'll get a random load of transitions. Feed them into a digital input used to counts pulses, time for a while, then take mod 255 of that count - which will be huge.

regards

Allan

pretty punk, eh?

edit.. not sure that ERNIE didn't use a similar technique....
-and with this spproach the amplitude of the signal doesn't matter much, so long as it's well above the hysteresis of the schmidt...

-and the digital inputs of the arduino can count at up to 8MHz, so you should get big numbers fast.

random.pdf (18 KB)