DIY do it yourself
Master classes, instructions, useful tips, recipes.
» »Manage devices from your PC desktop or over the Internet

Light control via the Internet.

Naturally, you can control not only the light, but also any other device from your computer or remotely via the Internet. One device or several.

For example, we will control the lamp.


Details of manufacture in the picture.

So, the unit consists of hardware and software parts.

Part 1. Hardware

We will need the following details:

1. Lamp 220 V;


2. lpt extension cable;


3. Fee;
4. angular lpt-connector on the board;
5. relay 12 VDC and voltage switching 220 volts;
6. 4.7K resistor;
7. NPN transistor type KT3117A or any other with a normal coefficient. gain;
8. diode;
9. The power splitter in the PC, if powered by a PC. But it is possible from another source with a voltage of 12 volts.


The device diagram is easy to assemble:


The gray rectangle at the top is the 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 scheme, we solder this:



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 came to hand is not difficult to rewrite in C, in the program there are literally 3 lines of code)

Source: /svetom/lamp_1.0.rar (this program can only turn the lamp on and off by pressing a button).
You can turn on the lamp or any other lamp from the computer!


Having slightly modernized the program, we get the second source:/svetom/lamp_2.0.rar (this program monitors the file, which can be modified by the 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.


Good luck

come back
Comments (19)
  1. phantom-111
    #1 phantom-111 Guests January 21, 2011 13:41
    1
    the idea is super! smile
  2. BAGZ
    #2 BAGZ Guests May 21, 2011 15:34
    0
    Can we do it through usb?
  3. NOTFRONT
    #3 NOTFRONT Guests May 21, 2011 18:05
    0
    Of course, take a USB to LPT adapter
  4. Co6epu_YA3uk
    #4 Co6epu_YA3uk Guests July 27, 2011 21:42
    0
    And if you use a relay on 28v, have to replace the diode?
  5. Veent
    #5 Veent Guests July 28, 2011 22:53
    0
    The diode is for protection, you can solder a little more powerful. Where on a computer do you find 24 volts? There will be less mark if you find a 12 volt relay. But if not, then you need a more powerful transistor, an external 24 V + PSU to Vdd - to the transistor emitter (without disconnecting it from GND)
  6. self-taught
    #6 self-taught Guests June 18, 2012 22:36
    1
    reels are in irons curling sensors of the photoswitch
  7. ruslan170777
    #7 ruslan170777 Guests July 1, 2012 11:03
    0
    who fumbles draw a diagram for 2 3 4 devices
    1. Dmitry
      #8 Dmitry Guests May 8, 2018 18:33
      0
      For each channel - the same scheme.
  8. Artyom 111
    #9 Artyom 111 Guests January 14, 2013 14:46
    0
    can we do via usb?
  9. 1
    #10 1 Guests December 17, 2013 07:56
    0
    On the diagram, indicate where to connect 12V.
  10. Sanya
    #11 Sanya Guests January 5, 2014 17:44
    0
    + 12 volts to the Vdd point to connect (between the diode and foot 2 relays)!
  11. Sergey
    #12 Sergey Guests January 16, 2014 00:11
    0
    Or maybe someone knows the names of analogues sold? Not LPT of course, it's stupidly simple. It should only be USB. I would buy and lay out a little scheme.
  12. Artyom
    #13 Artyom Guests February 3, 2014 8:11 p.m.
    2
    Quote: Sergey
    Or maybe someone knows the names of analogues sold? Not LPT of course, it's stupidly simple. It should only be USB. I would buy and lay out a little scheme.

    You take the old USB keyboard, take out the board, cut off the chip lock and solder the outputs to the relay, now we write a program for a couple of lines, which turns on the lamp, activating the scroll lock - done!
  13. Roma
    #14 Roma Guests February 26, 2014 19:44
    1
    The scheme works but through the program lamp 1, BUT when connected through the program Lamp 2, they say through the Internet does not plow, why?
  14. Roma
    #15 Roma Guests May 7, 2014 19:09
    0
    qde php script file?
  15. Vladimir
    #16 Vladimir Guests May 6, 2015 12:15
    0
    It is not controlled using the program Lamp1, I tried on Pascal under DOS everything works. What could be the problem?
  16. Leonid
    #17 Leonid Guests February 19, 2016 12:51
    0
    [b] Vladimir [/ b], if win 64 bits, look for the inpout32 library version 1.2
  17. Adham
    #18 Adham Guests May 6, 2016 18:02
    0
    On the lpt diagram, mom?
  18. denis
    #19 denis Guests June 22, 2016 20:07
    0
    The question is about the program, what exactly does the program do, does it send something to this port or simply activate it. I'm on c # more, I want to understand the implementation itself.

Read also

Error codes for washing machines