A simple stopwatch implemented using an ATMega 328P and a 4×20 HD44780 LC display.
It is meant to autonomously measure the battery life of flashlights. It measures time as long as an input signal is present and stops when its not.
Input is done via a photo-resistor connected to pin C3, pulling the pin low as long as there is light shining on the sensor. The time in low state is measured and continuously printed on the screen, together with the current light level in range 0-255.
Reset the time to zero via pulling pin B1 low , e.g. via a push button. Or via reboot.
The timer runs as long as the input signal is below a threshold. It pauses measurement when the value rises above the threshold and continues to count when it falls again. This allows pausing the measurement.
Usage
Place it somewhere dark and supply Vcc. Put the photo-resistor in front of the flashlight, and turn it on. It should start measuring time. Leave it until the light turns off, and read the on-time on the display.