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

Microcontroller Lab

This document describes an experiment using an AVR microcontroller to control an LED. It outlines the hardware setup by connecting an LED and resistor to an output pin of the microcontroller in a Proteus simulation. The microcontroller is programmed to toggle the LED on and off, and the simulation is run to observe the blinking LED and confirm the successful control of external components using the microcontroller.

Uploaded by

pial hasan Borno
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Microcontroller Lab

This document describes an experiment using an AVR microcontroller to control an LED. It outlines the hardware setup by connecting an LED and resistor to an output pin of the microcontroller in a Proteus simulation. The microcontroller is programmed to toggle the LED on and off, and the simulation is run to observe the blinking LED and confirm the successful control of external components using the microcontroller.

Uploaded by

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

Experiment No: 2

Experiment Name: Turning on an LED using AVR Microcontroller.


Title: LED Control using AVR Microcontroller and Proteus Simulation

Abstract:
This lab report presents the process of controlling an LED using an AVR
microcontroller and Proteus simulation. The report provides a step-by-step
explanation of the hardware setup, programming the microcontroller, and running
the simulation in Proteus. The objective of the experiment is to demonstrate the
basic functionality of an AVR microcontroller in controlling an external LED.

1. Introduction:
The AVR microcontroller is a popular and versatile microcontroller widely used in
embedded systems. It offers a wide range of features and is suitable for various
applications. In this lab, we focus on controlling an LED using an AVR
microcontroller. The Proteus simulation software allows us to design and test the
circuit without physical hardware.

2. Materials and Equipment:


- AVR microcontroller (e.g., Atmel ATmega32)
- LED (Light Emitting Diode)
- Proteus simulation software

3. Methodology:
3.1 Circuit Design:
1. Launch Proteus software and create a new project.
2. Select the desired AVR microcontroller (e.g., Atmel ATmega328P) from the
component library.
3. Place the microcontroller on the schematic editor.
4. Add an LED and a current-limiting resistor to the circuit.
5. Connect the anode of the LED to one of the microcontroller's output pins.
6. Connect the cathode of the LED to the ground through the current-limiting
resistor.
7. Connect VCC and GND pins of the microcontroller appropriately.
8. Connect the necessary power supply and ground connections.
9. Ensure all connections are made correctly and check for any errors.
3.2 Programming the Microcontroller:
1. Open Atmel Studio or any other suitable Integrated Development Environment
(IDE).
2. Create a new project for AVR microcontroller.
3. Write a program to control the LED.
4. Define the output pin for the LED.
5. Set the pin as an output in the microcontroller's configuration.
6. Implement a loop to toggle the LED state (ON) and run the loop forever.

3.3 Proteus Simulation:


1. Save the program and build it to generate the hex file.
2. Import the hex file into the Proteus project.
3. Double-click the microcontroller in the schematic editor to open its properties.
4. Select the hex file in the Program File option.
5. Run the simulation and observe the LED behavior.

Sample Code:

4. Results and Discussion:


Upon running the Proteus simulation, the LED should blink green light forever.

Simulation Output:
5. Conclusion:
The experiment demonstrated the successful control of an LED using an AVR
microcontroller and Proteus simulation. The simulation allows for testing and
debugging the circuit before implementing it on physical hardware. This lab serves
as a foundation for more complex projects involving AVR microcontrollers and
their applications in various domains.

6. References:
- AVR Microcontroller Datasheets (e.g., Atmel ATmega32)
- Proteus Simulation Software Documentation

You might also like