[go: up one dir, main page]

0% found this document useful (0 votes)
10 views3 pages

ATmega32 AVR LED Project Report

This project showcases LED sequencing using the ATmega32 AVR microcontroller, where eight LEDs are controlled in two groups with a delay. The implementation involves configuring digital pins and using a loop structure to toggle the LEDs on and off. Results confirm successful operation, with potential future enhancements suggested for dynamic control and user interaction.

Uploaded by

Diaa Abossrie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

ATmega32 AVR LED Project Report

This project showcases LED sequencing using the ATmega32 AVR microcontroller, where eight LEDs are controlled in two groups with a delay. The implementation involves configuring digital pins and using a loop structure to toggle the LEDs on and off. Results confirm successful operation, with potential future enhancements suggested for dynamic control and user interaction.

Uploaded by

Diaa Abossrie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Arduino Uno Port Control for LED Sequencing

Name: Diaa Ahmed Hussien ID: 202006112

Abstract

This project demonstrates a simple LED sequencing task using the ATmega32 AVR
microcontroller. Eight LEDs are connected to digital pins, and the program sequentially
turns the first four LEDs ON, then OFF after a delay, followed by the next four LEDs. The
process repeats in a loop, showcasing the ATmega32 AVR's capability to control external
hardware via digital pins.

Introduction

The ATmega32 AVR is an 8-bit microcontroller board based on the ATmega32. It


offers 32 I/O pins, making it suitable for various embedded applications. This project uses 8
of these pins to control LEDs, divided into two groups. The program ensures that LEDs in
one group light up while the others remain off, switching states after a delay.

Materials and Tools

Hardware:

- ATmega32 AVR microcontroller


- 8 LEDs
- Resistors (220 Ω for each LED)
- Breadboard
- Connecting wires
- Power supply (5V)

Software:

- Arduino IDE
- Serial Monitor (optional for debugging)

Methodology

1. Pin Initialization: Configure 8 digital pins as outputs.

2. LED Control Logic: Use a simple loop structure to toggle groups of LEDs. Create delays
using the `delay()` function in Arduino..
Arduino Uno Port Control for LED Sequencing
Name: Diaa Ahmed Hussien ID: 202006112

Code Implementation

#define LED_DELAY 500 // Delay in milliseconds

void setup() {

// Configure pins 2 to 9 as outputs

for (int pin = 2; pin <= 9; pin++) {

pinMode(pin, OUTPUT);

void loop() {

// Turn ON LEDs 1-4 (pins 2-5)

for (int pin = 2; pin <= 5; pin++) {

digitalWrite(pin, HIGH);

for (int pin = 6; pin <= 9; pin++) {

digitalWrite(pin, LOW);

delay(LED_DELAY);

// Turn OFF LEDs 1-4 and ON LEDs 5-8 (pins 6-9)

for (int pin = 2; pin <= 5; pin++) {

digitalWrite(pin, LOW);

for (int pin = 6; pin <= 9; pin++) {

digitalWrite(pin, HIGH);

}
Arduino Uno Port Control for LED Sequencing
Name: Diaa Ahmed Hussien ID: 202006112
delay(LED_DELAY);

Testing and Results

Testing Procedure:

Testing Procedure:

1. Connect the LEDs to digital pins 2-9 via resistors.

2. Power the circuit using the Arduino and upload the program.

3. Observe the LEDs toggling in groups with the specified delay.

Results:

- The first four LEDs turn ON, then OFF after the delay.
- The next four LEDs turn ON, then OFF, creating a continuous sequence.
- The program operates as expected, demonstrating reliable port control.

Conclusion

This project successfully demonstrates the use of an ATmega32 AVR to control


external LEDs via digital pin manipulation. The implementation highlights the Arduino's
ability to manage multiple I/O operations efficiently. Future enhancements could include
varying the delay dynamically, adding user input, or implementing patterns using
interrupts.

You might also like