Sunday, 17 March 2013

LED Flasher Circuit


Hi,Friend!,here we are going to make a simple two led flasher by using transistors and capacitors.The RC circuit make the time delay for the led flasher circuit.In my opinion a beginner must star with this led flasher it may help him to work with transistor and capacitor.And it also help him to learn the basic of transistor switching and how to deal with capacitors and led.


CIRCUIT DIAGRAM



COMPONENTS:

  1. Transistor SL100B-2(You can use any general purpose transistor like BC547)
  2. 100k-2
  3. 1k-2
  4. LED-2
  5. 10uf electrolytic capacitor-2

WORKING:

When the power on,the led D1 flash once and at the same time capacitor c4 start charging.It discharge through the base of the  Q1 when it gets fully charged.And it cause the switching of the Q1 and a current flow from the collector to emitter cause the led D2 falsh once and it charges the capacitor c3.This process will continue...You can make long delay by using large capacitor(22uf,100uf..etc)


ENJOY :)
Read more »

INTRODUCTION TO 555 IC



        555 is the one of the most popular ic among the electronic hobbyist.It's also called as timer ic.The 555 is a highly stable controller capable of  producing accurate timing pulses.With the monostable operation,the time delay is controlled by one external resistor and one  capacitor.While with the astable operation the frequency and duty cycle controlled by two resistors and one capacitor.There eight pins in 555ic.


PIN CONFIGURATIONS
  • PIN1:-Ground
  • PIN2:-It's the trigger pin.It detect 1/3v of vcc and make the output of 555 is high.
PIN2 has a control over PIN6.If PIN2 and PIN6 is low o/p goes and stay as HIGH.If PIN6 is high and PIN2 is low then output goes LOW.
  • PIN3:-It's the output pin of the 555 ic.Note the point that the output of the 555 ic is 1-2v less than the vcc.For example,if the vcc is 5v,then the output voltage of the 555 is become 3v.
  • PIN4:-It's the RESET pin of the 555.RESET pin is internally connected to high via 100k resistance and it must be taken below 0.8v to reset the chip.
  • PIN5:-It's the CONTROL pin of the 555.A votage applied to this pin will change the timing of RC network by changing the reference voltage of the two comparator of the 555 ic.
  • PIN6:-THRESHOLD pin.It detect 2/3v of rail and make output low only if PIN2 is high.
  • PIN7:-It's the DISCHARGE pin.It goes LOW when PIN6 detect 2/3v but PIN2 must be high.
If PIN2 is high,then PIN6 can high or low and PIN7 remains low.PIN7 goes open and stay high when PIN2 detect 1/3v of vcc and PIN6 is low.

Here,we noted that PIN7 is almost like the PIN3 but PIN7 does not go HIGH instead it goes OPEN.But it goes low and can sink upto 200mA.
  • PIN8:-It's the supply pin.Connect it to the positive rail.


 
PIN-OUT OF 555







Schematic diagram







Just take a look at the above image.We can see that there two comparators,one is in inverting and other one is in non-inverting mode.These two comparator get reference voltage via the three resistors(R=5k).So now you may get,why is it called as a 555 IC..There three 5k resistors in 555.


In the next post, we focus on monostable,astable, and also how we can make different circuits by using 555 for different purpose.


SALAM!. :)...











Read more »

Friday, 15 March 2013

How to interface a 16*2 LCD display with atmega8



Hi friends,Welcome to my  website! 


              I'm a student of electronics and communication systems. My real interest focus around Electronics  and Computer programming. I enjoy micro-controller and computer programming.I'm familiar with  micro-controllers, like 8051, AVR..I'm also interested in websites design especially blog template design..

Today we are going to discuss about the LCD interface with the atmega8 micro-controller.

Pin Configuration of ATMEGA8

16*2 LCD display

Schematic diagram of LCD interface with ATMEGA8(click on image-full size view )

Configurations

Here,PORTB(PB0-PB7) set as data port in 8 bit mode LCD display.Connect D0-D7 with the PORTB.

  • Ground the first lead of the lcd(vss) display.
  • Connect vcc to a 5v power supply.
  • Conncet VEE with a pot.It's used to adjust the contrast of the LCD display
 15th and 16th leads are used to power the back light of the LCD.Connect 15th with 5v and ground 16th lead.

C CODE

#define F_CPU 1000000
#include <avr/io.h>
void delay(unsigned char);

//Main Code
int main()
{
DDRB=0xff;    //set PORTB as out put
 
  DDRD=0b01110000;   //Set PD.4,5 and 6 as Output
 
/*
RS=PD5
           R/W=PD6
         
           E=PD4          */

  //Give Inital Delay for LCD to startup as LCD is a slower Device
  delay(2);

  init_lcd();

while(1)
    {

       
           
   lcd_cmd(0x80);       //Goto Line-1,first position
  lcd_send_string("WELCOME TO! ");

   lcd_cmd(0xC0);      //Goto Line-2, first position    

   lcd_send_string("EGLOB :) ");
   lcd_cmd(0x01);     //Clear the lcd
   delay(1);
      
}

//LCD function
/*------------------------------------------------------------------------------------------------------------*/

//Function for sending commands to LCD
void lcd_cmd(unsigned char command)

{
 

//Put command on the Data Bus
  PORTB = command;

  //Enable LCD for command writing
  PORTD = 0b00010000;

  //Allow delay for LCD to read the databus
  delay(1);

  //Disable LCD again
  PORTD = 0b00000000;

  //Allow some more delay
  delay(1);
}

//Function for sending Data to LCD

void lcd_data(unsigned char data)
{
  //Put data on Data Bus
  PORTB= data;


  //Set R/S (Regiter Select) to High, and Enable to High
  PORTD = 0b00110000;

  //Allow for delay
  delay(1);

  //Disable LCD again
  PORTD = 0b00100000;

  //Allow for some more delay
  delay(1);
}

//Function to send String to LCD
void lcd_send_string(char* string)
{
  while(*string)
{
  //Send value of pointer as data to LCD

  lcd_data(*string);
  //Increment string pointer
  string++;
  }
}




//Function to Initilise LCD
void init_lcd()
{
  //Setup both lines of LCD
  lcd_cmd(0x38);
  //Set Cursor off - Enable LCD
  lcd_cmd(0x0E);
  //Clear Screen
  lcd_cmd(0x01);
  //Goto first position
  lcd_cmd(0x80);
}
 /*----------------------------------------------------------------------------------------------------------*/

//Delay function

void delay(unsigned char dtime)
{
int i,j;
for(i=0;i<=dtime;i++)
{
for(j=0;j<5000;j++);
}}
//You can use your own delay functions and replace this delay function with your code
/*-----------------------------------------------------------------------------------------------------------*/


Feel free to ask your doubts..

ENJOY! 
Read more »