Lamp control via the Internet

    Those interested in the details of manufacturing the device in the picture - please, under cat.

    For the sake of interest, I tried to connect the lamp to the computer and “drive” it programmatically. Since back in 2007 I did not want to bother much about this, I decided to connect the whole thing through an old lpt. The necessary details at that moment quickly to get it seemed possible only for him.

    So, the unit consists of hardware and software.

    Part 1. Hardware

    We will need the following details:
    1. table lamp 220 V (in the lead role);

    2. lpt-extension cord (in my case, it was not possible to quickly find it and had to assemble it from two lpt-plugs and a piece of wire);

    3. base board;
    4. angular lpt-connector on the board;
    5. 12 VDC relay;
    6. 4.7K resistor;
    7. NPN transistor KT3117A;
    8. diode IN4007;
    9. soldering iron;
    10. a bunch of wiring;
    11. power splitter in a PC


    The circuit diagram of the device is as simple as possible to assemble: The
    gray rectangle on top is a relay.
    If we supply unit D to pin D, voltage will appear on it and eventually the relay will switch by turning on the lamp.

    According to the above diagram, we solder something similar:


    We solder the board into the open circuit of our lamp; connect via lpt-extension cable to the corresponding port of the PC; connect to the power of the PC through the power splitter 11; Well, the lamp itself is 220 V.

    Part two. Software

    To revitalize our lamp, we will write a program in Delphi (the first thing that comes to hand is not difficult to rewrite in C, there are literally 3 lines of code in the program)

    Source: (this program can exclusively turn the lamp on and off by pressing a key).


    Having slightly modernized the program, we get the second source: (this program monitors the file, which can be changed by lamp2.php php script on the local web server).


    Now we can turn on our favorite lamp from anywhere in the world where the Internet is.


    Also popular now: