Touchscreen Controller for Your Bulb

2,770

20

Posted in TechnologyElectronics

Introduction: Touchscreen Controller for Your Bulb

Hello guys,

I wanna share my experiment with AT89LV55 from ATMEL on controlling my bulb with touch screeen,
the idea is simple, change my mechanic switch to touch screen to turn on my bulb.
Let's get started

Step 1: Prepare the Part for the Experiment....

In this experiment, I used some modules so I will not explain in detail on each module,
I only desribe on how they are working together as a system.

Now I'll make the list for the parts I need for this experiment :
1. The bulb, of course I need it, and the socket.
2. A plain wood board, you can buy it on your nearest hardware store,
3. Power supply from my computer.
4. AT89LV55 board with the chip
5. Relay module
6. Touch screen LCD, I'm using SD1289 as my controller
and
Let's rock and roll......

Step 2: The Language for Talking With This Chip

Guys,

I used Keil and C for coding into this MCS51 family,
I will not tell you on how to use C of course, since I wanna turn on the bulb....
hehehe...

I can't put all the codes here, since there're some libraries inside....very long...
So I just give a part of it...

For displaying the button on the touch screen, here's the code :

void button2_0_Handler()    /Bulb ON
{
    //do stuff associated with button2
//clear_screen();
    screenID=1;
bulb_ctrl=0;
DrawString(80,20, " LIGHT STATUS   ", YELLOW, BLUE, NORMAL);
DrawString(80,50, "                ", BLACK, BLACK, NORMAL);
DrawString(80,65, "    LIGHT ON    ", GREEN, BLACK, NORMAL);
DrawString(80,80, "                ", BLACK, BLACK, NORMAL);
    DrawString(80,110,"                ", RED, BLUE, NORMAL);
    DrawString(80,125,"    LIGHT OFF   ", RED, BLUE, NORMAL);
    DrawString(80,140,"                ", RED, BLUE, NORMAL);
    DrawString(80,170,"                ", BLACK, BLACK, NORMAL);
    DrawString(80,185,"                ", BLACK, BLACK, NORMAL);
    DrawString(80,200,"                ", BLACK, BLACK, NORMAL);
}

void drawscreen0()
{
    //Do screen 0 printing refreshing here
//clear_screen();
screenID=0;

DrawString(80,20, "    LIGHT STATUS     ", WHITE, RED, NORMAL);
DrawString(80,50, "                ", BLACK, BLACK, NORMAL);
DrawString(80,65, "    LIGHT OFF    ", GREEN, BLACK, NORMAL);
 
DrawString(80,80, "                ", BLACK, BLACK, NORMAL);
    DrawString(80,110,"                ", WHITE, RED, NORMAL);
DrawString(80,125,"   LIGHT ON     ", WHITE, RED, NORMAL);
    DrawString(80,140,"                ", WHITE, RED, NORMAL);
    
}

Step 3: Testing Your Experiment....

It's easy to test my experiment...
Only a single touch and I can turn on and off my bulb...
Job done :)

Good luck for your experiment...

Enjoy the video,

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    Comments