Wednesday, July 7, 2010

A Walk that means a lot

                      Definitely i am nebulous about what i am saying but dont know thats something which made me blog it for today. Its been long time since i got myself busy with things. As i completed my graduation i was just making most of the time. I am doing what not , watching movies. freaking out with friends.  But yes still i had some sure optimism that is making me confident .Yes i had it , something that questions me all the time why some one need to eulogize u to do something, And more over i had some weird things that keep pricking my mind all the time , as a part of my project and hobby i have involved my self into electronic projects during last stage of my UG , and just to prepare a moving body we have to present our heart and soul, and still we couldn make the best.. Every time when i recheck things some fault or other surely comes out , and i wonder how was over body developed which is so realistic , and flexible. If god has made this definitely he deserves all the prayers we offer.

                     And the most ridiculous thing is not getting inspired from ur body. U are given wonderful construction of no cost and ur sure inability couldn make the most of it and still blame god what is that u have done to me. Its an incontrovertible thing that work we do offers 90 percent of result from our input and these things are not to be isolated . Erudition is the mere thing that we tend to find in most of the people , yes thats what the life is all about and bitter truth is we have to accept the people as they are because there is world around you and that is surely not built for u . U are just a part of  this world. This pervasive truth , No one will expect the magnanimity from others its just the simple fact of respecting what they are, never mind until or unless they hurt someone.
                  
                    Hmm  loads of philosophy definitely i am not cynical or obscurant  but just what i feel the thats is what i feel strongly. And these things will be learned only when u meet different people in ur walk of life . Yes u meet with lot of people in this brave journey what is called life i have met a lot of people but not many were my buddies to core just because i couldn't realize the fact which i mentioned .

Monday, May 31, 2010

Winning it never mind whether it is graceful or disgraceful

                         Who is bill gates first thing that comes to a common man is one of the richest , a technical person can remember him as founder of microsoft. What else hmmm yes there are many achievements which make him great . Since morning i have been reading his life history , Till now he was one among who i really adore a lot but as of now he is not . But still i do love  him because not just he is a computer geek , but he is a good business men . In fact more that a computer engineer he is business man . Firstly he was born in a rich family , in his biography unlike other biographies his mother was given a major role . More over bill loved his mother a lot .
                        Directly entering into  the matter i cant narrate his story but i would like to share something regarding him . Well got to confess he is hard worker ,stoic . He was never garrulous by nature. But still he enjoyed technical conversations .  He was good at mathematics and almost all the academic subjects , but he was actually amazed of the computer right from his early age . As his parents are rich he could join into nice big college and guess what  

Wednesday, May 5, 2010

Final project final code

 #include

//------------LCD INITALIZATION-------------------
sbit rs=P0^2;
sbit rw=P0^1;
sbit en=P0^0;
sfr ldata=0x0A0;

void lcdcmd(unsigned char);
void lcdwrt(unsigned int);
void lcddisp(unsigned char *); // for lcd

//--------------------------------------

//-------------ADC0848 DECLARATION-------------------------------------
sbit cs=P3^2;
sbit wr=P3^3;
sbit rd=P3^5;
sbit intr=P3^4;
void convert(unsigned int);
void adc();
unsigned int value; // for adc0848 ic.

//---------------------------------------------------------------------

void delay(unsigned int);
void delay20ms();

// ---------------------------RF DECLARATION---------------------------
sbit rf1=P0^4;
sbit rf2=P0^5;
sbit rf3=P0^6;
sbit rf4=P0^7; // for rf using only 3 swithches

//----------------------------------------------------------------------

//------------------------GSM INITIALIZATION----------------------------
void gsminit();
void sendtoCOM(char *str);
void send_SMS();
void makecall();
unsigned char message[16],in_num[15]={"9908573677"};
unsigned int tmp;
code char *at={"at\r"};
code char *atcmgs={"at+cmgs=\""};
code char *atd={"atd9908573677"};
code char ctrlz[2]={0x1A,0x0};

