How would you detect the day night cycle in a wireless sensor node that runs from an RC oscillator? I'm not good at signal analysis. The method I'm considering is: 1. maintain an average of light level over three days, 2. maintain an average of light level over past hour, 3. record the level of the darkest and lightest hour in the past day, 4. detect sunrise as first hour that is brighter than the three day average, and brighter than the previous hour, 5. average the sunrise time over several days, Sensor will be analog; photocell, photodiode, or capacitance of reverse LED. The deployment is local; latitude 31 degrees south, so there's no need to design for very short days or nights. There is risk of short pulses of bright light; lightning, vehicles, torches. I've no plans for a nearby supernova. --=20 James Cameron http://quozl.linux.org.au/ --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .