This project demonstrates how to use Timer1 Overflow Interrupt in Arduino UNO to toggle an LED using accurate timer-based logic. The preloader value can be changed using push buttons, and the current value is displayed on a 16x2 LCD display. It replaces the traditional delay()
method with precise hardware-timer control.
- Timer1 overflow-based LED toggle using ISR
- Non-blocking timer logic (no
delay()
) - Preloader adjustment via push buttons
- Real-time preloader value shown on LCD
- Demonstrates register-level control in Arduino
Component | Description |
---|---|
Arduino UNO | Main microcontroller board |
16x2 LCD Display | To show preloader value |
LED | Indicator output on pin 7 |
Push Buttons (2) | Increment/decrement timer preload |
10k Resistors (2) | Pull-down resistors for buttons |
2.2k Resistor | For LED current limiting |
Potentiometer | Contrast control for LCD |
Jumper Wires | Connections |
Breadboard | Prototyping |
- 8-bit timer
- Used by functions like
delay()
,millis()
- 16-bit timer
- Used in this project for interrupt-based control
- 8-bit timer
- Used in
tone()
function and PWM applications
LCD Pin | Arduino UNO Pin |
---|---|
VSS | GND |
VDD | +5V |
V0 | Potentiometer middle pin |
RS | Pin 8 |
RW | GND |
E | Pin 9 |
D4 | Pin 10 |
D5 | Pin 11 |
D6 | Pin 12 |
D7 | Pin 13 |
A (LED+) | +5V |
K (LED-) | GND |
Other Connections:
- Push Button 1 → Pin 2 (with 10k pull-down)
- Push Button 2 → Pin 4 (with 10k pull-down)
- LED Anode → Pin 7 (via 2.2k resistor)
Issue | Cause / Solution |
---|---|
LED not blinking | Check Timer1 ISR and preloader logic |
LCD not displaying | Check wiring, contrast pot, and lcd.begin() |
Push buttons unresponsive | Confirm pull-down resistors and pinMode settings |
Interrupts not triggering | Ensure TIMSK1 and interrupts() are set |
- Timer-based LED blinking without delay()
- Time-controlled device switching
- Real-time system clocks
- Multitasking systems
- Accurate PWM-based systems
- Add buzzer or relay for timed alarms
- EEPROM save/restore of last preloader value
- Serial interface for real-time control
- Debounce filtering on buttons
- Add support for Timer0/Timer2 configurations
Parameter | Value |
---|---|
Microcontroller | Arduino UNO (ATmega328P) |
Timer Used | Timer1 (16-bit) |
Timer Mode | Overflow Interrupt |
Prescaler | 1024 |
Preloader Value | Adjustable (default: 3035) |
Output | LED on pin 7 |
Input | Buttons on pin 2 and pin 4 |
Display | 16x2 LCD (Pins 8–13) |
If you found this helpful, please ⭐ star this repository and share it with others!
Built with ⏱️ by Circuit Digest
Making Electronics Simple
arduino timer project
timer1 overflow interrupt
arduino uno led blink
lcd timer counter
register level programming
arduino push button control
embedded c++ arduino
precise delay without delay()
timer interrupt tutorial
arduino real-time timer
hardware timer programming
arduino timer example