//----------------------------------------------------------------------

void crazyangle();

void main()
{

    P3=0xFF;
    lcdcmd(0x38);
    delay(10);
    lcdcmd(0x0E);
    delay(10);
    lcdcmd(0x01);
    delay(10);
    lcdcmd(0x06);
    delay(10);
    lcdcmd(0x80);
    delay(10);
    lcdcmd(0xC0);
    delay(10);

    lcddisp("ACCELEROMANIA ");
     delay(50);  
    lcdcmd(0xC0);
    delay(10);
    lcddisp("1:RUNNING MODE");
    delay(50);
    lcddisp("2:PARKING MODE");
    delay(50);
    lcddisp("3:IDLE MODE");
    delay(50);
    lcddisp("4:ANGLE MEASURING");
    delay(50);

       gsminit();              // LCD general initialization
    adc();                    // calling adc funtion;

}


void adc()
{
    int check=0;
    intr=1;
    cs=1;
    wr=1;
    rd=1;
   
    while(1)
    {
        P1=0x08;                        // Initiating the channel in among control lines
        cs=0;
        wr=0;
        delay(50);
        wr=1;
        cs=1;
        P1=0xFF;
        while(intr==1);
        cs=0;
        rd=0;
        delay(50);
        rd=1;
        value=P1;
        cs=1;
        convert(value);
       
        if(rf1==1&&rf2==0&&rf3==1&&rf4==1)
            {
                check=20;               // switch to switch off parking mode
            }
   
        if(rf1==0&&rf2==1&&rf3==1&&rf4==1)
            {

                check=30;             // switch to switch on parking mode
            }

        if(rf1==1&&rf2==1&&rf3==0&&rf4==1)
            {
                check=40;            // switch to switch on IDLE mode i.e, nothing works
            }
        if(rf1==1&&rf2==1&&rf3==1&&rf4==0)
            {
                check=50;            // switch to switch on IDLE mode i.e, nothing works
            }


        if(check==20)
            {
                if(value>120)
                    {
                        lcdcmd(0xC0);
                        delay(10);
                        lcddisp("BIKE STOLEN  ");
                        delay(10);
                        makecall();
                        delay(50);
                        send_SMS();
                    }
                else if(value<109)
                    {
                        lcdcmd(0xC0);
                        delay(10);
                        lcddisp("BIKE FELL DOWN ");
                        delay(10);
                    }
                else
                    {
                        lcdcmd(0xC0);
                        delay(10);
                        lcddisp("SECURE  ");
                        delay(10);
                    }
            }
         if(check==30)
            {
                if(value>155)
                    {
                   
                        lcdcmd(0xC0);
                        delay(10);
                        lcddisp("FALLEN RIGHT    ");
                        delay(10);
                        delay(500);
                        if(value>155)
                         send_SMS();
                    }
                else if(value<115)
                    {
                   
                        lcdcmd(0xC0);
                        delay(10);
                        lcddisp("FALLEN LEFT   ");
                        delay(10);
                        delay(500);
                        if(value<115)
                         send_SMS();
                    }
                else
                    {
                        lcdcmd(0xC0);
                        delay(10);
                        lcddisp("NORMAL POSITION ");
                        delay(10);
                    }
        }

    if(check==40)
        {
            lcdcmd(0xC0);
            delay(10);
            lcddisp("IDLE MODE  ");
            delay(10);
        }
    if(check==50)
        {
           crazyangle();
        }


    }
}


    void convert(unsigned int temp)
        {
            int x,y,j;
            unsigned int arr[10],i=0;
            while(temp!=0)
                {
                    x=temp/10;
                    y=temp%10;
                    arr[i++]=y;
                    temp=x;
                }
            lcdcmd(0x80);
            delay(10);
            for(j=i-1;j>=0;j--)
                {
                    lcdwrt(arr[j]);
                    delay(10);
                }

         }


