Introduction: INTRODUCTION TO (IC's) 555 TIMER BASICS (ASTABLE)

About: B.sc in Electrical Engineering. Microcontrollers,PLC specialist programmer and embedded system developer.

TOPIC:555 TIMER

DATE:3/24/2016

DIFFICULTY:EASY

FUN FACT: The 555 timer has three 5kohms resistor inside, thats how it got it's name :). Hello everyone and happy easter, today i will be making another easy tutorial this time on the 555 timer integrated circuit. The 555 timer is a widely used, cheap timer that has many applications. The 555 timer has 3 modes

  • Astable mode(Free running mode): This mode is the most widely used mode.The 555 in the astable mode can be used as logic clock, LED flasher, tone generation and most of all PWM(Pulse Width Modulation) signal.
  • Monostable mode(One-shot mode): The 555 in this mode can be used for bounce-free switching, timer, frequency divider and PWM.
  • Bistable mode or Schmitt trigger: the 555 can operate as a flip-flop, if the DIS(discharge) pin is unconnected and no capacitor is used. it can work as bounce-free latched switches.

Now lets see all the different Mode of the 555 timer.

Step 1: ASTABLE MODE

To setup the 555 timer in astable mode you will need the following things:-

  • 555 timer chip
    • 1 resistors for the LED
      • 2 resistors for the 555 / 1 resistor and one variable resistor(Potentiometer)
  • 1 potentiometer
  • breadboard
  • jumpers
  • capacitor

I am not giving resistor and capcitor values because you can setup you 555 astable mode the way you want it, but the fact is that duration of the high and low states are based on what values you choose for R1, R2 and C1.There are equations for measuring values

Equations:

F=1/T= 1.44/((R1+R2*2)*C)

Time Low= 0.693*R2*C

Time High= 0.693*(R1+R2)*C

D= Duty Cycle= (R1+R2)/(R1+2*R2)

In the images above you will see two different setups. The first is with 2 resistors and the second is with 1 resistor and 1 variable resistor(potentiometer). This two setups work fine, but the second setup i will say is better, because you can change the Time low by tunning the potentiometer, and you don't have to worry about changing resistors for a higher or lower value when you want to increase or decrease low time.

Step 2: ARDUINO AND 555 TIMER

I have written a small code. This code counts Seconds from 0-59, i have setup two pushbuttons and connected them to pin6 and pin7 on the Arduino. When i press the button connected to pin6 the count increases by 1 and decreases by 1 when i press the pushbutton connected to pin7, When the count reaches 59 it starts again from zero. Now, i have also setup my 555 timer and on the output i have connected an LED, i decided to also connect a wire from the output of the 555(pin3) to pin6 on the Arduino and remove the pushbutton, and i can watch the time increase every time the 555 / LED goes HIGH and will continue to count as long as the pulse stays HIGH and i can change the R1 to increase or decrease the Time-High or tune the potentiometer and adjust the Time-Low which will affect how fast the counter increases. The code might not be easy to understand, but do not focus on the code because this instructable is about 555 timer Astable mode.

Next up! Monostable Mode. Thank you.

    //Var initialization

    int New_Sec=0;
    int Sec_Min=0;
    int Sec_Max=60;
    //POrt intialization
    int set_up=6;
    int set_down=7;
    void setup()  {
    pinMode(set_up,INPUT);
    pinMode (set_down,INPUT);
    Serial.begin(9600);
    }
    /*increment second*/
    // Seconds function
    void set_sec(){
    while(!Serial);                 //while serial is running
    if(digitalRead(set_up)==HIGH){  //if digital pushbutton is high
    _delay_ms(100);
    if(Sec_Min<60){               //and seconds is less than 60
    if(Sec_Min>=59)              //if seconds is greater or equal to 59
    Sec_Min=New_Sec;        //when sec is upto or equal to 59 continue count again from zero.
    Sec_Min=Sec_Min+1;    //increase secs by 1 for every pb press
    Sec_Max=Sec_Min;
    }
    }
    else{
    Sec_Min=Sec_Min;
    }
    /*decrement seconds*/
    if(digitalRead(set_down)==HIGH){
    _delay_ms(100);
    if(Sec_Max>0){                //if secs maximum is greater than 0
    if(Sec_Min<=0)                //if secs minimum is less or equal to 
    Sec_Max=Sec_Max;      //secs maximum is equal to secs maximum
    Sec_Max=Sec_Max-1;    //secs maximum is equal to secs maximum -1
    Sec_Min=Sec_Max;      // secs minimum is equal to sec maximum
    }
    }
    else{
    Sec_Max=Sec_Max;
    }
    }
    void loop()
    set_sec();            //function call
    Serial.print("S:");
    Serial.println(Sec_Min);
    Serial.print("\n");
    delay(100);
    }