These are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time. Microcontrollers find many applications as embedded systems, they are also used in the Arduino line of open source board designs.

AVR microcontrollers are ease-of-use, low power consumption and a high level of integration, it 8-bit and 32-bit microcontrollers (MCUs). These devices offer a unique combination of performance, power efficiency and design flexibility. Optimized to reduce time to market, they are based on the industry’s most code-efficient architecture for C and assembly programming. No other microcontroller delivers more computing performance with better power efficiency. Industry-leading development tools and design support further help you get your design to market faster. Plus, once your products have launched, the large AVR family allows you to reuse your knowledge to improve and enhance your offerings, making it easy and cost-effective to expand into new markets.

, , , , ,

How to use Proteus for circuit design

Important: As Proteus does not bound us to connect power supply, XTAL,reset circuit,EA pin and other basic connections so we are ignoring them for sake of simplicity. The important things like Xtal frequency of micro controller can be set from properties of micro controller, as discussed below.

While in actual hardware form for you must follow basic circuit shown at very beginning of this post.
1) Open Proteus

proteus1

 

2) Click on “P to open up part list.
Locate AT89C51 IC as shown below:
proteus2

 

proteus3

 

3) Locate LEDs as shown below

proteus4

 

4) Make connections from 8051 to LEDs

proteus5

5)Locate GND terminal as shown below

proteus6
6) Connect all LEDs to GND
proteus7

7) Double click on 8051 IC to open up its properties window.

— Set the operating frequency i-e 12.0MHz
— Give controller the desired HEX file.
proteus8
8) Click on Play Button to start simulation
proteus9

CIRCUIT SHOULD START WORKING AS SHOWN BELOW

proteus10

,

Interfacing of Led using ATMEGA16

Overview

In this tutorial we will learn about following below things:-

  • What is Led?
  • How does it work?
  • Interfacing of Led using Atmega16 microcontroller
  • Connection of Led using Atmega16 microcontroller using Proteus Design
  • Programming in C language

Led has number of applications ,it form alpha numeric numbers on digital clocks & led display, transmit information from remote controls to device, light up digital watches & tell you when your appliances are turned on or not. Combined together, they can form images on a LED television screen or illuminate a traffic light. Led are most widely used means of taking output from devices. Led is very economical and easily available in electronics shops & market with variety of shape, size and colors according to requirements of user.

leds

Explanation

As we know that Led is stand for light emitting diode which emitted light only forward biased i,e. When we applied a voltage source across the terminals of led, means +ve terminal of source to anode of led & -ve to cathode then electron & holes recombine & reaches the higher energy state and higher energy state is unstable so that it release the energy in form of light (photons). This process is called electroluminescence.

Out of two terminals for Led, Longer one is anode & shorter one cathode as shown below.

led terminals

Logic to Glow Led

To glow a LED we give a logic one (+ve) to the anode and we put ground means logic zero (-ve) to the cathode. We thing should be noted that we need to connect one resistance between led & our microcontroller to prevent it from damage because as we know led operate at 2v & 10 mA but microcontroller output is 5v so place resistance for better life of led & damage proof.

LED LOGIC

Here for Interfacing of Led using Atmega16 we are using ATMEGA16 AVR Mega series microcontroller for controlling the led or we can say this to take an output. It is Advance Harvard Architecture and is a 8-bit microcontroller with 16K Flash memory and 512 Bytes of EEPROM, 1K SRAM and uses 1 MHz Crystal Oscillator for clock generation, which provides a 1MIPS and it has in build 1-16MHz oscillator and which can provide speed up to 16MIPS.

atmega16

It has 32 input/output port out of 40 pin architecture, CPU, and peripheral in a single chip. Reason for using an AVR microcontroller is that it uses low power, and is application specific, and AVR stands for advance virtual RISC (Reduced Instruction Set Computer) machine.

AVR uses pipelining concept for data, address fetching as well as execution. The Atmega16 is based on CMOS technology for low heat dissipation

Circuit Design

Proteus Design of interfacing of led using Atmega16.

We have connected LED with pin PD0 and we will get the blinking of LED because we have given the logic 1 to the pin PD0. After 1 second LED turns off because we have given logic 0 to the pin PD0 after the delay function as one can see in the programming portion.

Led circuit Design

C Code

C Programming of interfacing of Led using Atmega16

********************************************************************************
http://www.embeddinator.com/

This program is developed by EMBEDDINATOR DEVELOPERS.
********************************************************************************

#include<avr/io.h>               // header file for avr input-output operations

#include<util/delay.h>        // header file for the delay function

void main()                           // program main body

{

DDRD= 0b11111111;          // enable port D as output port

while(1)                               // infinite loop

{

PORTD= 0b00000001;            // passing pin PD0 as logic 1 to glow LED

_delay_ms(1000);                    // delay of 1000 ms.(i.e. 1 second)

PORTD= 0b00000000;       // passing pin PD0 as logic 0 now to off LED

_delay_ms(1000);                // again passing delay of 1 second

}      }

*******************************************************************************
End program

Thank you for visiting our website

http://www.embeddinator.com/
*******************************************************************************

 

, , , , ,

LED

Overview

This tutorial gives you an explanation of following things:-

  1. What is LED & what does it’s means?
  2. Operation & Principle.
  3. Modes  & Testing.
  4. Logic to operate of LED with microcontrollers.

leds

Explanation