void lcdcmd(unsigned char val)
{
    ldata=val;
    rs=0;
    rw=0;
    en=1;
    delay(1);
    en=0;
}

void lcdwrt(unsigned int m)
{
    ldata=0x30+m;
    rs=1;
    rw=0;
    en=1;
    delay(1);
    en=0;
}

void delay(unsigned int x)
{
    int i,j;
    for(i=0;i<=x;i++)
    for(j=0;j<=1275;j++);
}

void lcddisp(unsigned char *value)
{
    while(*value!='\0')
        {
            ldata=*value;
            rs=1;
            rw=0;
            en=1;
            delay(1);
            en=0;
            value++;
        }
}


void gsminit()
{
   
   
    TMOD=0X20;                               // Timer 1-8-bit auto reload
    TH0=0X4C;
    TL0=0X1E;                               // Timer 0 - 50ms delay;


    TH1=0XFD;                                //9600 baud rate

    SCON=0X50;                             // serial transmission
    TR1=1;                                  // timer 1 start,i.e enable serial transmission
    TR0=1;                                   // Timer 0 start;


    sendtoCOM(at);

    for(tmp=0;tmp<50;tmp++)
        delay20ms();

     //---------FOR THEFT MANAGEMENT---------------------------------
   
        message[0]='B';
           
        message[1]='I';
           
        message[2]='K';
           
        message[3]='E';
       
        message[4]=' ';
       
        message[5]='S';   
           
        message[6]='T';   
           
        message[7]='O';
           
        message[8]='L';
           
        message[9]='E';
           
        message[10]='N';

        message[11]='\0';

 }

 void sendtoCOM(char *str)
{
    while(*str!='\0')
    {
        SBUF=*str++;
        while(!TI);
        TI=0;
        for(tmp=0;tmp<50;tmp++)
        delay20ms();
    }
}

void send_SMS()
{



    sendtoCOM(atcmgs);

    for(tmp=0;tmp<50;tmp++)
        delay20ms();

   
    sendtoCOM(in_num);

    for(tmp=0;tmp<50;tmp++)
        delay20ms();

    sendtoCOM("\"\r");

    for(tmp=0;tmp<50;tmp++)
        delay20ms();

        sendtoCOM(message);
      
    for(tmp=0;tmp<50;tmp++)
        delay20ms();

    sendtoCOM(ctrlz);

    for(tmp=0;tmp<50;tmp++)
        delay20ms();
       
}
void makecall()
 {
  
   sendtoCOM(atd);
       for(tmp=0;tmp<50;tmp++)
        delay20ms();
 }

void delay20ms()
{
unsigned int i;
for(i=1;i<5117;i++);
}

void crazyangle()
{
  int x;
  x=(value-115)+3;
  lcdcmd(0x80);
  delay(10);
  convert(x);
 
}



      This code is now capable of detecting accident and for security and for one crazy extra activity of measuring the angle with respect to ground when we are travelling ..

Sunday, April 25, 2010

Program for accelerometer

#include
sbit rs=P0^2;
sbit rw=P0^1;
sbit en=P0^0;
sfr ldata=0x0A0;

void lcdcmd(unsigned char);
void lcdwrt(unsigned int);
void lcddisp(unsigned char *); // for lcd

sbit cs=P3^2;
sbit wr=P3^3;
sbit rd=P3^5;
sbit intr=P3^4;
void convert(unsigned int);
void adc();
unsigned int value; // for adc0848 ic.

void delay(unsigned int);


sbit rf1=P0^4;
sbit rf2=P0^5;
sbit rf3=P0^6;
sbit rf4=P0^7; // for rf using only 3 swithches


sbit alr1=P3^6; // alarm if the bike falls left
sbit alr2=P3^7; // alarm if the bike falls right

