A Single-Channel Control Line:

The circuit described below was designed for the Noalimba 2000 weekend and 2001 Big Day Out conducted by ECAWA. The aim was to develop a circuit simple enough to be manufactured 'from the ground up' on the first day of the weekend and then spend the second day developing software to run it.

The circuit is based on a single transistor which acts as an electronic 'tap'. The tiny current produced by the computer's printer port is amplified by the transistor and used to control a small 12 volt relay. The relay contacts can then be used to switch much larger LOW VOLTAGE devices like motors, alarms, etc. If you are unfamiliar with the electronics discussed below you should spend some time working through the On-Line Professional Development modules at:  http://www.southwest.com.au/~jfuller/electronics/menu.htm

You may also find it useful to download and read through the "Robotics#3" booklet available for download from:  http://www.southwest.com.au/~jfuller/robot3.zip

Additional information on Interfacing is available at:
http://www.southwest.com.au/~jfuller/robotut/menu.htm

schematic1.gif (1788 bytes)

A Single Channel Output Interface

Parts List:
R1 - 1.5 k ohm 1/4 watt carbon resistor
R2 - 15 k ohm 1/4 watt carbon resistor
R3 - 560 ohm 1/4 watt carbon resistor
D1 - 1N4004 power diode
D2 - 1N914 signal diode
D3 - 3mm Red LED
D4 - 1N4004 power diode
Q1 - BC 338 or BC 547 transistor
RL1 - 12 volt SPDT relay

How it Works:

When one of the printer port lines is taken HIGH (by  a command such as - outportB 888 8 in MSW Logo) 5 volts appears at the base of the transistor Q1. This switches on the transistor allowing a larger current to flow through the coil of  relay RL1, turning it on. Taking the printer port line LOW (eg with outportB 888 0 in MSW Logo) turns the relay off again.

Diode D1 prevents any 'reverse' potential from entering the computer and causing damage. Resistor R1 limits the current flowing into the base of Q1. Resistor R2 sets up the correct 'bias' for the transistor. Diode D2 eliminates any 'back emf' spikes that may be produced as the relay coil's magnetic field collapses. Diode D3 (the LED) and R3 provide visual confirmation that the relay has switched on. D4 prevents damage to the circuit if the power supply is accidentally connected the wrong way around.

Making the Printed Circuit Board:

Copy the design from the "PCB Artwork" below (eg using 'carbon paper') and draw it onto your piece of Printed Circuit Board (PCB) using a 'Dalo' pen. (If you intend etching with an HCl/peroxide mix you can use a permanent texta.)

relay1pcb.gif (3257 bytes) photo.gif (35080 bytes) components1.gif (2566 bytes)

Not to scale.

The Completed Board

Component details

Place the PCB into the etchant and keep the liquid agitated. Remove the board when all the excess copper has been etched away. Dry the PCB and clean it with an abrasive paste cleaner. Centre-punch the hole positions and drill holes with a 1mm diameter drill bit. (Enlarge the holes as necessary to suit the relay pins.)

Solder all the components onto the PCB, connect wires to one of the output pins of the Printer Port and one of the 'Ground' pins. Connect a 12 volt supply and you are ready to test your interface.

Assembly:

Most of the components will need to 'stand up' on the PCB. Start with the 'shortest' components and work your way up to the 'tallest'. Solder in the relay last. Solder the wires to the 25 pin socket and then connect them to the board. Solder wires from the external 12 volt power supply to the board and test it.

Purchasing Parts:

Part Description   Altronics Part No. Cost
R1 1.5 k ohm 1/4 watt carbon resistor R0048 3 cents
R2 15 k ohm 1/4 watt carbon resistor R0060 4 cents
R3 560 ohm 1/4 watt carbon resistor R0043 3 cents
D1 1N4004 1 amp power diode Z0109 10 cents
D2 1N914/1N4148 signal diode Z0101 5 cents
D3 3 mm Red LED Z0700 20 cents
D4 1N4004 1 amp power diode Z0109 10 cents
Q1 BC338 or similar PNP transistor Z1037 35 cents
RLY1 6 amp SPDT PCB relay (12 volt) S4160 $2.90
DB 25 plug 25 pin male - solder type P3200 $1.60
Backshell 25 pin Backshell P3290 $1.50
Solder 0.8 mm resin cored solder T1100 $6.50 per roll
Hookup wire Figure 8 - light duty W2100 30 cents per metre
Power supply 12 volt, 1 amp, DC power supply M9672 $22.50
Dalo pen   T0033 $5.95
PCB offcuts     approx $30 per Kg
Ferric Chloride FeCl etchant per 200g H0800 $5.95
Miscellaneous: Turps, Trusol, centre punch, hammer, Drill, 1mm drill bits, 6M HCl, Hydrogen Peroxide, Textas, power cords, soldering irons, cutters, wire strippers, sponges, tracing paper, carbon paper, etching tank, tongs, containers.

Printer Port Pin Allocation:

printer1.gif (7597 bytes)