Purpose
Introduce a commercial home automation program.
Description
Home Domination is Windows home automation software that supports the U401 and U421 devices. With Home Domination you can create powerful macros that can be triggered by inputs connected to U4x1 devices as well as by X10 signals or trigger at selected times. You can control U4x1 devices or X10 devices and there are numerous other macro actions that let you take snapshots from video devices, send email, play sounds, start other programs, and more. It has a remote client as well so you can control your U4x1 devices from anywhere in the world!
Home Domination Screen Image
Hardware
The U401 or U421 USB Interface devices can be used to control low voltage wiring. The U401 and U421 USB Interface can be used to attach 1-wire devices (from Dallas Semiconductor). Currently, there is support for the DS18S20, DS18B20, and DS1822 temperature sensors.
Obtaining Home Domination
StrandControl (www.homedomination.com).
Amp It Up!
This app note created in part by StrandControl and those parts are used with permission.
Introduction
This tutorial shows how you can build a small relay interface board so that you can use the U4x1 devices to control circuits that require more current or a higher voltage than what the U4x1 devices can provide directly. This tutorial is meant to help anyone using the U4x1 devices with custom software or with Home Domination. The design can be implemented as is, or it can provide a starting point for more complex implementations.
Design Overview
The U4x1 devices have a limited ability to provide current when their i⁄o lines are configured as outputs. The i⁄o lines should not be connected to voltages higher than 5V.
A relay provides a way to control (switch on or off) devices with voltage and current ratings that are greater than the capabilities of the U4x1. The relay in this design can switch a 30V (maximum), 1A (maximum) circuit. The 5V relay coil uses about 40 mA of current provided by the Darlington switch in the 2803.
This application consists of a small circuit card containing screw terminals to interface to a U401 or U421 as well as the controlled circuit, the 2803 driver, relays, and relay state indicating LEDs. The card developed in this application provides four channels of relay control.
Schematic
The schematic above shows one of the four relay⁄LED channels implemented in this design. The 2803 makes a switched connection to ground. When activated, current flows through the relay and activates the relay contacts. The LED associated with the relay is also turned on.
Project Parts
The relay board can be assembled in many different ways. A specific custom printed circuit board could be designed with a PCB layout program. The PCB could then be ordered from a PCB production house.
For this app note, however, I chose to use point-to-point wiring on a simple prototype PCB board. The board provides a “sea of holes” that are on one tenth inch centers. The components that I chose for this application have leads that have the same spacing.
Pictured above are all of the components for the example prior to assembly. The yellow wire in the photo is a short piece of Wire-Wrap wire that I used for all of the point-to-point connections. I didn’t wire wrap the circuit, I just used Wire-Wrap wire to make the point-to-point connections.
Description | Part Number | Source |
PCB | 14167-PB | Marlin P. Jones (www.mpja.com) |
TQ2-5V Relays | 255-1001-5-ND | Digikey (www.digikey.com) |
Screw terminals | 277-1274-ND | Digikey (www.digikey.com) |
ULN2803 | ULN2803AP-ND | Digikey (www.digikey.com) |
24 pin DIP socket | AE8918-ND | Digikey (www.digikey.com) |
18-pin DIP sockets | AE8924-ND | Digikey (www.digikey.com) |
1k resistors | unspecified | Digikey (www.digikey.com) |
LEDs | unspecified | Digikey (www.digikey.com) |
Wire-Wrap wire or suitable 30 gauge wire |
unspecified | Digikey (www.digikey.com) |
The majority of the parts are components that I keep in stock for general prototype use. The specifics about which DIP sockets, resistors, and LEDs to use do not matter much to this design. A different size or type of PCB board could be used, larger or different color LEDs, and even different types of relays. Consideration should be made for driving the relays with the right voltage and sufficient current. Parts appropriate for this app note can be obtained from a variety of vendors.
The circuit card is from Marlin P. Jones (www.mpja.com). It is #14167-PB. MPJA can also provide some of the other components, such as LEDs.
The relays are NAIS TQ series relays. The relays that I chose to implement in this design are TQ2-5V. The screw-terminals in the photo above (green) have .1 inch spacing between the leads. I use a small “precision” screwdriver with these screw terminals, since they are rather small. These relays and terminal blocks are available from Digikey (www.digikey.com). The relays are Digikey part number 255-1001-5-ND, the screw terminals are 277-1274-ND. Most of the parts (other than the PCB) for this project can be obtained from Digikey.
Larger screw terminals are also available that have .2 inch lead spacing. They can still be used with the PCB described in this project.
The relays used in this app note switch 30V max 1A max. The coil voltage for the relays is the 5V from the USB supply. The coils use 40mA.
A relay that can switch more current (5 amps) such as the Omron G6DS-1A-DC5 (Z2317-ND at Digikey) could also be used. This relay has a different form-factor, and therefore will not fit into the DIP sockets.
Relays that use a coil voltage higher than the 5V supplied by USB would need to have that voltage supplied by a different power source. Using a relay such as the Panasonic DR-12V would mean adding another screw terminal to the design to provide a source for the coil’s 12V.
The coils for the relays are switched by the 2803. The maximum current that the 2803 can switch is in the 2803 data sheet for the manufacturer of the specific 2803. This defines the limits to the current and voltage of the relay’s coil.
Placement
The PCB needs to be large enough to comfortably hold the components. This PCB has holes in a 24 by 31 pattern, minus nine holes in each corner. The holes are on a .1 inch center spacing pattern.
The corner holes are 1⁄8th inch mounting holes.
I was confident that the board that I selected would have enough room to hold all of the components. I placed the components on the board to play a bit with the orientation. I chose the “portrait” orientation pictured above.
Assembly
The sockets, terminals, LEDs, and resistors were soldered in place on the board. Each component lead is soldered in place to the copper donut on the back of the PCB. That copper will hold a small amount of solder that makes an electrical connection to the component lead.
The Wire-Wrap wire is cut to length for each particular point-to-point connection. A small amount of the insulation is removed from each end of the wire. The solder on the donut⁄lead is heated with a fine-tip soldering iron and the lead is inserted into the melted solder. Most connections are only a single wire attached to a lead. Care must be made to not lose a previous connection when an additional wire is added to a connection that needs two wires.
Black, red, yellow, and bare Wire-Wrap wire was used for all of the point-to-point connections as can be seen in the photo and graphics above. Bare wire was used for the short connections where convenient.
Final Hardware and Test
Once assembled, 5V and ground were applied to the board. Each relay⁄LED was tested by applying 5V to the input⁄control line of the 2803.
Connection of the Relay Board to a U4x1
The relay board can be connected to either a U401 or a U421. The top set of screw terminals should be connected to the U4x1, while the side screw terminals connect to the circuit that the relay board controls.
“Ground” and “power” connect to the U4x1 ground and +5V respectively. The relay control lines, A, B, C, and D connect to the data lines of the U4x1. The U4x1 data lines would be set to output.
Home Domination can now control higher voltage⁄current devices.
Controlling the Relay Board in Home Domination
To use the relay board in Home Domination, it’s best if you plug in the U4x1 and relay board before you start Home Domination. Then, when it starts, it will automatically detect all the devices. Then, you should start Home Domination and click Setup, then click Device Setup. Click the + sign next to “U401⁄U421 Direct I⁄O” and you should see a listing for each U4x1 device attached. The following example shows what it will look like if you have 3 devices.
Now click the + sign next to one of the devices you want to configure. You should see something like the following, where you have two ports, A and B, and each port has 8 data bits. Initially, everything will be set as Input.
To control a relay you will need to change it to Output and add a “Switch” so it will show up in the switch tab on the main dialog, configured so it can be controlled. To change a bit to output or to add a sensor or switch, just double click on a bit, or single click and click Change. Then select Output. You can change the On Value and Off Value, in case the device you have attached uses inverted logic, and you can change the value that it will default to on startup.
This example shows how to set it up so you can control the relay labeled “doomsday device”, which is of course quite necessary if you want to use Home Domination and this relay board to dominate the world. When you click Add Switch, the following window will appear:
A paddle switch is for devices where one bit is pulsed on and off to turn the device on and another bit is pulsed on and off to turn the device off. A regular switch uses only one bit and it simply turns it on or off.
When you click Switch and then click Select, the following window appears with the Device Type, Port and Bit already filled in for you, so all you have to do is set the name to what you want and click OK and it will add it for you.
When you click Add Sensor, you will get a similar dialog. If you’re curious what those other fields are for, or wondering how to set up a paddle switch, just click F1 when you’re in that window and it will tell you all about it.
If you want to change all 8 bits to output or back to input, you can do it easily by selecting the Port (A or B) and clicking Change. This will bring up the following window where you can change the Input or Output type, and it will automatically change it for all the bits. Here you also have the option of treating the port as a single number rather than individual bits. This may be handy if you want to use the U4x1 to pass in a numeric value, perhaps for analog to digital applications. The value can be used in macros by using the compare ability in a sensor trigger.
Once you’ve set up all your sensors and switches in this way, they will appear on the Sensors and Switches tab. If you have the remote network client set up, then you can detonate your doomsday device from the safety of another country, or you can create a macro to watch one of your sensors and detonate the device when Mr. Bond approaches it without using his fancy gadgets. Remember, doomsday devices may harm the environment, so you might want to consider taking over the world with annoying noise instead.
Temp Sensors
This app note created by StrandControl and used with permission.
This app note deals with how to set up a temperature sensor using StrandControl’s Home Domination.
Hardware Setup
Home Domination can support several types of 1-Wire temperature sensors from Dallas Semiconductor. Currently, the DS18S20, DS18B20 and DS1822 are supported.
Techy Tidbit: The DS18S20 and DS18B20 are accurate to +- a half degrees Celsius. The DS1822 is less accurate, within +- 2 degrees Celsius, but is cheaper. The DS18S20 reports the temperature in half degrees Celsius (roughly 1 degree Fahrenheit) and the DS18B20 and DS1822 report the temperature in 16ths of a degree Celsius (about a 10th of a degree Fahrenheit).
To attach the temperature sensor to the computer, you’ll need to attach it to one of the USB interfaces devices from USBmicro: U401, U421, or U421-SC3. They all work identically, however, the U401 is in a “SimmStick” format which is about a 1 inch (26 mm) wide by 3.5 inches (88 mm) long. The U421 is in a “DIP-like” format, which is about 3⁄4 of an inch wide (19 mm) by about 1.5 inches long (38 mm). The U421-SC3 is identical to the U421 except that it has a screw terminal soldered onto it so you can attach temperature sensors without having to solder. To use the screw terminals, you’ll need a very small screwdriver like the kind you use on eye glasses.
First, you’ll need to find out which pins on your temperature sensor are the Power (VDD), which is the Ground (GND) and which is the Data pin (DQ). Use the following links to get to the technical information for your temperature sensor.
DS18S20: pdfserv.maxim-ic.com⁄en⁄ds⁄DS18S20.pdf
DS18B20: pdfserv.maxim-ic.com⁄en⁄ds⁄DS18B20.pdf
DS1822: pdfserv.maxim-ic.com⁄en⁄ds⁄DS1822.pdf
Then you’ll need to solder the temperature sensors to the appropriate pins of the U401 or U421, or you can use the screw terminal on the U421-SC3 or solder it into one of the other pins. See the section below for the USBmicro device you have to determine what pins to use.
You can attach multiple temperature sensors to the same data pin (with version 148 or greater of Home Domination). So in the case of the U421-SC3, you can attach multiple temperature sensor devices using the same screw terminal. Also, if you want to have several temperature sensors throughout the house, you can attach them to the same wire in different locations. According to Dallas Semiconductor’s 1-Wire documentation, the distance can be up to 300 meters with a suitable master circuit.
If you purchase a USBmicro device on or after January of 2006 (firmware version 1.46 or greater) you can wire all the temperature sensors at once, and when you install them in Home Domination, all of the devices on the wire will be listed, and you select each one. If you have an older USBmicro device, you can still use multiple temperature sensors on a single wire, but you will need to attach them one at a time and add them into Home Domination, making sure to select the ID that it reads. Once all the temperature sensors you intend to use on the wire have been individually added to Home Domination, you can then wire all the temperature sensors to the same data pin.
U401 Pinouts
Pin 1 on the U401 is located on the left, as you look at the board in the orientation above. Pin 30 is the pin on the far right. Note that all lines extend from J1 to J2. There are then some J1 lines that only connect to J2 and no other circuitry.
U421 ⁄ U421-SC3 Pinouts
Except for the screw terminal, the U421 and U421-SC3 are exactly the same. Pin 1 on the U421 is located on the lower left, as you look at the board in the orientation above. Pin 24 is the pin on the upper left. The lower row, therefore, is 1-12, the upper row is 24-13.
U451 Pinouts
Temperature sensors can be connected to Port A, bits 0 – 7. Port B, bits 0 and 1 control the on-board relays, and Port B, bits 2 – 7 can be tied directly to additional external 5V relays.
Setting Up Temperature Sensors in Home Domination
To add a temperature sensor to Home Domination, it’s best if you have a temperature sensor already connected to a USBmicro USB controller and have the USBmicro controller plugged into the computer before starting Home Domination.
If you’re creating a new control file, on the “Choose Computer Interfaces to Use” dialog, simply check the “1-Wire Temperature Sensor” check box. This will add a temperature sensor using the first USBmicro device it finds, using data bit 5 (the one that the screw terminal is set up for on the U421-SC3). It will also add a sensor so it will appear in the sensors tab. If you need it to use a different USBmicro device or a different data bit, then click the Device Setup, look for the “Temperature Sensors (1-Wire)” line, click the + so the devices show, select the device, and click Change. Here you will be able to change the device or pin that is used, and you can also change whether it uses Celsius or Fahrenheit, and you can change how often it checks for temperature changes. It takes about a second for it to read the temperature, so you cannot check the temperature more than once per second.
If you already have a control file set up, you’ll need to go under Setup, then click Device Setup, select the “Temperature Sensors (1-Wire)” line, and then click the Add button. This adds a temperature sensor device that uses the first USBmicro device, and data bit 5. To change this, click the + button to show the devices, highlight the device and click the Change button. Then change the USBmicro device or the data bit to use, or whether to use Celsius or Fahrenheit, and you can change how often it checks the temperature.
If you want to use multiple temperature sensors on a single data pin, each temperature sensor will have to be added as a separate temperature sensor device, but you will specify the same USBmicro device and data pin. In order for it to work correctly however, you will need to assign the specific device id for each temperature sensor.
If you have a USBmicro device that was purchased on or after January of 2006 (firmware version 1.46 or greater), when you can click change on a specific temperature sensor under the “Temperature Sensors (1-Wire)” line, it will show you the ids of all the 1-Wire devices that are connected to a particular data pin. If you change pins, you will need to click the Update button to rescan the device. Select a serial number in the “Connected 1-Wire Device” list and click Select. This will instruct Home Domination to use that particular sensor when checking its temperature. Each temperature sensor should select a different serial number to use.
If you have a USBmicro device that was purchased prior to January of 2006 (with a firmware version < 1.46), you can still use multiple temperature sensors on a single wire, but it’s more difficult to set up. You will need to only attach one temperature sensor to the wire at a time until Home Domination has the serial number for each device selected. To set up temperature sensors, you would still add a separate temperature sensor device for each device on the wire, but you must do it one at a time. This will read the serial number of the device on the wire, and then you can select it. Then you would remove that device from the USBmicro device, attach the next temperature sensor to use, edit your next temperature sensor device in Home Domination and select the serial number to use (it can list only one). Once all of the temperature sensors have individually been set up, then you can attach all of the temperature sensors to the same wire, and it will use the previously detected id to individually address each temperature sensor.
You can change the name of the temperature sensor that gets added by clicking change on the Sensors tab, or you can do this under Setup and click Sensors and Switches. You can use this sensor in macros too. If you want a macro to act as a thermostat, you should set up two macros–one to turn a heating device on when it’s below a certain temperature, and another to turn the device off when it’s above a certain temperature (and vice-versa if it’s controlling a cooling device).