void main()
{

P3=0xFF;
lcdcmd(0x38);
delay(10);
lcdcmd(0x0E);
delay(10);
lcdcmd(0x01);
delay(10);
lcdcmd(0x06);
delay(10);
lcdcmd(0x80);
delay(10);
lcdcmd(0xC0);
delay(10);
lcddisp("BANG BANG ");
delay(10); // LCD general initialization
adc(); // calling adc funtion;
}

void adc()
{
int check=0;
intr=1;
cs=1;
wr=1;
rd=1;
while(1)
{
P1=0x08; // Initiating the channel in among control lines
cs=0;
wr=0;
delay(50);
wr=1;
cs=1;
P1=0xFF;
while(intr==1);
cs=0;
rd=0;
delay(50);
rd=1;
value=P1;
cs=1;
convert(value);
if(rf1==1&&rf2==0&&rf3==1&&rf4==1)
{
check=20; // switch to switch off parking mode
}
if(rf1==0&&rf2==1&&rf3==1&&rf4==1)
{
check=30; // switch to switch on parking mode
}
if(rf1==1&&rf2==1&&rf3==0&&rf4==1)
{
check=40; // switch to switch on IDLE mode i.e, nothing works
}

if(check==20)
{

if(value>120)
{
lcdcmd(0xC0);
delay(10);
lcddisp("BIKE STOLEN ");
delay(10);
}
else if(value<109)
{
lcdcmd(0xC0);
delay(10);
lcddisp("BIKE PADINDHI RA ");
delay(10);
}
else
{
lcdcmd(0xC0);
delay(10);
lcddisp("SECURE ");
delay(10);
}
}
if(check==30)
{
if(value>155)
{
alr1=1;
lcdcmd(0xC0);
delay(10);
lcddisp("FALLEN RIGHT ");
delay(10);
}
else if(value<115)
{
alr2=1;
lcdcmd(0xC0);
delay(10);
lcddisp("FALLEN LEFT ");
delay(10);
}
else
{
lcdcmd(0xC0);
delay(10);
lcddisp("NORMAL POSITION ");
delay(10);
alr1=0;
alr2=0;
}
}
if(check==40)
{
lcdcmd(0xC0);
delay(10);
lcddisp("IDLE MODE ");
delay(10);
}
}
}
void convert(unsigned int temp)
{
int x,y,j;
unsigned int arr[10],i=0;
while(temp!=0)
{
x=temp/10;
y=temp%10;
arr[i++]=y;
temp=x;
}
lcdcmd(0x80);
delay(10);
for(j=i-1;j>=0;j--)
{
lcdwrt(arr[j]);
delay(10);
}

}


void lcdcmd(unsigned char val)
{
ldata=val;
rs=0;
rw=0;
en=1;
delay(1);
en=0;
}

void lcdwrt(unsigned int m)
{
ldata=0x30+m;
rs=1;
rw=0;
en=1;
delay(1);
en=0;
}
void delay(unsigned int x)
{
int i,j;
for(i=0;i<=x;i++)
for(j=0;j<=1275;j++);
}
void lcddisp(unsigned char *value)
{
while(*value!='\0')
{
ldata=*value;
rs=1;
rw=0;
en=1;
delay(1);
en=0;
value++;
}
}



this code is not the complete one for my project but this can display about the bike condition on the lcd screen few more changes are to be presented in my next post.

Saturday, April 24, 2010

My project about to end

