108 Relays

Last update:
Sep 10/10

      

Building a K145 Temperature Controller

Note: this is very much a do-it-yourself project. A circuit diagram and some description are provided, but there is no detailed how-to. It is assumed that you can read circuit diagrams, and have some experience in constructing circuits on your own.

The serial port has its origins in connecting a pc to a modem, so that data communications could be carried over a phone line (see this site: http://www.arcelect.com/rs232.htm  for more info on the serial port). Not only was data sent and received (through the txd and rxd lines), but the modem and pc were able to talk to each other. Simplistically, the modem, being connected to the phone line, could tell the pc when a phone call was received., and the pc could tell the modem when it had data to send. 

In this project, we make use of this “talk” ability between pc and modem – specifically using the DTR and RTS lines to send control signals to a couple of relays. The K145 only sends data (using the rxd line), so the txd line is also available for use – we’ll take this line to control power to the K145. 

What we're doing here is building an add-on board that incorporates the relay control and the power switch for the K145 board.  The only modification to the K145 itself is where the board gets its power supply from.

  This is the completed add-on board,   
mounted on top of the K145 case.  
See here for an article about putting   
the K145 board into an enclosure. 
Software for this temperature controller  
 is available here. .
10mod.jpg (103795 bytes)

  


Power for the K145 Board

This is the K145 circuit, as supplied by Kitsrus:

Notice that the K145 uses only 3 lines on the serial port… 
  - Signal ground on pin 5 of the DB9 connector
  - Data signal out to the pc on the RXD line (pin 2 on the DB9)
  - Power to the K145 board from the DTR line (pin 4 on the DB9)  

We want to use the DTR line to control a relay, so power for the K145 will have to come from some other source. The relay circuitry will need an external power supply, which can also be used to feed the K145 board. 

But… the K145 starts sending data as soon as it’s powered up. From experience, I’ve learned that connecting to the K145 when it’s already sending data can cause problems – frame errors, not reading the data correctly, and so on. We want to control when power is applied so we can verify the board’s presence (as in the existing K145TMLite software), and be ready to receive data. 

What we do here is a bit of a trick – we send a long data word repeatedly over the TXD line, using it as a control signal. We filter and smooth it, and use it to drive a transistor switch which can turn on/off power to the K145 board. The idea is similar to a vox circuit, where an audio/voice signal is used to control a relay (see K126 for an example). 

This is the K145 circuit with the transistor power switch added:  
  

How it works:
The NPN 2N4401 acts as a standard switch, which when turned on connects a load to ground. But lifting the ground of the K145 might cause problems. So we invert the 2N4401 switch output using the PNP 2N4403, and switch the load on the V+ side instead. The 1N4004 and the 2.2uF capacitor provide rectification and smoothing for the varying data signal that drives the switch circuit. 

  

Relay Control  

  

This is fairly straightforward: one side of the relay is connected to V+, and the other tied to the transistor switch. The transistor is switched “on” by applying a positive voltage to the base (the 10K acting as a current limiter), which drives the transistor into saturation. When it goes on, the bottom end of the relay is pulled to ground, and the coil is energized. 

The 1N4004 prevents the back emf (generated when power is removed from the relay coil) doing damage to the circuit. The LED is a convenience – providing a visual indication when power is applied to the relay coil. 
 

 

Putting it all together
The full circuit includes the K145 power switch, a couple of the relay control circuits, and a bit of power protection and filtering. 

  

  

Construction
(**The information and pictures presented here are for inspiration. It’s assumed the constructer will choose their own assembly and installation methods.) I used a variation on the Vero stripboard as the platform for mounting components. My K145 board had already been installed into a case, so the add-on board was piggybacked on top of that. See here for an article about mounting the K145 board into an enclosure. 

  

   
     
   

Construction considerations
o)  I used SPDT relays, because that’s what I had available. Using DPDT instead could be an advantage though, depending on what you want to switch. If you are running DC fans that are reversible by changing polarity, then a DPDT relay will give that ability. Goodsky have a relay information page: http://www.goodsky.com.tw/e-relay-adopt.htm  that may be useful in selecting what relay to use. 

o)  Whatever the contact rating of the relays you use, if you mount them on some kind of pc board, the connecting traces will be the limiting factor for carrying current. You can beef up the traces with jumper wire and extra solder, but there’s only so far you can go with that. Turning a small fan on/off isn’t too much of a load, but an electric heater most certainly would be. It’s best to consider these relays as first-stage switching – use them to switch heavy duty relays that can more safely carry the required load current. 

o)  Relay coils do get warm when they are energized for extended periods of time. Depending how the relays are mounted, some form of ventilation may be in order. 

o)  Relay coil current… the relay circuits are designed to switch 30 ma coils. If you go to a larger relay, coil current seems to increase to typically 75 ma. The 10K resistors in the base line should be reduced to 4K7 (see the circuit diagram above). 


Parts
Most of the parts used are standard types and values. There shouldn’t be any problem finding them at your favorite parts supplier. Of note are the relays and terminal blocks. These I scrounged from a K74 relay kit that I hadn’t put together yet. 

Futurlec have relays and terminal blocks…
- “Dip” relays: http://www.futurlec.com/RelDip.shtml  
- terminal blocks: http://www.futurlec.com/ConnTerm.shtml  

Kitsrus carry a relay board: “K156 Dual Hi/Lo Switched Relay Board” This kit could take the place of all the relay control components in the circuit diagram, which might help simplify construction. 

See here for a partial list of Kitsrus kit distributors.  

  

Known Issues
o)  As with the Parallel Port, the computer bios exercises the Serial Port lines at system boot up. The K145 Controller has no latching mechanism, so you will hear relays clicking (and see LEDs flashing) at bootup, and possibly at system shutdown as well.

o)  The full monitoring software (K145TMLite) isn’t compatible with this circuit – it’s designed to feed power from the DTR line to the K145. There is a workaround, which is to add a SPDT switch in the circuit such that you can select whether the DTR line feeds the K145 or R1 (see diagram below).
  

 

 

 

Information and images are copyright © 2008 by John Gray  

   top

  

 

                                                                                           Copyright © 2007 -  2009 by John Gray