Embedded System Design: An Electronic Pendulum

DOI : 10.17577/IJERTV7IS090092

Download Full-Text PDF Cite this Publication

Text Only Version

Embedded System Design: An Electronic Pendulum

Embedded System Design: An Electronic Pendulum

Lairai Karnik

(Under the guidance of Mr. Abhijit Shete,

Assistant Professor, Electronics Department, VESIT,

Mumbai University)

Sanika Pathare

7th Semester, Electronics Department VESIT, Mumbai University Mumbai, India

Nidhi Joshi

7th Semester, Electronics Department VESIT, Mumbai University Mumbai, India

7th Semester, Electronics Department VESIT, Mumbai University Mumbai, India

Swathi Nair

7th Semester, Electronics Department VESIT, Mumbai University Mumbai, India

AbstractAn embedded system is an electronic device that has a central component for performing computational tasks and has specific functionality. In essence, the electronic system which integrates the hardware circuitry with the software programming techniques for providing project solutions is called as an embedded system. By using this embedded system technology the complexity of the circuits can be reduced to a great extent which further reduces the cost and size. It is touted as the primary technology of the future due to the plethora of innovative applications possible utilizing embedded system design. The objective of this project is to incorporate such an embedded system design in the simple pendulum experiment commonly conducted in physics laboratories in order to automate the entire process and eliminate errors that result while performing the experiment manually.