Its been a long long time since i wrote a blog . hmmm yes i am certainly busy with project. There are many things which i shd share firstly i shd share the problems that i had. First and the foremost is the problem due to loose connection about 2 days got wasted first was the loose connection was with whole circuit. I got the accelerometre output on lcd screen in my home but problem is that when i tried to show that to kotesh sir i could get it. I tried it for the whole day and still not good enuf at the end of the day when i tried to bend the circuit i found the output that was a big joke becoz on the whole day i couldn find the idea to do that more over lcd is showing some number that is 255 constantly which is actually misleading me .
Next problem was with rf previously i along with pragna done the rf module but i changed the ic this time i am using ht12d and e. And guess what i spent the whole day to get the link established that is vt of decoder but couldn do that even kotesh sir dont know this so he got that kit which he brought it frm outside and started comparing constantly at the end of the day the faculty who got all those kits came to us when kotesh sir asked him to check out the problem . he just came in and pressed the rf receiver inside and every thing started working well. Bull shit we wasted almost a day for this rit now i am doing with my accelerometer to get conformed when the bike fells down . It is on its way. I will try to complete by tomorrow

Tuesday, March 16, 2010

Runnn

Yes run as much as u can , as long as u can, with as much of fire as u have, taking all the support u have, That is what life is been teaching me since my child hood. What is this crap called burning desire it is crap for me because i am totally mistaken or mislead regarding the exact theme what burning desire is all about. Its been common thing happening to me , dreaming high and not working enough . This has been a regular comment that i make it for myself almost tired of doing this . Let me try to open myself surely i had ego . Yes its the ego which asks me why not u. Yes that ego well question me don't u have that capacity . Yes that ego lures me about the sweet taste of heights which can be felt after u reach your goal . That ego which will make my mother feel proud that finally my son is an achiever too. Yes that ego is good for me because it implants confidence in me.
Yup your failure or lagging will try to portray ur mistakes that u tend to commit because u only look at ur mistakes when u fail. Why shouldn't i look at my positives . It gets even difficult to recognize a positive thing when u fail it will be equally close to negative thing . And after all besides this recognition . Its also how u pretend and how u display ur self is equally important because its that ur whole physical body shows ur presence . And not but not the least ur words make impact too. I am down under for now , I am not making the most of things i had with for now . but this cant be guaranteed . Definitely i ll bounce back one day .. But i pray god that still even will persist with the same meaning of ego which i know right now...

Venting out some emotions , coz these blogs are more than inspiration for me so i share ,i learn ...............

Wednesday, March 3, 2010

I lost my pocket guide

This might be a strange heading to start with yesterday i lost my phone Nokia 3110c . Hmmm my phone is more that something which is help ful in keeping in touch with my friends. It has helped me in a lot of ways i bought it during early in my second year of b.tech . I loved it a lot despite of some problems . I ll try to ameliorate the way i lost my phone it was bizzaring one for me . I am writing my first internal of last semister of my engineering and i had two exams yesterday and it was during the second exam time was around 3.30 . After completion of the theory exam we were waiting for the objective type and suddenly Madhu my dearest friend started playing holi with my class mates and this Balakrishna sir (examination incharge ) . Came there running with objective papers in his hands and we rushed into class so as to complete the exam . Madu came to exam hall with the same hands and that was totally filled with colors he couldn catch the paper with his hand so he is trying to remove his cell phone in hes pocket to use as paper weight , and i just took my phone and i placed on his paper . I never thought that it is going to be the last time that i will touch my phone . Madhu in a mood to celebrate he went out as soon as he completed his and myself as if i am writing my exam superbly i was trying to attemt all the questions and forgot about my phone . I came out of the examination hall and i realized that my phone is not in my pocket immediately i asked madhu and he was too busy at that time . Initially i was not tense because i thought all the guys who are in the exam hall are my class mates and can be trusted enough . And guess what i am trying to call my phone answer is switched off. As i activated the call divert option ,message was not exactly Switched off . This is the last thing that can happen to me to loose the entire trust that i paid on my friends . Every one started to rush to their home .
I have to pity myself that other that the lecturer i had no one to suspect. Definately its totally absurd if some one of my class are the thiefs . Because i never had any tiffs with any of my class mates. Its been a long time since i lost anything other that a pen or a pensil . And this loss is hurting me alot because my cell phone has helped me a lot in learning english coz for every now and then i use to check out my english meanings . I mean i had english dictionary installed in it .................... GOD