Light Emitting Diode, mainly called LED, It is real hero & very basic first component in the electronics & electrical world due to its lots of different jobs and are found in all kinds of devices.Among other things, they form alpha numeric numbers on digital clocks & led display, transmit information from remote controls to device, light up digital watches & tell you when your appliances are turned on or not. Combined together, they can form images on a LED television screen or illuminate a traffic light. Led are most widely used means of taking output from devices. They find wide range application as indicators while experimenting to check the validation of results at different stages. Led is very economical and easily available in electronics shops & market with variety of shape, size and colors according to requirements of user.

Principle & Operation

LED worked on Electroluminescence Principle, A LED is a p-n junction semiconductor device which emits incoherent light when biased in forward direction(the positive terminal is to be connected to the anode & negative terminal of supply is to be connected to cathode of Led). Most of the LEDs are realized using a highly doped n and a p Junction. It has two regions one is p-region and another is n-region, this two combine and make a junction. The p region is have more +ve electric charges as compare to n-region and the n region is have more -ve electric charges as compare to p-region.

Operation of Led is very simple to understand, Basically Two type of Basing in Led:-

  1.  Forward Biasing
  2. Reverse Biasing

Forward Biasing

In this mode, the positive terminal (+ve) of the cell or battery is connected to the anode of the LED & the negative terminal (-ve) is connected to the cathode terminal of the LED.

                               FORWARD BAISING OF LED

When a forward voltage +ve terminal of voltage is connected with +ve (anode) terminal of led and –ve terminal of voltage is connected with -ve (cathode) terminal of led is applied to an LED, the potential barrier of the P-N junction become smaller, then causing electron & holes recombine & reaches the higher energy state and higher energy state is unstable so that it release the energy in form of light (photons).

In short When we applied a voltage source across the terminals of led, means +ve terminal of source to anode of led & -ve to cathode then electron & holes recombine & reaches the higher energy state and higher energy state is unstable so that it release the energy in form of light (photons). This process is called electroluminescence & color of light depends on the gap between the semiconductor materials, as shown below

led circuitled circuit 1

Reverse Biasing

                               REVERSE BAISED OF LED

If LED is reverse biased, then the electrons of n-type region are pulled towards the terminal. Similarly the holes of the p-type region are pulled towards the terminal. This causes the widening of the depletion region in the p-n semiconductor. The widening of the depletion region increases the resistance of the diode so that it works as an open circuit when reverse biased.The reverse current flows due to the minority charge carriers (very few) in the semiconductors after the breakdown. The reason for the breakdown is the electric field inside the diode created by the depletion.

Testing & Determination of Led Terminals

As you can see below image of Led in which symbol & physical view is there. Now if we talk about the Led symbol on left side of picture there will be one line or plate which act as a cathode & other side is anode. Right side of image of led it has 2 legs, major one is anode & shorter one is cathode of led.

led termianls

There is another way to find cathode & anode of led by using front & top view of led as shown below. As in front view you will find two plates one thick & other is thin, so thick one cathode & thin one is anode of led.

led view

In top view of led you will find a D shape in which straight line is anode & curve shape is cathode.

One more approach to find out the terminals of led by looking the outer lower area of led, you will found there will be a cut surface in lower circle area of led, that cut area beside leg is always a cathode. Apart from this method we need volt meter & led tester for testing of led

LED CloseUp

Led Interfacing with Microcontrollers

Most of the commonly available LEDs have dropped a voltage of 1.3 V to 2.2 V and require 7 to 10 mA to glow Led at full intensity. The following picture describes “how to glow a led”.

led with cell

But we know that our most of microcontrollers give an output of 3 to 5V & 60mA corresponding to pins. If we connect Led directly to any of ports pins as shown below picture then direct 3v to 5v of the port is applied to an LED, so that LED may get damaged.

led when demage

If we connect the led as above, led will glow for very small time with high brightness and burn out. Because large current will be sink via LED from source due to high voltage. Sometimes this large current may damage our microcontrollers Port and then IC.

To limit the current allowed into LED we need to divide the voltage by adding a resistor to the circuit by finding the value of resistor according to ohm’s law.

R=(Vcontroller – Vled)/I

If we want to allow 10mA current through the LED then resistor value will be as below:-

R = (Vcc-led voltage)/current.

R = (5-1.7)/10mA.

R= 330 Ohms.

Resistor values will vary 220 ohm to 470 ohm according to value of Led voltage.

led with resistance

 

In above picture, we connected a 330 ohms resistor to allow 10mA current through the LED for its glow. If we reduce the value of led then will be glow brighter than previously.

Logic to Glow the LED from Microcontrollers.

As we already explained that led will work on forward biasing means +ve to anode & -ve to cathode of led, similar way in digital electronics +5V means HIGH or Logic 1(one) & -Ve means LOW or Logic 0(zero).

LED LOGIC

So its means when Logic 1 or HIGH applied across to anode & LOW or Logic 0 to cathode then Led will Glow.

Configuration of connection of led with Microcontrollers

Led operate in two configuration, because of this reason if we connect the both terminals of led to microcontroller then it consume more pin of IC & programming values also become complex in both configuration only half of pin used as compared to normal configuration & only differance in both configuration is logic .

  1. Common Cathode or Logic 1
  2. Common Anode or Logic 0

Common Cathode

Led have two terminal one +ve and second -ve.

In common cathode all the –ve terminal externally connected with Ground. And all + ve terminal connected with microcontroller.

cc config

Common Anode

Led have two terminal one +ve and  second  -ve.

In common Anode all the +ve terminal externally connected with vcc (Power Supply). And all – ve terminal connected with microcontroller.

ca config