Keywords Embedded Systems, Embedded System Design, , Simple Pendulum Experiment, Electronic Pendulum, Microcontroller

  1. OVERVIEW OF MECHANISM

    The pendulum bob would be the obstacle which our system would be detecting. The sensor used for this detection would be an infra-red sensor. This sensor would detect the presence of bob based on whether the infra-red light transmitted by it is received back. The output of IR sensor which are digital pulses would be fed to the microcontroller as interrupt signal. The microcontroller would process this data received to display the value of acceleration due to gravity (g). LCD is the output device used for this display.

    1. INTRODUCTION

      A simple pendulum is defined as an object that has a small mass, also known as the pendulum bob, which is suspended from a wire or string of negligible mass. When displaced, a pendulum will oscillate around its equilibrium point due to

      1. Components used

        Fig 1: Block Diagram

        momentum in balance with the restoring force of gravity. The period (T) for a simple pendulum does not depend on the mass or the initial angular displacement, but depends only on the length (L) of the string and the value of the gravitational field strength (g). The time period (T) is calculated by dividing the time taken for total number of oscillations by the total number of oscillations. The acceleration due to gravity is measured using the time period. Conventionally, the experiment is carried out by manually setting a timer, noting down the time taken for one oscillation, repeating the same for subsequent readings, substituting the same in the required formula and carrying out the calculations. This entire process will be carried out without manual intervention by virtue of this project. Performing this experiment manually introduces a lot of human errors due to the lapses in measuring the time required for n number of oscillations and parallax error. Incorporation of embedded system design thus precludes such a possibility.

        SR.

        NO.

        COMPONENT

        QUANTITY

        1.

        2051 microcontroller

        1

        2.

        FC-51 IR sensor

        1

        3.

        16×1 LCD display

        1

        4.

        Ceramic capacitors (22pf)

        2

        5.

        Push Button Switch

        1

        6.

        Polarised Capacitor (10Uf)

        1

        7.

        Resistor

        1

        8.

        Crystal oscillator

        1

        9.

        Power supply

        1

        TABLE 1- LIST OF COMPONENTS

      2. Circuit Diagram

      1. Working

        The bob is released at an angle less than 10 and the timer is started simultaneously. An infra-red sensor is placed such that the oscillating bob cuts the IR signal from the sensor when the bob oscillates. When the oscillating pendulum cuts the line of transmission between the transmitter and receiver, the output of the sensor becomes high.

      2. Equations

      Fig 2: Eagle Schematic Diagram

      The sensor output acts as an interrupt source for microcontroller 2051. At the first interrupt, the timer starts. After 3 such interrupts, the pendulum completes one oscillation and the timer stops.

      A counter is initialized which goes on counting the number of interrupts received and thus the final value of this counter gives the total number of oscillations. Using this, the time period of one oscillation is calculated. This time period is

      The period T for a simple pendulum does not depend on the mass or the initial angular displacement, but depends only on the length L of the string and the value of the gravitational field strength g, according to

      Rearranging the above equation, we can find the value of acceleration due to gravity at a particular location.

      The time period (T) is calculated by dividing the time taken for total number of oscillations by the total number of oscillations.

      Fig 3: Experimental Setup

  2. CONSTRUCTION AND WORKING

    A. Construction

    The PCB is placed at the back of the simple pendulum and an LED transmitter is placed in the front. The IR receiver is placed on the PCB. The apparatus is constructed in such a way that the length of the pendulum, and the position of the sensors can be changed simultaneously, keeping the bob and the sensors at the same level.

    a.

    displayed on the LCD screen. This calculated value of T is

    used to find the value of acceleration due to gravity of the simple pendulum using the formula

    (Note: = 3.14, 4 2 = 39.44)

    The value of g is displayed on the LCD and then cleared to repeat the same for a different value of L. The average of all the values of g is then displayed on the LCD. This is the acceleration due to gravity of the pendulum.

    C. Program Code

    #include<reg51.h>

    #define LCDPORT P1; sbit sw= P1^0;

    sbit ir= P3^2; sbit en= P1^3; sbit rw= P1^2; sbit rs= P1^1; bit status=0; unsigned int g; int l;

    int length[3] = {5,10,15}; unsigned int i;

    unsigned int y; unsigned int d1; unsigned int d2; unsigned int d3; unsigned int d4;

    extern unsigned char count = 0; extern unsigned char a = 0; void delay( unsigned int);

    void display( unsigned char);

    void lcd_init_write(unsigned char); void lcd_puts(char *str);

    void lcd_data(unsigned char); void lcd_init (void);

    void lcd_com(unsigned char);

    void main(void)

    {

    TCON = 0x01; IE = 0x81;

    for ( i=0; i<3; i++)

    {

    if (sw==1)

    {

    a++;

    delay(250);

    }

    }

    l=length[a]; lcd_init(); lcd_puts('l'); lcd_data(l); while(1)

    {

    if(count==3)

    {

    display(a);

    }

    }

    }

    void obstacle(void) interrupt 0

    {

    if(count&lt3) count++; return;

    }

    void display(unsigned char x)

    {

    unsigned int gravity[]={0,9811,9781,9811};

    g=gravity[a]; x=g/10; d1=g%10; d2=g%10;

    y=x/10; d3=y%10;

    d4=y/10; lcd_data(d1); delay(250); lcd_data(d2); delay(250); lcd_data(d3); delay(250); lcd_puts('.'); delay(250); lcd_data(d4);

    }

    void delay(unsigned int itime)

    {

    unsigned int k,j; for(k=0;k<itime;k++)

    {

    }

    for(j=0;j<1275;j++)

    {

    }

    }

    void lcd_init_write(unsigned char p)

    {

    rs=0; rw=0; P1=p;

    en=1; delay(250); en=0;

    }

    void lcd_com(unsigned char p)

    {

    unsigned char temp; if(status)

    {

    status=0; goto next;

    }

    rs=0; next: rw=0; temp=p; temp&=0xf0; P1&=0x0f; P1|=temp; en=1; delay(250); en=0; temp=p<<4; temp&=0xf0;

    P1&=0x0f; P1|=temp;

    en=1; delay(250); en=0;

    }

    void lcd_data(unsigned char p)

    {

    status=1; rs=1; lcd_com(p);

    }

    void lcd_init(void)

    {

    delay(250); lcd_init_write(0x30); delay(250); lcd_init_write(0x30); delay(250); lcd_init_write(0x30); delay(250); lcd_init_write(0x20); delay(250); lcd_com(0x28); delay(250); lcd_com(4); delay(250);

    }

    void lcd_puts(char *str)

    {

    unsigned int i=0; for(;str[i]!=0;i++)

    lcd_data(str[i]);

    }

  3. CONCLUSION AND SCOPE

Utilizing the concepts of embedded system design, a unique setup has been devised to automate the simple pendulum experiment. Embedded systems typically measure a particular variable or variables using sensors, send the data acquired for computation to a suitable computational unit such as a microcontroller which accordingly processes the information and outputs it through a display device. By interfacing sensors, microcontrollers and display devices, an embedded system prototype has been successfully implemented that eliminates manual intervention from the pendulum experiment. It can be used in Physics Laboratories and Research Centers for more convenient and precise measurement of acceleration due to gravity. There are immense opportunities and far reaching applications of embedded system design yet to be explored. This project clearly demonstrates how a simple yet potent application of embedded systems can create ripples in a particular area, increasing precision and accuracy previously limited due to human errors.

REFERENCES

[1] The 8051 Microcontroller and Embedded Systems Using Assembly and C-by Muhammad Ali Mazidi , Rolin McKinlay,Janice Gillispie Mazidi

[2] Introduction to Embedded Systems-by Shibu K V [3] http://www.keil.com

[4] Embedded C Programming-by Mark Siegesmund

[5] Elprocus.com/Structure and basics of embedded C programming [6] http://www.phys.utk.edu/labs/SimplePendulum.pdf

Leave a Reply