This project for Arduino 2-Step Programmable Timer Circuit with Independent Output Delay Adjustment uses Arduino microcontroller to make simple timer.
Not like normal timer with two outputs as this one uses only one output and it also switch between two states and each state have delay which we can change for different use.
Arduino Code:
#include <Arduino.h>
// Define pins
const int outputPin = 9;
const int relayDriverPin = 3; // Adjust for your relay driver
// Define delay values (in milliseconds)
unsigned long delayTime1 = 5000;
unsigned long delayTime2 = 3000;
// Variables to track timer states
unsigned long previousMillis = 0;
int outputState = LOW;
void setup() {
pinMode(outputPin, OUTPUT);
pinMode(relayDriverPin, OUTPUT);
// Initialize relay driver (if necessary)
// ...
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= delayTime1 + delayTime2) {
previousMillis = currentMillis;
outputState = !outputState;
}
digitalWrite(outputPin, outputState);
digitalWrite(relayDriverPin, outputState); // Control relay if used
}
Circuit Working:

Parts List:
| Components | Quantity |
|---|---|
| Resistor | |
| 10k 1/4 watt | 1 |
| Semiconductors | |
| Arduino Uno Board | 1 |
| IC 7809 | 1 |
| Transistor BC547 | 1 |
| SPDT 12V Relay | 1 |
| Diode 1N4007 | 1 |
| Connector to Arduino | 1 |
How It Work with 2 Step Timer:
The circuit uses one output pin and one timer to create two steps, it switches the output between HIGH and LOW states.
One full cycle time = delayTime1 + delayTime2.
How to Set Time for Each Step:
Use previousMillis1 and previousMillis2 to track time and then Arduino check time for each delay.
After delayTime1 then output goes HIGH and after delayTime2 then output goes LOW again.
How to Make Relay Driver with Transistor and Arduino:
- First, gather all the parts as shown in circuit diagram
- Then Arduino pin 3 connect to transistor base with 10k resistor, transistor collector connect to one relay coil pin and emitter goes to GND.
- Also other coil pin goes to +12V and relay common pin connect to load.
- After that, choose NC or NO relay contact to turn load ON or OFF and add 1N4007 diode across relay coil pins.
- Finally, use IC 7809 to give stable 9V to Arduino board.
Conclusion
Overall, this Arduino 2-Step Programmable Timer Circuit with Independent Output Delay Adjustment gives easy and flexible way to make 2-step timer using one output.
Also, we can change delay time to set ON and OFF time as needed and relay driver help to control big power load with same circuit.