EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home

Dexter

  • Profile
  • Topics Started
  • Replies Created
  • Engagements

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 53 total)
1 2 3 4 →
  • Author
    Posts
  • November 4, 2012 at 3:34 pm in reply to: DS1307 RTC with 8051 ? comes while printing #8715
    Dexter
    Participant

    it seems the problem is either in programming

    or in i2c protocal

    no problem in hardware

     

    October 9, 2012 at 3:54 pm in reply to: usb direct interface 8051 ic #8655
    Dexter
    Participant

    not yet made

    8051 support uart

    not usb

     

    October 9, 2012 at 12:27 pm in reply to: RTC DS1307 interfacing with 8051 in C using I2C……. #8654
    Dexter
    Participant

    please copy  the image to pc and see .

    because web page is not able to show that fully  .

    i put up the screen snap directly

     

    October 8, 2012 at 12:44 pm in reply to: interfacing gsm sim300 modem with MC At89s52- doubt #8649
    Dexter
    Participant

    yes you have to inclide max 232 after mc 89c52

     

    make sure the cable rs232 internal wire rx tx gnd is connecter between the both max 232 in mc and sim 300

    April 6, 2012 at 4:29 pm in reply to: stepper motor… please help #7399
    Dexter
    Participant

    use gearde servo motor to have higher torque

     

    February 21, 2012 at 5:46 pm in reply to: Need help with Electronic code lock project #7192
    Dexter
    Participant

    wysiwyg_imageupload:3780:

    February 16, 2012 at 5:37 am in reply to: — #7181
    Dexter
    Participant

    Please do not irritate the help needers and helpers  like this

    wysiwyg_imageupload:3754:height=104,width=114

     

     

    February 16, 2012 at 5:15 am in reply to: interfacing leds with 8051 #7180
    Dexter
    Participant

    compiler

    wysiwyg_imageupload:3753:

    February 16, 2012 at 5:08 am in reply to: Compiler of 8051 #7179
    Dexter
    Participant

    compiler used

    wysiwyg_imageupload:3752:

    February 16, 2012 at 4:57 am in reply to: Need help with Electronic code lock project #7178
    Dexter
    Participant

    this may be useful

    c coding is the batter

    my working code

     

    #include <reg51.H>          //……………….headder file
    #include <stdio.h>          //……………….headder file
    #include <string.h>     //……………….headder file

    /*………………PIN CONNECTIONS…………………………………………………………….*/

    #define LCD_PORT P2        //……………….lcd data port to be connected
    #define    port0 P0        //……………….Port for keypad connection
    #define REL_PORT P1        //……………….relay connection port
    sbit    LED2=P3^3;        //……………….LCD PIN Connection
    sbit    EN=P3^7;        //……………….enable pin for LCD
    sbit    RW=P3^6;        //……………….write pin for LCD         
    sbit    RS=P3^5;        //……………….register select pin of LCD

    /*………………..Declarations ……………………………………………*/

    //………………..DELAYS………………………//

    void Delay_in_ms(unsigned char);    //……………..milli second delay is to be specifide
    void Delay_in_10ms(unsigned char);    //……………..10 * number of milli sec
    void Delay_in_1s(unsigned char);    //……………..number of sec

    //………………….LCD………………………//

    void lcd_init        (void);                    //………routine to initialise LCD
    void write_in        (unsigned char );        //………writes data in to LCD as instruction
    void write            (unsigned char );        //………writes one byte into LCD
    void printLcd        (unsigned char *);        //………prints a line on LCD
    void printLcd2        (unsigned char *);        //………prints a line on LCD
    void clear_display    (void);                    //………clears LCD screen
    void set_add        (unsigned char );        //………sets the display position
    void write_data        (unsigned char );        //………writes one byte into LCD as data

    //………………..relay………………………//

    void RELAY_GO(unsigned char ,unsigned char );    //…..selection of relay through keybord
    void relay_set(unsigned char);                    //…..selected relay ON or OFF            
    #define RON  1         //……………………………relay pin on state
    #define ROFF 0         //……………………………relay pin off state
    sbit RELAY1 = P1^0;    //……………………………relay one
    sbit RELAY2 = P1^1;    //……………………………relay two
    sbit RELAY3 = P1^2;    //……………………………relay three
    sbit RELAY4 = P1^3;    //……………………………relay four
    sbit RELAY5 = P1^4;    //……………………………relay five
    sbit RELAY6 = P1^5;    //……………………………relay six
    sbit RELAY7 = P1^6;    //……………………………relay seven
    sbit RELAY8 = P1^7;    //……………………………relay eight

    /* ………………password functions…………………*/

    char  key0 = ‘*’;            //……………………..MASK key press
    unsigned char key1;            //……………………..1 key press
    unsigned char key2;            //……………………..2 key press
    unsigned char key3;            //……………………..3 key press
    unsigned char key4;            //……………………..4 key press
    unsigned char key5;            //……………………..5 key press
    unsigned char key6;            //……………………..6 key press

    void relese_go(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char);
    void lock_go(unsigned char , unsigned char , unsigned char , unsigned char , unsigned char , unsigned char );

    /*…………………….4X4 keybord……………………*/

    // key select functions

    void select(void);                //……………………..selection of relay
    void locker();                    //……………………..lockre rootine
    void menu_1(void);                //……………………..function choose
    void menu_2(void);                //……………………..function choose
    void stop(void);                //……………………..system halt
    void sleep(void);                //……………………..system standby
    unsigned char keyS;                //……………………..selected key
    unsigned char keypad(void);        //……………………..key input
    void call_for_column(void);        //……………………..key routien work
    unsigned char getport0,col,row;    //…………………..key routien work
    unsigned char keypad_value;        //……………………..value of key
    unsigned char key[4][4] = { ‘1’,’2′,’3′,’R’,
                                ‘4’,’5′,’6′,’P’,
                                ‘7’,’8′,’9′,’L’,
                                ‘*’,’0′,’#’,’S’};

    //………………progam starts………………………………….//
    void main()
    {
        REL_PORT=0x00;                        //………initialising relay port
        lcd_init();                            //………initialising lcd port
        lock= ROFF;    
        clear_display();                    //………clear th display
            printLcd(”  Dexter8051  “);        //……..FOR PRINTING IN FIRST LINE
            printLcd2(” WELCOMES YOU    “);    //……..FOR PRINTING IN SECAND LINe
            Delay_in_1s(2);*/

            locker();
        }    
    }

    //……………..menu 1 select………………//

    void menu_1(void )
        {
        clear_display();
        printLcd (“RELAY :press R “);
        keyS= keypad();
        if(keyS==’R’)
                    {
                    select();
                    }
        else
            {
            clear_display();
            printLcd(“WRONG INPUT”);
            Delay_in_1s(1);
            menu_1();
            }
        }

    //…………on off select function………….//

    void select(void)
    {
        clear_display();
        printLcd(“Enter relay no:”);
        key1=keypad();
        write_data(key1);
        Delay_in_10ms(2);
        set_add(0xc0);
        printLcd(“PRESS # ON * OFF”);
        Delay_in_1s(1);
        key2=keypad();
        Delay_in_10ms(2);
        clear_display();
        RELAY_GO(key1,key2);
        Delay_in_1s(1);
        menu_1();
    }

    //…………………..relay to be on off select rooine…………//

    void RELAY_GO(unsigned char a,unsigned char b)
    {
        {
        if(a==’1’& b==’#’)
                    {
                    relay_set(1);// RELAY 1 on //calling relay_set function
                    }
    else if(a==’1’& b==’*’)
                    {
                    relay_set(2);// RELAY 1 off //calling relay_set function
                    }
    else if(a==’2’& b==’#’)
                    {
                    relay_set(3);// RELAY 2 on //calling relay_set function
                    }
    else if(a==’2’& b==’*’)
                    {
                    relay_set(4);// RELAY 2 off //calling relay_set function
                    }
    else if(a==’3’& b==’#’)
                    {
                    relay_set(5);// RELAY 3 on //calling relay_set function
                    }
    else if(a==’3’& b==’*’)
                    {
                    relay_set(6);// RELAY 3 off //calling relay_set function
                    }
    else if(a==’4’& b==’#’)
                    {
                    relay_set(7);// RELAY 4 on //calling relay_set function
                    }
    else if(a==’4’& b==’*’)
                    {
                    relay_set(8);// RELAY 4 off //calling relay_set function
                    }
    else if(a==’5’& b==’#’)
                    {
                    relay_set(9);// RELAY 5 on //calling relay_set function
                    }
    else if(a==’5’&b==’*’)
                    {
                    relay_set(10);// RELAY 5 off //calling relay_set function
                    }
    else if(a==’6’&b==’#’)
                    {
                    relay_set(11);// RELAY 6 on //calling relay_set function
                    }
    else if(a==’6’& b==’*’)
                    {
                    relay_set(12);// RELAY 6 off //calling relay_set function
                    }
    else if(a==’7’& b==’#’)
                    {
                    relay_set(13);// RELAY 7 on //calling relay_set function
                    }
    else if(a==’7’& b==’*’)
                    {
                    relay_set(14);// RELAY 7 off //calling relay_set function
                    }
    else if(a==’8’& b==’#’)
                    {
                    relay_set(15);// RELAY 8 on //calling relay_set function
                    }
    else if(a==’8′ & b==’*’)
                    {
                    relay_set(16);// RELAY 8 off //calling relay_set function
                    }
        else
                {
                  clear_display();
                printLcd(“WRONG INPUT KEY”);
                }
            }
    }

    //…………………LCD Routines…………………..//

    //routine to initialise the lcd
    void lcd_init(void)
    {        
        write_in(0x38);          //to make lcd
        Delay_in_ms(1);
        write_in(0x0f);          //to make lcd to select 5×7 matrix display
        Delay_in_ms(1);
         write_in(0x01);          //to make lcd to clear the display
        Delay_in_ms(1);
        write_in(0x80);          //to make lcd cursor to bigining of first line
        Delay_in_ms(1);
    }
    //routine to write an instruction to LCD
    void write_in(unsigned char ch)
    {
        RS=0;                //rs =0 for instr
        RW=0;            
        write(ch);            //routine to transfer 8 bits to LCD
    }
    //routine to transfer 8 bits to LCD module
    void write(unsigned char ch)
    {
        LCD_PORT = ch;        //preserves the old value of port
        EN = 1;                //enable pin high
        Delay_in_ms(1);
        EN = 0;                //enable = 0
    }
    //clears the entire display area of LCD
    void clear_display(void)
    {
        write_in(0x01);            //clears the lcd display
        write_in(0x80);            //write code to blink at first line first coloum
    }
    //printing rootin
    //routine to display the value in the accumulator in LCD
    //routine to display a string on first line
    //this routine will display a string stored at address pointed by dptr
    void printLcd(unsigned char *str)
    {
        unsigned char len,i;
        len = strlen(str);
        set_add(0x80);                //sets display position in first line
        for(i=0;i<len;i++)
        {
        write_data(*str);        //displays the character on LCD
        str++;
        }
    }
    void printLcd2(unsigned char *str)
    {
        unsigned char len,i;
        len = strlen(str);
        set_add(0xc0);        //sets display position in second  line
        
        for(i=0;i<len;i++)
            {
                write_data(*str);    //displays the character on LCD
                str++;
            }
    }
    //routine to set the display position
    void set_add(unsigned char ch)
    {
        write_in(ch);        //writes it as instruction
    }
    //routine to write a data to LCD
    void write_data(unsigned char ch)
    {
        RS = 1;
        RW=0;            
        write(ch);            //……….transfers 8 bits to lcd module    
    }
    //ms delay in milli secand
    void Delay_in_1s(unsigned char ms)//……………..number of secands
    {
        int t;
        t=ms;
        {
        unsigned int i;
        for(i=0;i<t;i++)
        {
        Delay_in_10ms(10);
        }
        }
    }    
    void Delay_in_10ms(unsigned char ms)//……………..milli sec * 10
    {
        int t;
        t=ms;
        {
        unsigned int i;
        for(i=0;i<t;i++)
        {
        Delay_in_ms(100);
        }
        }
    }    
    void Delay_in_ms(unsigned char ms)//……………….milli sec
    {
        int t;
        t= ms;
        {
        unsigned int i,j;
        for(i=0;i<t;i++)
        for(j=0;j<120;j++);
        }
    }
    //…………..key board processes……………..//

    unsigned char keypad()
    {
        do
        {
            do
            {
            port0 = 0x0f;
            getport0 = port0;
            getport0 = getport0 & 0x0f;
            }while(getport0 != 0x0f);
        
        getport0 = port0;
        getport0 = getport0 & 0x0f;
        }while(getport0 !=0x0f);
        
        while(1)
        {
                port0 = 0xef;
                getport0 = port0;
                getport0 = getport0 & 0x0f;
                if(getport0 != 0x0f)
                {
                    row = 0;
                    call_for_column();

                    break;
                }
                port0 = 0xdf;
                getport0 = port0;
                getport0 = getport0 & 0x0f;
                if(getport0 != 0x0f)
                {
                    row = 1;
                    call_for_column();
                    break;
                }
               
                port0 = 0xbf;
                getport0 = port0;
                getport0 = getport0 & 0x0f;
                if(getport0 != 0x0f)
                {
                    row = 2;
                    call_for_column();
                    break;
                }
               
                port0 = 0x7f;
                getport0 = port0;
                getport0 = getport0 & 0x0f;
                if(getport0 != 0x0f)
                {
                    row = 3;
                    call_for_column();
                    break;
                }
        }
    keypad_value = key[row][col];
    return keypad_value;
    }
    void call_for_column()
    {
        while(1)
        {
            if(getport0 == 0x07)
            {
                col = 0;
               
                Delay_in_10ms(3);
               
                break;
            }
            else if(getport0 == 0x0b)
            {
                col = 1;
               
                Delay_in_10ms(3);
               
                break;
            }
            else if(getport0 == 0x0d)
            {
                col = 2;
               
                Delay_in_10ms(3);
               
                break;
            }
            else if(getport0 == 0x0e)
            {
                col = 3;
               
                Delay_in_10ms(3);
               
                break;
            }
        }
    }

    //……….relay switching processes……………..//

    void relay_set(unsigned char relay)
    {
        int x;
        x= relay;
         switch (x)
        {
        case 1:            //………………..RELAY 1 OFF
       RELAY1= RON;
           printLcd(“RELAY 1 ON “);
        break;
        case 2:            //………………..RELAY 1 0N
       RELAY1= ROFF;
        printLcd(“RELAY 1 OFF”);
        break;
        case 3:            //………………..RELAY 2 OFF
       RELAY2= RON;
       printLcd(“RELAY 2 ON “);
        break;
        case 4:            //………………..RELAY 2 0N
       RELAY2= ROFF;
       printLcd(“RELAY 2 OFF”);
        break;
        case 5:            //…………………RELAY 3 OFF
       RELAY3= RON;
       printLcd(“RELAY 3 ON “);
        break;
        case 6:            //………………..RELAY 3 0N
       RELAY3= ROFF;
       printLcd(“RELAY 3 OFF”);
        break;
        case 7:            //………………..RELAY 4 OFF
       RELAY4= RON;
       printLcd(“RELAY 4 ON “);
        break;
        case 8:            //………………..RELAY 4 0N
       RELAY4= ROFF;
       printLcd(“RELAY 4 OFF”);
        break;
        case 9:            //………………..RELAY 5 OFF
       RELAY5= RON;
       printLcd(“RELAY 5 ON “);
        break;
        case 10:            //……………….RELAY 5 0N
       RELAY5= ROFF;
       printLcd(“RELAY 5 OFF”);
        break;
        case 11:            //……………….RELAY 6 OFF
       RELAY6= RON;
       printLcd(“RELAY 6 ON “);
        break;
        case 12:            //………………..RELAY 6 0N
       RELAY6= ROFF;
       printLcd(“RELAY 6 OFF”);
        break;
        case 13:            //………………..RELAY 7 OFF
       RELAY7= RON;
       printLcd(“RELAY 7 ON “);
        break;
        case 14:            //………………..RELAY 7 0N
       RELAY7= ROFF;
       printLcd(“RELAY 7 OFF”);
        break;
        case 15:            //………………..RELAY 8 0FF
       RELAY8= RON;
       printLcd(“RELAY 8 ON “);
        break;
        case 16:            //………………..RELAY 8 0N
       RELAY8= ROFF;
       printLcd(“RELAY 8 OFF”);
        break;
        }
    }

    //…………..locker password code…………….//

    void locker(void)
    {    
        clear_display();
        printLcd(“ENTER PASSWORD”);
        set_add(0xc0);
        key1=keypad();
        write_data(key0);
        key2=keypad();
        write_data(key0);
        key3=keypad();
        write_data(key0);
        key4=keypad();
        write_data(key0);
        key5=keypad();
        write_data(key0);
        key6=keypad();
        write_data(key0);
        lock_go(key1,key2,key3,key4,key5,key6);
    }
    //……………………..lock code ………………………//

    void lock_go(unsigned char a, unsigned char b, unsigned char c, unsigned char d, unsigned char e, unsigned char f)
    {
        if(a==’1′ & b==’2′ & c==’3′ & d==’4′ & e==’5′ & f==’6′)
                {
                clear_display();
                printLcd(“CORRECT PASSWORD”);
                printLcd2(“LOCK IS OPEN”);
                Delay_in_1s(1);
                menu_1();
                }
        else
            {

            locker();
            }
    }

    February 16, 2012 at 4:20 am in reply to: 8051 Microntroller interfacing with IR sensors #7177
    Dexter
    Participant

    ir circuit

    this will be useful to u

    wysiwyg_imageupload:3751:

    February 16, 2012 at 4:13 am in reply to: my robot lost the SOCCER match(RF problem) #7176
    Dexter
    Participant

    zigbee can send and  Receive datas like serial port .

     

    February 15, 2012 at 8:23 pm in reply to: servo motor control through keypad input–enquiry of components #7173
    Dexter
    Participant

    11.0592mHZ wysiwyg_imageupload:3750:

    February 12, 2012 at 3:38 am in reply to: Serial communication in lcd #7151
    Dexter
    Participant

    YES IT IS POSSIBLE WITH THE SOFTWARE

    wysiwyg_imageupload:3748:

    February 11, 2012 at 4:09 am in reply to: frequency for Automatic bidirectional visitor counter using 8051 microcontroller (AT89C51) #7150
    Dexter
    Participant

    use xtel

     

    11.0592

     

     

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 53 total)
1 2 3 4 →

RSS Recent Posts

  • Silicon insulated wire January 19, 2026
  • Unable To Get Advertised Op-Amp Slew Rate January 19, 2026
  • Op amp shock January 19, 2026
  • My Advanced Realistic Humanoid Robots Project January 18, 2026
  • Sine wave distortion January 18, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise