Thursday, 30 April 2015

Digital Dice Using 8051 Microcontroller


We are going to implement the same circuit (of seven segment interfacing) with the exception that we are going to use four  extra pins of the microcontroller as input pins for stopping a dice at one position (pause), starting it again from the same position (start) and starting it from  the beginning (reset) enabling the seven segment(enable). The three pins i.e. P3^3 , P1^1and  P3^2  of the microcontrollers are made the input pins and assigned to variable reset, start and pause respectively.  The pin P1^0 is made output and assigned to variable ‘enable’. Whenever, there is a high given from the Vcc on the pause pin, the seven segment displays the number and keep showing that number. As soon as you give high on the reset pin, the seven segment starts displaying the numbers from the beginning i.e. it starts again from displaying numbers from one (1). As soon as you give high on the start pin, the seven segment begins displaying the numbers starting from the next number at it was paused. The seven segment displays the data assigned to only and only when there is a high on its enable pin.
Circuit Diagram
 
Source Code

// Program to make a digital dice

#include<reg51.h>

sbit reset=P3^3;
sbit start=P1^1;
sbit pause=P3^2;
sbit enable=P1^0;
int current=0;
char num[]={0xF9,0x24,0x30,0x19,0x12,0x02};        // Hex values corresponding to1to6

void delay(int time)        // Function to generate time delay
{
    int i,j;
    for(i=0;i<time;i++)
    for(j=0;j<1275;j++);
}

void pausefn()interrupt 0        //Pause function using external interrupt 0
{
    IE=0x84;
    P2=num[current];
    while(1)
    {
        if( start==0 )
        break;

        if(reset==0)
        {
            enable=1;
            current=0;
            P2=num[current];
            while(start==1);
            return;
        }

    enable=1;
    delay(25);

        if( start==0)
        break;

        if(reset==0)
        {
            enable=1;
            current=0;
            P2=num[current];
            while(start==1);
            return;
        }

    enable=0;
    delay(25);
    }
    enable=1;
}

void resetfn()interrupt 2        // Reset function using timer interrupt 2
{
    current=0;
    P2=num[current];
    while(start==1);
      enable=1;
}

void main()
{
    enable=1;
    while(1)
    {
        IE=0x85;
        if(current >5)
        {
            current=0;
        }
    P2=num[current];
    delay(15);
    current++;
    }

}
 


Laser Based Security System

Introduction

what is security ? A very simple and common answer , security is nothing but the restriction for unwanted access or unauthorised access to anything. we can design such security system in number of intelligent ways such as:
i.  we can design security system with massaging.
it means, if any unauthorised person want to access anything of yours, you got a quick massage to you mobile about it.
ii. we can design the same system with alarm.
iii. we can design such system where any unauthenticated access may cause senseless.

There are number of ways we can design numerous range of security systems. one very simple and common security system is proposed here which is " Laser based security system" where an alarm is introduced. The purpose is to raise alarm if there is any unwanted access.

Component Required

  1. Laser module
  2. LDR(light dependent resistance) module
  3. AT89S52 (8051 microcontroller by ATMEL Corp.)
  4. 11.0592 MHz crystal
  5. LED/Buzzer (for indication)
 Circuit Diagram


Source Code


#include<AT89X51.h> /* header for 8051 family microcontroller*/
#define LDR P1_0;
#define LED P1_1;
void main()
{
  LDR=1;   /* make ldr as input pin because it receives the light*/
  LED=0;   /* it is configured as output because it is used for indication purpose*/  
  while(1) 
 {
        if(LDR==0) /* if laser light cut LDR receives 0*/
        LED=0;     /* indicator is active*/ 
        if(LDR==1) 
        LED=1;
      }                                                                                               
}

Description
This system for security uses the combination of LASER light and LDR. The LDR module has an onboard potentiometer to adjust the sensitivity of LDR, so that it only senses laser light falling onto it.
The concept is quite simple and similar to what we see in movies where antique, priceless ornaments are protected under laser lights. As someone crosses these lights, an alarm runs on to indicate unauthorised presence. This project works similarly.
In normal conditions, where there is always laser light falling on the LDR, the LDR module always gives a high signal to microcontroller. When someone crosses this laser light, it will behave as an obstruction between the LDR module and laser light, resulting in no light falling on LDR. In such cases LDR module gives a low signal to the microcontroller, which indicates it to switch on an alarm (or LED in this case).

Here I am using only a pair of LDR and LASER module.
But for better and efficient security results, a group of such LASER and LDR modules can be used simultaneously.
We can also use only one laser light with an optical system which will scatter light on different LDR modules.


normalcondition1 
 

Saturday, 25 April 2015

Prototype for Bolier Plant Automation System




Introduction:
 
Boilers are very important parts of many industries like thermal plants, metallurgical industries. One of the major problem with boilers is that they often get overheated and to recover them manually a lot of time is wasted. This system makes plant automated it continuously keeps record of temperature and takes steps to regulate the plant. It controls components like fuel supply, condensing systems. If there comes a point when the system is unable to operate due to overheating, it signals workers inside by alarm to evacuate the chamber.

About key Components:

16X2 LCD:
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. 

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data.
The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

IR TRANSMITTER:

Infrared emitter, or IR emitter, is a source of light energy in the infrared spectrum. It is a light emitting diode (LED) that is used in order to transmit infrared signals from a remote control. In general, the more they are in quantity and the better the emitters are, the stronger and wider the resulting signal is. A remote with strong emitters can often be used without directly pointing at the desired device. Infrared emitters are also partly responsible for limits on the range of frequencies that can be controlled. An IR emitter generates infrared light that transmits information and commands from one device to another. Typically one device receives the signal then passes the infrared (IR) signal through the emitter to another device.

IR RECIEVER:

An infrared receiver, or IR receiver, is hardware that sends information from an infrared remote control to another device by receiving and decoding signals. In general, the receiver outputs a code to uniquely identify the infrared signal that it receives. This code is then used in order to convert signals from the remote control into a format that can be understood by the other device. It is the part of a device that receives infrared commands from a remote control. Because infrared is light, it requires line-of-sight visibility for the best possible operation, but can however still be reflected by items such as glass and walls. Poorly placed IR receivers can result in what is called "tunnel vision", where the operational range of a remote control is reduced because they are set so far back into the chassis of a device.

IC 358:

The LM358 datasheet specifies that it consists of two independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. The LM358 and LM2904 are available in a chip sized package (8-Bump micro SMD) using National’s micro SMD package technology.