0% found this document useful (0 votes)
2 views

LED Blinking

The document outlines a project focused on blinking an LED using the ATmega32 microcontroller, detailing the components involved, including LEDs, capacitors, and a 7805 voltage regulator. It provides a schematic diagram and sample code for implementation, as well as various applications of LED blinking in systems. The conclusion emphasizes the educational value of this project in understanding embedded systems development.

Uploaded by

rudrenpatadia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

LED Blinking

The document outlines a project focused on blinking an LED using the ATmega32 microcontroller, detailing the components involved, including LEDs, capacitors, and a 7805 voltage regulator. It provides a schematic diagram and sample code for implementation, as well as various applications of LED blinking in systems. The conclusion emphasizes the educational value of this project in understanding embedded systems development.

Uploaded by

rudrenpatadia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Report

Microcontroller Lab
LED blinking using ATmega32

Project done by
1. 22EL002: Dhruv Gandhi
2. 22El004: Anirudh Chagli
3. 22EL006: Yash Bhoi
4. 22EL011: Rudren Patadia
5. 22EL012: Yash Pandey
6. 22EL045: Naveen Shah
Aim: Blinking LED lights using ATmega32

Components: LED’s, ATmega32, Capacitor, 7805 voltage


regulator

Description of Components
ATmega32: The high-performance, low-power Microchip 8-bit
AVR® RISC-based microcontroller combines 32 KB ISP flash
memory with read-while-write capabilities, 1 KB EEPROM, 2
KB SRAM, 54/69 general purpose I/O lines, 32 general
purpose working registers, a JTAG interface for boundary-scan
and on-chip debugging/programming, three flexible
timer/counters with compare modes, internal and external
interrupts, serial programmable USART, a universal serial
interface (USI) with start condition detector, an 8-channel 10-
bit A/D converter, programmable watchdog timer with
internal oscillator, SPI serial port, and five software selectable
power saving modes. The device operates between 1.8-5.5
volts.
LED
An LED, or Light Emitting Diode, is a semiconductor device
that emits light when an electric current passes through it.
LEDs are widely used in various applications due to their
efficiency, longevity, and versatility.
To prevent damage to the LED and ensure proper operation, a
current-limiting resistor is used in series with the LED. The
value of this resistor is calculated based on the supply
voltage, the forward voltage of the LED, and the desired
current using Ohm's Law.
Advantages of LEDs
Energy Efficiency, Long Lifespan, Durability, Compact Size, Fast
Switching.

Capacitor
Capacitors are passive electronic components that store
electrical energy in an electric field. They are widely used in
electronic circuits for various purposes, such as filtering,
bypassing, coupling, and energy storage.
Electrolytic capacitors are polarized capacitors, which means
they have a positive (anode) and a negative (cathode)
terminal. They typically have a much higher capacitance per
unit volume compared to other types of capacitors. They are
usually cylindrical and are often marked with the capacitance
value and the working voltage.
Ceramic capacitors are non-polarized capacitors, which
means they can be connected in any direction. They are
made from a ceramic material as the dielectric and metal
layers as the electrodes. They are usually small and come in
various shapes, such as disc, multilayer, and surface mount.

7805 Voltage regulator


The IC 7805 is a popular linear voltage regulator that provides
a fixed 5V output from a higher input voltage. It is part of the
78xx series of regulators, which offer various fixed output
voltages.
Key Features:
Output Voltage: 5V ± 2%
Maximum Output Current: 1A to 1.5A (with adequate heat sinking)
Input Voltage Range: 7V to 35V (typically requires at least 2V higher
than the output voltage)
Internal Thermal Overload Protection: Prevents the IC from
overheating.
Short-Circuit Protection: Limits the output current in case of a short
circuit.
Safe-Area Compensation: Ensures the IC operates safely within its
limits.
Schematic Diagram
Code

#include <avr/io.h>
#include <util/delay.h>

#define LED_PIN PB0

void delay_ms_custom(uint16_t ms) {


while(ms) {
_delay_ms(1);
ms--;
}
}

int main(void) {
// Set LED_PIN as an output
DDRB |= (1 << LED_PIN);

uint16_t delay_time = 100; // initial delay time


in milliseconds

while (1) {
// Turn LED on
PORTB |= (1 << LED_PIN);
delay_ms_custom(delay_time);
// Turn LED off
PORTB &= ~(1 << LED_PIN);
delay_ms_custom(delay_time);

// Increase delay by 100 ms


delay_time += 100;

// Reset delay time if it reaches 3000 ms


if (delay_time > 3000) {
delay_time = 100;
}
}

return 0;
}
Applications
• Status indication: LEDs can be used to indicate different
system states like power on, processing ongoing, or
error conditions.
• Simple user interaction: Blinking LEDs can be used to
create basic user interactions, like acknowledging
button presses or providing feedback during operations.
• Timing and pulse generation: The techniques used to
create delays for blinking can be adapted for precise
timing control in applications like motor control or signal
generation.
• PWM (Pulse Width Modulation): By rapidly turning the
LED on and off, you can control its perceived brightness.
This technique, called PWM, is used to control light
intensity in various applications like dimming LEDs or
driving motors.
• Data transmission: Blinking LEDs in a specific pattern
can be used to transmit data in a simple communication
system.

Conclusion
In conclusion, blinking an LED with an ATmega32
microcontroller may seem like a simple task, but it offers
significant advantages for those venturing into
embedded systems development. It serves as It
introduces essential concepts like I/O pin configuration,
program structure, and often, timers.

You might also like