Pages

Subscribe:
Showing posts with label schematic diagram. Show all posts
Showing posts with label schematic diagram. Show all posts

Friday, 22 July 2011

Chasing LED's Using Microcontroller 89C52/89S52



This mini-project is especially meant for a newbie in Embedded Systems. This project will give you a clear idea of how to think and implement your code in practical life. In this article, we will cover the programming details for LED blinking and how you can code your microcontroller to show different patterns of LED blinking. After learning the logic for LED blinking you can code any microcontroller with the same logic.


Components

  • 1 microcontroller 89C52(89S52 will also do)
  • 1 potentiometer-10k
  • 2 ceramic capacitors-22pF
  • 1 switch(button for reset purpose)
  • 1 electrolytic capacitor-10uF,25V
  • 1 crystal oscillator-11.0592MHz
  • 1 resistor-10k
  • 8 LED's
  • 8 330 ohm resistor
  • 2 switches (SPST) 

 Schematic Diagram


 










Softwares Used: 

This project is made with the help of Proteus software. If you are unaware of the software you can learn the basics by watching the video tutorial that I recommended in one of my articles.


The connection of the circuit is explained below:

  • Port 1 of the microcontroller is used as the input Port
  • Port 2 of the microcontroller is used as the output Port
  • The LED's are connected to the output of Port 2
  • Two switches are connected to the input of Port 1
    one switch is connected to the 5th pin of the Port 1 whereas the other switch is connected to the 8th pin of the Port 1
  • Other components like the crystal and switch are used for the working of the microcontroller


Working:

The programming is done using Keil compiler. The circuit is configured for two modes namely (1) The LED Blinking mode and the (2) Chasing LEd mode.when the switch connected to the 8th pin of the Port 1 is closed , the microcontroller works in the Blinking mode wherein all the LED's glow simultaneously for one second and remain switched off for the other one second and this process continues as long as the microcontroller is receiving the power supply .The blinking LED's are shown below:


 

When the switch connected to the 5th pin of the micro controller is closed and the switch connected to the 8th pin is open, the micro controller works in the Chasing LED mode i.e. the LED's glow one after the another for a second and looks something like this:


Programming:

The detail explanation of the coding is done below



#include <REGX52.H>
# include"delay.h" /* header file of the delay is added */
void main()
{ P1=0xFF; /*Port 1 is defined as input*/
P2=0x00; /* Port 2 is defined as output*/
while(1)
{/* code for the chasing LED's */
if(P1_4==0)/* if switch connected to P1_4 is closed*/
{ P2=0X01; /*glow the LED connected to P2_0 for 1 sec*/
delay_sec(1);
P2=0x02; /*glow the LED connected to P2_1 for 1 sec*/
delay_sec(1);
P2=0x04;
delay_sec(1);
P2=0x08;
delay_sec(1);
P2=0x10;
delay_sec(1);
P2=0x20;
delay_sec(1);
P2=0x40;
delay_sec(1);
P2=0x80;
delay_sec(1);/* code for chasing LED's complete*/
}/* codes for chasing LED's */
if(P1_7==0) /* if switch connected to P1_7 is closed*/
{ P2=0xFF; /*glow all the LED's connected to port P2 for 1 sec*/
delay_sec(1);
P2=0x00; /*switch off all the LED's connected to port P2 for 1 sec*/
delay_sec(1);
}
}
}












































Some things that you can try      

You can play around with the code to get your own LED pattern. Try using P2=0xAA, then provide a delay of 1 second and put the value of P2 as P2=0X55 and again provide a delay of 1 second. Similarly you can try other patterns and have fun. This way you will be able to develop your skill in programming.

Download files     

Please comment if you further want to improve the project or if you have doubts in the above code.



Thursday, 21 July 2011

EAGLE Tutorial

In my last article I provided a short description of Proteus software. In this article I will talk about eagle software.Towards the end I have also provided EAGLE tutorial for the beginners.

While Proteus software is used for both schematic as well as PCB designing, EAGLE is solely used for PCB designing. If you want to be more precise with your PCB then you should go for EAGLE software.With EAGLE you can make your complex PCB designs and is auto-router tool makes it more flexible to use.

Unlike Proteus, this is not a simulation software. You can simulate your electronic design with this software.But you can make your schematic design with the help of EAGLE.

EAGLE comes in both FREE as well as PAID version.If you are a student then FREE version can work for you and you can use it to get yourself familiarized with the PCB designing.
I have provided the link below to download the FREE version.
Please click here to download the FREE version of EAGLE software

Below I have provided the Tutorials for using EAGLE software.
Please Note:The tutorials provided below have been taken from You tube. All credits to RPC Electronics.


Tutorial 1
This tutorial deals with fundamentals of using EAGLE software.Here, you will learn about how to create a new project and work with schematic



Tutorial 2
In this tutorial you will learn more about schematic designing like naming your devise and configuring settings.




Tutorial 3
This tutorial will show you an example of a working circuit along with some pitfalls that you should avoid.


Tutorial 4
This is the continuation of the above tutorial.Here you will learn complete the basic schematic and make some required changes.Along with this you will also about some new tips and tricks that can prove useful to you while you work with EAGLE software.


Tutorial 5
The schematic making will be completed in this tutorial and start with the PCB making



Tutorial 6
Tutorial 7


Tutorial 8




Tutorial 9
Tutorial 10
I have added here most of the tutorials in one place itself which can get you started.Again, thanks to RPC electronics for its wonderful contribution.





















Proteus Tutorial














Proteus is a simulation software which is very essential for every electronics engineers and students as well.You might be reading this page because you searched for a Proteus tutorial,design a project with Proteus software or wanted to know more about Proteus software.Well, you have come to the right place and if you keep reading you will know everything about it along with the video tutorials


Engineering students especially electronics engineers will find this software very useful for academic purpose.
In colleges, it is  practically impossible for every engineering student to get used to with hardware's like CRO(Cathode Ray Oscilloscope), function generator and most importantly breadboard .In colleges, in electronics labs mostly students are required to form groups and work on a single breadboard.But with this kind of situation, not all the students in the group are able to grasp about the hardware and hence end up with incomplete knowledge of circuitry also.So, whenever a project work is assigned to them they may end up burning a device or wrong circuitry.To avoid this,one can make use of a simulation software like Proteus .

You can download the demo version of Proteus software from here.Please keep reading to get started with Proteus software.

Proteus software provides an interactive platform to simulate devices ranging from small transistor to microcontrollers and even serial port communication.
Now, since you know what the software does lets get started with the tutorial

The below provided tutorial is taken from Youtube 

Tutorial 1
This tutorial will guide you with the basics of using the software and how to make schematic diagrams in Proteus.

Tutorial 2
This tutorial is the continuation of tutorial 1.In this tutorial you will learn more about schematic making in Proteus and begin with PCB designing


Tutorial 3
In this tutorial you will learn about PCB designing in Proteus.Along with this you will also learn about how to get the printout of your PCB.


I hope this article has helped you a lot.I will be posting articles on electronic projects so please keep checking this blog or you can bookmark it for your convenience.