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.

 

Friday, 17 April 2015

​ Arduino-based Gauss Meter


Background Theory

Presented here is a handheld device that can be used to measure magnetic field using a Hall effect-based sensor. The device can be used in the physics lab for conducting various experiments on magnetism. Moreover, some upgradations can be made to develop new and advanced devices. The device shows magnetic field in CGS (centimetre-gram-second system) unit, Guass and is updated every 250 milliseconds on the LCD screen.

Circuit and working
Fig. 1 shows the circuit diagram of Arduino-based Gauss meter. The circuit is built around Arduino Uno board (Board1), MCP3202 12-bit analogue-to-digital (A/D) converter (IC1), WSH315 Hall-effect sensor (IC2) and serial LCD (LCD1).

 
 
MCP3202 (12-bit A/D converter). The Microchip technology’s MCP3202 is a successive approximation 12-bit A/D converter with an on-board sample-and-hold circuit. It is programmed to provide a single pseudo-differential input pair or dual single-ended inputs. Differential non-linearity (DNL) is specified at ±1 LSB, and integral non-linearity (INL) is offered in ±1 LSB (MCP3202-B) and ±2 LSB (MCP3202-C) versions. Communication with the device is done using a simple serial interface compatible with SPI protocol. The device is capable of conversion rates of up to 100ksps at 5V and 50ksps at 2.7V. The MCP3202 device operates over a broad voltage range of 2.7V to 5.5V. Low-current design permits operation with typical standby and active currents of only 500nA and 375μA, respectively.

WSH315 (Hall-effect sensor). This ratiometric, linear Hall-effect sensor accurately tracks extremely small changes in magnetic flux density, even those changes that are generally too small to operate Hall-effect switches. The device comes with a Hall-sensing element, linear amplifier and emitter-follower output stage integrated on a single IC to handle small analogue signals.

Arduino Uno board. Arduino is an open source electronics prototyping platform based on flexible, easy-to-use hardware and software. It is intended for artists, designers, hobbyists and anyone else interested in creating interactive objects or environments. Arduino Uno is a board based on ATmega328 microcontroller. It consists of 14 digital input/output pins, six analogue inputs, a USB connection for programming the on-board microcontroller, power jack, an ICSP header and a reset button. It is operated with a 16MHz crystal oscillator and contains everything needed to support the microcontroller. It is very easy to use as the user simply needs to connect it to a computer with a USB cable or power it with an AC-to-DC adaptor or battery to get started. The microcontroller on the board is programmed in Arduino programming language using Arduino development environment. Pins 10 through 13 of Board1 are connected to pins 1, 5, 6 and 7 of 12-bit ADC IC1, respectively. Pin 1 of Board1 is connected to RXD pin 3 of LCD1.
 
The working of the project is simple. Hall-effect sensor IC2 has 3 pins: Vcc, Ground and Vout. The Vout of the sensor is connected to channel 0 (CH0) of ADC IC1 as shown in Fig. 1. IC1 is connected to Arduino controller in SPI mode. The sensor generates voltage output from 0.2V up to 4.8V for 5V power supply. Resolution of ADC IC1 is 5/212 = 1.22mV. The input voltage to channel 0 of the ADC IC1 gets converted to equivalent 12-bit binary data and is fetched by Arduino board in two bytes. Board1 then processes the digital data from IC1 and shows it on the serial LCD together with the Pole (North/South) indication.
 
Software 

Download Source Code from below link

 
The software is written in Arduino programming language and the board is programmed using Arduino IDE software. ATmega328 on Arduino Uno board comes pre-burnt with a bootloader that allows you to upload new code without the use of an external hardware programmer. It communicates using the original STK500 protocol. You can also bypass the bootloader and program the microcontroller through the in-circuit serial programming (ICSP) header, but using bootloader, it is quick and easy. Select Arduino Uno from the ‘Tools > Board’ menu (according to the microcontroller on your board) in the Arduino IDE and burn the program through standard USB port in the computer.


** Ask for any Doubt.