Seeking Assistance on How to Implement Timers into This circuit:

Hi All,

I have run into an issue where I do not know how to implement a timer into the given circuit, I was seeking advice to see if I could do this through code or by implementing a component into this circuit to do so.

I have plans to replicate this circuit a number of times. Each one will act independently, activating the next one through the influx of light near its Photoresistor (LDR). This will hopefully create a continuous wave of light. As this will be used in a dark room I do not want the lights from the next one to light up and cause the one before it to light up, This is where I need the timer to come in. Once the Photoresister allows the power to travel onto the LED I need the LED to shut off after a second and stay off for a minimum of 5 seconds. This should give the wave of light enough time to get out of the reach of the first circuit, so on, so on.

I will be using my Arduino Mega 2560 to program each of the ATtiny85-PU20's if this helps.

Any assistance with this would be greatly appreciated.

Thanks,

Matt Hutchison

The blink without delay example has everything that you need. The photoresistor reading goes above a threshold at some point in time. There are things you want to do when that happens - turn the LED on AND note the time.

Periodically, you want to do things if the LED is on - check how long it has been on. If it is on, and has been on long enough, turn if off and note the time.

Periodically, you want to do things if the LED is off - check how long it has been off. If it is off, and has been off long enough, read the LCD again, and the whole process starts over.

A state machine would make this easy. And, no timers are involved.