Uno R3 Test Box

You have no current limiting resistor on the base of Q1. Perhaps you meant to use R3 but it's in the wrong place.

Your LEDs are wired backwards.

It's a bad idea to operate the relay from the Arduino 5V supply and there is no freewheeling diode for back EMF.

For code look at the "digital" examples that ship with the IDE. You can find them in the "examples" tab.

Technically, you don't need a state machine to implement this, it would just make it more responsive - for example if you want to interrupt a test in the middle, with a button press. With straightforward sequential timing, once you start a timed operation, nothing else can happen.

Also, in your diagram you have a timing chart. But the input signal is exactly the same as the output signal. Why not just use a wire? :slight_smile: Ha, I know you don't mean that. But the timing diagram is too far simplified to be useful.