The project consists of software and hardware
Introduction:
This is my one year's Christmas lights controller I want to run through a set of Internet relay with EITHER IO24 module. The original project was completed several years ago. I added a wireless bridge on the network, so that it becomes a wireless controller Christmas lights. IO24 module is connected to a simple relay module, you can get some from the Internet
This module may be used for direct control over the TK GUI, the file can be read, in this example referred blink.blk, complex pattern will allow the drive
For this setup, I will relay 12 is connected to IO24 module, but you can easily add more relays. Using the format and the array of programming code should understand that anyone can be extended forward
It looks pretty simple, but I hope there are many versions can do it
It uses UDP format, did not check, so can not confirm whether the operation occurred.
Warning: Because Christmas is not critical for safety, so no handshake to verify that the command has been passed to the module, if used for other purposes, make the change before implementing, or lost packets may be injured
Step 1: Target / Status
1. Direct control of the TK TK graphical user interface on a graphical user interface
2. Able to create patterns from the file will automatically run in
3. Direct control files later allows you to write complex scripts to generate mode
4. Maintaining low cost and low complexity
1. At that time IO24 is a low cost solution (the project has 2 years)
2.PERL / TK free and easy to program and distribute
3. Commercially available plate connected to any relay board 24, so that the electrical connection is very simple
4. The entire system installed on the old PC chassis has 5-volt and 12-volt power supply to run the hardware
state:
• Basic c procedures and systems are in place and running well.
• Help, whats_next button does not work or do not need
• The current is limited to a IO24 on the network equipment
• Assume that all communications have been completed on the local network without consuming WAN side access routers (If you make changes, you can free to crack the code and re-release)
Step 2: Hardware Shopping List
1) find the master controller for PC or Raspberry pi
2) Elexol IO24 Ethernet IO Modules - "https: // www. elexol.com/IO_Modules/Ether_IO_24.php
3) Any logic relay interface board, you can find them in many places, for example, if you go to Amazon.com and type "relay board" there will be several in the search. There are some software available on Robotshop.com, you can search several other software on Google. Primarily to ensure that it has a 5-volt logic interface, which is used by the interface Elexol. To be well discussed in the appropriate section of the board, check out these links.
http://www.electronickits.com/kit/complete/elec/ck. .
4) find the old computer chassis with a power supply. For most of the relay board, you need 5-volt and 12-volt power supply. You can get these from Amazon, Fry's there, or may have been laying around the house.
5) all of the relays to provide a fuse to ensure that accidents do not happen, I use a fuse in each line 5 amp fuse for these fuses do not need a lot of current, make sure you do not overload the circuit total load. These can be found at Digikey, Amazon, Mouser or several other places. Also, make sure the fuse rating is lower than the rating of the relay
. 6) is connected to the relay power line. To save costs, I bought an extension cord, and cut off unwanted end. You can get these from Amazon or hardware store.
.
Step 3: Assembly Hardware
The good news is, since not too many components, it is now very easy to assemble. Elexol simply connecting member to the relay board, and blowing the fuse and power cable. The connection from the computer chassis to 5 volts Elexol plate, if necessary, will be connected to the relay board 12 volts. The use of computer power are some tips, please visit the following link https://www.instructables.com/id/How-to-power-up-a. .
Do not make debugging at the start of the relay connection to wall power, just use Elexol interface PC power supply can be tested, if all goes well, you will hear the relay clicks. To ensure that they all get stuck, using the ohmic resistor and checks on all the power plug is connected correctly.
High-voltage wiring must be very careful, be sure to use a lot of tape, and maintain all components are enclosed in the power supply box, do not forget fuse. When the wire away from the box, make sure there grommet to prevent the wire wear, which can cause problems in the future. To prevent the risk of electrical shock, before the high-voltage connection to the relay, please close the chassis, and the use of standard precautions when using high pressure at any time. If you do not know, before finding can help your people, please do not do this project.
Step 4: The software is pre-fix
If only the remote control, can be used to open the relay Elexol plate. However, if you want more control, you can perform the following steps.
1) Perl installed on your computer, Google will provide you with many examples on how to do this. If used for this purpose raspberry pie PI, it will already have Perl, but you must add TK extensions. You may also have to add IO :: Socket module. There may be some steps that can help you with this place on the Internet
2) Add attachments to computer
3) In most cases, you should be able to click on lightblink10 .pl, it will start. If not, you may have to go to the Windows input and type CMD. Then type "perl lightblink10.pl" in the CMD window it starts.
Step 5: Software button
Almost all attached picture shows the function of the program. Button on the right to open / close a single relay, and will enable the relay turns green. Left button having some debugging functions such as fully open, and the gate is stopped. Some of the buttons do not already have a picture function described.
Since this is the Internet project, the first task when using this interface is connected to the module. To do this, make sure Elexol module and the computer on the LAN side of the router. Installation things "fing" applications like on the iPhone to make sure that the module will be helpful on the Internet before you begin. When ready to begin, click the "Connect" button. If all goes well, the status will change to connected and the button will start operating.
In addition, depending on the configuration, your computer may appear firewall issues, I can set up any modification. You can see $ Port set to 2424 in the program, it is necessary to open the port on your computer.
The upper left corner of the file name is the input command file to be executed, and play_file button to begin the file, press the stop button or until the file is completed (whichever comes first)
Communication background
The program using UDP packets, and perform the connecting step is INADDR_BROADCAST, which is here, for finding the response of the IO24 module. The program assumes that the network is only one IO24 module, if there is more I do not know what will happen, it may be the last discovery of the first. Code can be modified in response to the input to the array to be extended to more modules. After capturing the IP address of the response, GUI will be to talk to the device. All communications are a simple way, without the need to ensure the completion of the handshake. Because of traffic jams paralyzed if the e-mail, you must send again.
Step 6: Write mode Blink.bk file
In front of the attached file are some examples, but here are broken down in the details of the file.
General Description:
• In general, as long as the comments included in the file, as long as the first character of each comment line are included in a #
•• the beginning of the file needs to have a speed command to set the speed is usually set to 10, the rate is between 10 seconds and 10 time units provided in the file
• There are two input formats to control relays
For more detailed information on the header data
• Keywords are not case sensitive
- at the beginning of a line is a comment #
-Tempo = NN, where NN is the temperature, integer
• 10 very common
-Loop = NN, where NN is an integer showing the number of times to repeat
For more details on the format
• For more information about lighting commands, there are two formats ts
• Complete address
• Direct addressing
• Complete lighting command format
• "Time" "| =" integer, "light" = "state" "value"
-Details
"Time" may be (time | t)
Integer 0-65000 may be, and must be continuous
"Light" may be (lNN | all)
Where NN is an integer from 1 to 12
"State" may be (blink | b) NN
Integer, where NN is 0-100
It is set to 100, the light remains lit.; set to zero when the light is not enabled.
• direct illumination of the format command
- (time | t) (| =) MM, h0xNNN
-Time | t is the command indicator
-MM time offset is an integer of monotone
-h0xNNN is hexadecimal values to command all of the lamps illuminated 0-12.
Example
Simple command to disable all the lights
t 0, all the flashes = 0
Enable simple commands all the time
1 time, all flashing 100
Shorthand notation using a simple command turns the lights 8
t 3, l8 = b 100
Forces all other simple commands to direct light mode
t = 5, h0xaaa
Editor in charge: WV, read full text
Our other product: