ip- to -date electronics for lab and f l< 0 contents 53 offset-less rectifier 7-64 54 RC generator 7-65 55 interior temperature control for cars 7-66 56 VFO with variable inductor 7-67 57 amplified triac drive 7-68 58 action flash 7-68 59 temperature indicator 7-69 60 lie detector 7-69 61 electronic pocket-pinball 7-70 62 simple sawtooth generator 7-71 63 optical voltage indicator 7-71 64 heatsink thermometer 7-72 65 on/off with a single push button 7-74 66 inexpensive 45 MHz crystal filter 7-74 67 low-cost CMOS lock 7-75 68 glitch suppressor 7-76 69 window comparator 7-76 70 sea murmer simulator 7-77 71 busy indicator for the Junior Computer .... 7-77 72 simple stabilizer 7-78 73 electronic switch for audio signals 7-78 74 vector control for the Junior Computer .... 7-79 75 four quadrant multiplier 7-79 76 microprocessor aid 7-80 77 dexterity game 7-81 78 40 watt main amplifier 7-82 79 zero-crossing detector 7-83 80 negative printhead supply 7-83 81 distance meter for thunderstorms 7-84 82 common base mixer 7-84 83 drill speed controller 7-85 84 single pole toggle switch 7-85 85 simple D/A converter 7-86 86 synchronous, constant-amplitude sawtooth generator 7-87 87 preset the hard(ware) way 7-88 88 variable zener 7-88 89 voltage monitor 7-89 90 mini compressor 7-89 91 6809 DRAM controller 7-90 92 acoustic 'flag' for the RS 232 interface 7-91 93 simple PA system 7-91 94 5 V logic tester 7-92 95 microphone amplifier with preset tone control 7-93 96 current source for photodiodes 7-94 97 faultfinder for ASCII keyboard 7-94 98 microprocessor faultfinder 7.95 99 thermal indicator for heat-sinks 7-96 100 high and low tester 7.97 1 01 capacitive switch 7.98 102 simple power supply regulator 7.98 103 universal AFC 7.99 104 key bleep 8-00 105 180 watt DC/AC converter 8-00 1 resistance comparator 2 constant light source 3 thermometer 4 microprocessor 'stethoscope' 5 symmetrical harmonic oscillator . . . 6 stepped-voltage generator 7 power back-up for CMOS ICs during power failures 8 doorbell memory 9 capacitance meter 10 electronic tuning fork 1 1 noise and vibration detector 12 car PDM amplifier 13 logarithmic amplifier 14 reproducible delay 1 6 symmetrical voltage from a doorbell transformer 1 7 LED current source 18 solar tracking system 1 9 emergency mains cut-out 20 simple baud rate generator 21 flashing running light 22 2650 single step 23 1 MHz time base without crystal 24 machinegun-sound generator 25 centronics interface 26 joystick interface 27 auto trigger 28 LED 'amplifier' 29 economic LED 30 simple regulated power supply 31 software RAM tester 32 h FE tester 33 prelude buffer 34 battery economizer 35 electronics and plant physiology 36 d.c. voltage doubler using a 4049 37 voltage booster regulator 38 stay awake alarm 39 anti burglar lights 40 mains wiring tester 41 very narrow crystal filter 42 signal purifier forSSB telegraphy receiver 43 horse paces simulator 44 video pattern generator 45 car lights warning device 46 code-lock with door opener 47 DC-DC converter 48 darkroom light 49 portable egg timer 50 frequency comparator 51 cricket simulator 52 pulse/pulse train generator 7-03 advertisement elektor july-august 1983 BBC MICRO COMPUTER SYSTEM Please phone for availability BBC Model B £ 399 (inclusive VAT) Carriage £ 8. Model A to Model B Upgrade Kit £ 50 Fitting Charge £ 15 Partial Upgrades also available. WORDWISE 8K ROM £ 39 TELETEXT ADAPTOR £195 TORCH Z80 DISC PACK £780 BBC WORD PROCESSOR 'VIEW' ... £ 52 All mating Connectors with Cables in stock. Full range of ACORNSOFT, PROGRAM POWER 8< BUGBYTE SOFT- WARE AVAILABLE BBC FLOPPY DISC DRIVES FD Interface £ 95 Installation £ 20 Single Drive 5 V 1 00 K £ 235 + £ 6 carr. Dual drive 5’/." 800 K £799 + £8carr. BBC COMPATIBLE DRIVES These drives are self powered i in BBC matching colour cases. SINGLE 100K £180; 200K £250; 400K £330 DUAL 200K £350; 400K £475; 800K £590 DRIVE CABLES: SINGLE £8 DUAL £12 DISC MANUAL 8< FORMATTING DISKETTE £17,50 ) supplied NEC PC 8023BC 1 0OCPS, 80 co Logic Seeking, Bidirectional, Forward and Reverse Line Feed Spacing, Auto Underline, Hi-Res Block Graphi 80 cols 30 CPS Full ASCII & Graphics 10” Wide Paper Now only £ 180 * £ 6 carr. GP 250A £235 ‘ “car EPSON FX80 and 100F/T3 EPSON RX80 and FX80 RX80 100 CPS 80 col Tractor Feed £298 FX80 160 CPS 80 col F 8. T Feed £389 MX100 F/T3E425 (£8 carr./printer) RX80 £298 FX80 £438 PRINTER ACCESSORIES Parallel Printer Lead . . £ 13.50 Serial Lead £ 10.— EPSON SERIAL INTERFACE 2K BUFFER £60.— NECSERIAL BUFFER £70.— 2.000 sheets 9Vx 11" fanfold paper £ 13.50 + £ 3.50 VARIETY OF PRINTER RIBBONS FOR PRINTERS GP100A £6.50 EPSON MX80 £7.50 NEC PC8035 £7.50 INTERFACES INSTOCK AMPHENOL CONNECTORS 37 way Centronix Type £5.50 HOC or Solder Type) 25 way IEEE Type £5.50 CASSETTE RECORDER BBC Compatible Cassette Recor- der with Counter and Remote Control £26.50 + £1 .50 carr. Cassette Leads £3.50 Cassette 50p each. £4.50 for 10 + £1 carr Sanyo Data Recorder Model DB1 101 £39 + £1.50 carr. Teletype Roll £ 4. — +£2.50 Teletype Roll Holder £15. — carr. + £ 2.— carr. DISC DRIVES FOR THE FORTH COMPUTER 5V Teac FD55 Slim Line Mechanisms SOFTY II INTELLIGENT PROGRAMMER FD55A 40 track SSDD 250kbytes unformatted bare: £135 Cased: 2 X FD55A 40 track SSDD 500kbytes unformatte FD55E 80 track SSDD 500kbytes unformatted bare: £180 Cased: 2 x FD55E track SSDD 1 Mbyte unformatted 5VJ" Mitsubishi M4853 Slim Line mechanism 80 track DSDD 1 Mbyte unformatted bare: £225 Cased: 2x M4853 2 Mbytes Cased + psu Single drive cable £8 Dual Drive cable Other parts for FORTH COMPUTER available se for details £155 £350 £205 £475 UV ERASERS UV1B up to BEproms . . . . £47.50 Al ' ®. ra “ UV140 up to 14 Eproms . . . . £61.50 with me UV1T with Timer £60.00 5vv i tC hes UV141 with Timer £78.00 safety in ICarr £ 2/eraser) locks. MICROTIMER (HOUSEKEEPER) 6502 Based Programmable clock timer with * 224 switching times/week cycle * 24 hour 7 day timer * 4 independent switch outputs directly interfacin( • 6 digit 7 sag. display to indica' Reset times • Output to drive day of week sv time. ON/OFF an ind status LEDs. The complete Hobbyists. Yo EPROMS or use in host computer by using softy as a romulator. editing facilities permit bytes, blocks of bytes changed, deleted oi and memory contents can be observed on ordinary TV. Accepts most +5 V EPROMS Softy II complete with PSU. TV Lead and Romulator lead . . . RUGBY ATOMIC CLOCK This Z80 micro controlled clock/calendar receives coded time data from NPL Rugby. The clock never needs to be reset. The facilities include 8 in- dependent alarms and for each alarm there is a choice of melody or alter- natively these can be used for electrical switching. A separate timer allows recording of up to 240 lap times without interrupting the count. Expan- sion facilities provided. Complete Kit £120 *£2.00 carr. Ready Built Unit £145 *£5.00 carr. Reprint of ETI articles at £ 1.00 * s.a.e. BBC BOOKS Basic on BBC . . . £5.95 . £6.50 Guide £6.95 Assy LangProgr. for BBC £8.95 6502 Machine Codes for Beginners £6.95 MONITORS MICROVITEC 1431 14" Colour £ 249 * £ 8 carr. MICROVITEC 2031 20" Colour £319* £8 carr. KAGA 12" Colour RGB £255 * £ 8 carr. Lead for KAGA £10 Lead for KAGA/SANTO RGB£10 SANYO Hi Res Green Monitor £99* £6 carr. SEE OUR INSIDE FRONT COVER PAGE ADVERTISEMENT FOR COMPONENT PRICES Technomath: Ltd MAH. ORDERS TO: 17 BURNLEY ROAD, LONDON NW10 IED SHOPS AT: 17 BURNLEY ROAD. LONDON NW10 (Tel: 01-452 1500. 01-450 6597. Telex: 922800) 305 EDGWARE ROAD. LONDON W2 PLEASE ADD 40p p&p & 15°fo VAT (Export: do VAT. p&p at Cost) crs from Government Depts. & Colleges etc. welcome. Detailed Price List on request. I JSL 1 — I Stock items are normally by return of post. 7-05 advertisement elektor july-august 1983 7-09 elektor july-august 1983 advertisement Does your components source offer: ★ 24 hour service on all in-stock items ★ ON-LINE Stock Enquiry Service EH ★ Human tele-sales from 8am to 8pm ★ 24 hour ON-LINE DATEL Service for direct stock EH interrogation from any RS232/300BAUD terminal ★ Order Processing with Automatic Backorder EH Processing and Due-In Date Advice ★ A Price-on-the-Page Catalogue that’s revised 3 EH times a year ...it doesn’t? Then you aren’t dealing with ambit, are you? GET THE COMPLETE PICTURE AT YOUR NEWSAGENT DURING JULY— OR DIRECT — ORDER YOUR COPY NOW— * STILL THE ONLY CATALOGUE FOR THE COMPLETE RANGE OF COMPONENTS. BATTERIES, CRYSTAL FILTERS, RF POWER, MOSFET, TOKO COILS, CHOKES, ALPS PLOTTERS, SOLENOID CASSETTE MECHSETC. COMPONENTS FOR ELECTRONICS, COMMUNICATIONS & COMPUTING ambit INTERNATIONAL INTERNATIONAL L 7-10 NEW AND FREE FROM GSC. NEW an exciting range of projects to build on the EXP300 breadboards. NOW anybody can build electronic projects psing "Electronics-by-numbers", its as "Easy - as A, B, C with G.S.CI" ^REE project MUSICAL DOORBELL OF THE 3RD KIND You've seen the film, now haunt your visitors Each time the doorbell is pushed the eerie tune plays out, then switches off to conserve HOW DO YOU MAKE IT. Our FREE project gives you clear "step-by- step" instructions. For example "take Resistor No.1 and plug it into hole numbers B45 and B47". 'Take 1C No.1 and plug it into hole numbers E35 to E42 and F35 to F42, (pin 1 on the 1C goes into F35I" 'Take. . ."Well! why not "clip-the-coupon" and get your FREE step-by-step instruction sheet and your FREE 12 projects with each EXP300 bought and your FREE catalogue klELU F FRDFT1 advertisement elektor july-august 1983 naan BDQ SfllB ODD UIBB nos Q a a o Bl L0 a 7-17 advertisement elektor july-august 1983 PRT-MPF Printer Board Name mm n 1 ffl*! irjgj i ffl ml A low cost tool for learning, ^ teaching and prototyping. I Micro-professor is a low-cost | Z80 based micro computer which provides you with an interesting and inexpensive way to understand the world of microprocessors. Micro-Professor is a complete | hardware and software system and is a superb learning tool for students, hobbyists and microprocessor enthusiasts, as well as an excellent teaching aid for instructors of electrical L| engineering and computer science courses. Micro- Professor £9950 (+£4.00 p&p) Now with the Student Work Book available Flight offer you the complete package. An easy to follow manual that will help further your understanding of microprocessors. s,uden zr k £1&00 SSB-MPF Speech Synthesizer Board A vocabulary of up to 400 words based on the TMS 5200 chip. SGB-MPF Sound Generation Board Wg&r Manual play, Bsr Auto replay Y Auto rhythm - 6 different rhythms, Sound Synthesizer and Hi-fi speaker. FLIGHT Electronics Ltd. Memory dump utility. BASIC program listing. Z80 disassembler. EPB-MPF EPROM Programming Board For all+5V 1KB 12KB 1 4KB EPROMS Read /Copy /List/ Verify Capability. Please send me 0 Micro-Professor £99.50 (+£4.00 p&p) Student Work Book £16.00 SGB-MPF board £79. 50 EPB-MPF board £99.50 SSB-MPF board £99. 50 PRT-MPF board £86.25 I enclose cheque! P. O. for £ EKR 7/8 Mail Order only Prices include VA T. Please allow 28 days for delivery. By phone or post FLIGHT ELECTRONICS LTD. Quayside Rd.Southampton, Hants S024AD. Telex.477793. Tel.(0703) 34003/ 27721. 7-23 advertisement elektor july-august 1983 From the worlds largest ?tral00pj?50; manufacturer of scientific instruments B eckman instruments are used worldwide in medicine and science, in industry and environmental technology, where precision and reliability are vital: from the Beckman photo- spectrometer in a space probe scanning for signs of life to a Beckman clinical electrolyte analyser. The T90 gives an accuracy of 0.8% Vac and is remarkable value for money at £43.45 (+VAT). The T100 is a full range function meter with 0.5% accuracy at £49.00 (+VAT), while the T110 offers even greater accuracy of 0.25% plus an audible continuity indicator at £59.00 (+VAT). To feel like a professional you can order your Beckman straight off the coupon, or send for full technical data. multimeters This same perfection in design and manufac- ture goes into Beckman digital multimeters, themselves widely used j in testing, measurement, ' research and engineering because of their accuracy and their intelligent features. Now the electronics enthus- World leaders in multimeters Electronic Components UK Sales and Marketing Organisation Mylen House, II Wagon Lane, Sheldon, Birmingham B263DU. Tel: 021-742 7921 Telex: 336659 ‘ I want to g o di g ital! iast has access to the same standard of reliability in the T90, T100 and T110 models. All models undergo 100% factory testing. Their accuracy is guaranteed to be held over a long period and reliability is outstanding, thanks to fewer components and interconnections. All components are of the highest quality and include a CMOS integrated circuit and gold inlaid switch contacts. The digital display can be read at a glance, and all functions are selected with a single rotary switch, rather than with confusing rows of push buttons. Battery life is exceptional - 200 hours at continuous operation. T90 meters at £50.60 (inc. VAT, p&p) T100 meters at £57.00 (inc. VAT p&p) T110 meters at £68.50 (inc. VAT p&p) I enclose a cheque/RO. payable to: Beckman Instruments Ltd for £ Please send me full data on the Beckman □ enthusiast's multimeter range. (Tick box if required) NAME • ADDRESS Please allow 14 days for delivery E7.8/83 elektor july-august 1983 Wl £52.75 DM6013 DIGITAL CAPACITANCE METER High accuracy measurement of capacitance over a wide range of values. Fast sample time, easy to read LCD display. Rugged construction — easy operation. £39.99 £52.00 DM2350/C MINIATURE AUTORANGING D.M.M. Super compact autoranging digital multmeter featuring continuity buzzer and large (10mm) clear 3V. -digit display. Full fuse overload protection. Carrying case, leads, battery, spare fuse and instruction manual supplied. Umps:- 0 — 200mA £ 1 .2%; 20A with ax. Volts:- 2 - 20 - 200 - 600V ± 1.0% B.K. ELECTRONICS oep EK UNIT 5 COMET WAY. SOUTHEND ESSEX . SS2 6TR . 7-26 elektor july/august 1983 I wonder . . . . . Who ever dreamed up the name 'Summer Cir- cuits'? We've been working on them since last September, and they just happen to appear in this July/August issue! Whether or not that coincides with something that faintly resembles Summer is beyond our control (but we're working on it). 'More than 100 practical projects — now that's more like it. A definite statement of fact. We've even numbered the circuits to save you the trouble of counting! Actually one circuit is an obvious (?) dud, in the best Elektor Summer circuits issue tra- dition. There are also a few software items. We didn't know whether to count them as 'practical projects', so we added a few more circuits just to play it safe (what with the Trades Descriptions Act . . . ). These big numbers did cause some prob- lems with our two-digit adding machine, but we carried on regardless. There is a persistent myth surrounding this issue, to the great amusement of our editorial staff. Some people seem to think we print a double issue so that we can go on holiday for a month. No such luck. As you read these lines we should have the September issue all wrapped up, and we're already working on October and November! There's no rest for the wicked, as the saying goes. Not that we're com- plaining, mind: we belong to the privileged minority who know about all those wonderful projects several months before anybody else. That means we can buy the components before the shops are sold out. (Not that we don't warn them: any interested retailer can get our 'retailers preview' five or six weeks in advance. Ask at your local shop - they may have the September preview under the counter!) Another myth: most of the circuits are cribbed from manufacturers application notes. Tut-tut! We wouldn't stoop so low. Application notes are useful, but on the rare occasion that we find something worthwhile it is clearly indicated as such. External authors are also credited. Few and far between, admittedly, but we only accept circuits that are reasonably original and that can be made to work after a bit of in-house re-designing. That eliminates the majority (unfortunately) of the hundreds of submissions we receive every year. However we do use as many as we can, so keep those ideas coming in. Where do all these circuits originate then? Well, let me put it this way: if each member of our design group contributes one circuit per month for a year, we can just about do it. Now I really must stop. If you want to know how Elektor is actually made, drop me a line. Given sufficient interest I might waste a few pages on the topic! For the present, I'm sure you'd rather take a look at the circuits. Have fun! I hope they'll keep you busy till September. Your Editor P.S. Last year I mentioned that I wanted to build that no-l-won't-tell-you-which circuit. Believe it or not: it works! Ed. P.P.S. I 've just noticed that this issue is 'number 99/100': half way through, it turns into our hundredth Elektor! Maybe we ought to celebrate . . . but no: let's just get cracking on no. 101. P.H. 7-27 This multimeter accessory is not just a bleeper; in spite of its sim- plicity. The circuit indicates by a bleep whether a resistance being measured with the multimeter is smaller than a predetermined value; it can also be made to do so when the measured resistance is larger than the reference value. The device compares the voltage drop across the resistance under test with a reference voltage. Re- quired components are a quad op-amp, a diode, a crystal buzzer, a capacitor, two electrolytics, two trimmers and four resistors. Power is provided by a 9 V battery. In the circuit diagram shown in figure 1 the voltage drop across R x , which is in parallel with the multimeter, is taken from sockets A/C and B/D. The high internal resistance of the multimeter is hardly affected by the parallel connection of the comparator be- cause A1 is connected as an im- pedance converter. Stage A2 com- pares the voltage at the output of A1 with a level preset by poten- tiometer PI . If the voltage at the + input of A2 is larger than the value set by PI , the output level of A2 is nearly equal to the posi- tive supply voltage. Diode D1 con- ducts and capacitor Cl cannot discharge. Op-amp A3, in conjunc- tion with Cl, R1 and preset po- tentiometer P2, forms a square- wave oscillator of which the trig- ger level is set by P2. The square- wave voltage at the output of A3 is applied to the crystal buzzer via R2. The earth potential of the circuit is determined by the output of A4. The voltage divider R3/R4 at the input of A4 is symmetrical, therefore the 9 V of the battery is converted in a simple manner to 2 x 4.5 V. The simplest method of calibration is to connect a resistor of, say, 1 k between the two test probes and adjust PI such that the bleeping tone just disappears. If a smaller resistance is now connected be- tween the probes, the bleep will be heard again. It must of course be borne in mind that the com- parator, as well as the resistance under test, have a tolerance. If it is required that the circuit indicates larger resistances than that of the reference, the inputs of A2 must be interchanged. Figure 2 illustrates how the com- parator can be built into a small case which plugs directly into the sockets of the multimeter. The test leads are then plugged into sockets fitted at the top of the The frequency and volume of the bleep tone can be set with P2; they are, of course, to some extent interrelated. *< constant light source In many occupations it is important that the light incidence at a certain location remains as nearly constant as possible. When the sun appears from behind the clouds (it happens sometimes!), it causes an increase in light in a room or onto an object. Such varying ambient light is tiring on the eyes for many people when painting, reading, and so on. If ambient light does not vary too wildly, the light source described here may offer a solution. The circuit controls a light bulb so that the brightness of the bulb is matched with the incidence of ambient light. The bulb will therefore light more brightly if the sun disappears behind the clouds again. The circuit can of course be connected to the lighting of a living room or study: if it gets darker outside, the lights in the room will then compensate. This circuit is a real solution if you don't like working or sitting in semi-dark- The principle is fairly simple: a sensor measures both the incidence of the light bulb connected to the circuit and the ambient light. As soon as the ambient light changes the intensity of the bulb is changed ac- cordingly so that the total light level remains the same. The heart of the circuit is a rather R1, R2, R3= 10 k R4 - 5k6 R5, R6= 10n R7 = 56 k R8= 180 n R9 = 1 k (1 W) RIO ■ 1 k PI = 100 k preset potentiometer Capacitors: C1.C4.C5 - 100 n C2 = 470 pF/25 V C3 « 100 pF/25 V C6= 180 n C7 = 100 nF/400 V Semiconductors: D1 . . . D5 = 1N4001 T1 . . . T3 = BC547B Tril = TIC 226D IC1 = OPLIOO IC2 = OPI 3020 (MOC 3020) (IC1.IC2 from Norbain Opto-electronics) Miscellaneous: FI =3.15 A LI = choke 50 ... 100 pH Heatsink for IC2 (35 x 20 x 15 mm) Tr 1 = mains transformer 6 ... 12 V/150 mA elektor july /august 1 983 unusual 1C, the OPL 100 from TRW- Optron. It is housed in an 8-pin DIL package with a transparent top and includes control electronics together with a light sensitive diode. A con- stant current produced by T2 and T3 and preset by PI serves as a reference to 1C 1 . The integrated circuit will control the pulse width of its output (and therefor the bright- ness of lamp La) such that the cur- rent supplied by pin 1 , which is directly proportional to the quantity of light falling onto the sensor, is equal to the current flowing through T3 and preset by PI . If the ambient light decreases, the current supplied via pin 1 will drop. As the adjusted current through T3 is then larger than the current supplied through pin 1, the voltage at pin 1 drops and this causes the pulse width of the output signal to change. Triac Tri 1 conducts for a longer I period for each cycle of the mains frequency and the lamp will glow more brightly until the ambient light returns to its original level. Ca- pacitor C3 ensures that the control of the circuit is smooth. The value of this capacitor also determines the speed at which the circuit reacts to light variations. The smaller the value of C3, the faster the reaction of the circuit, but the value should be kept above 1 pF. The mains supply frequency is used to switch T1 and this transistor then ensures synchronization of the con- trol pulses for the triac provided by IC1 with the mains supply. The opto- coupler, IC2, ensures that the circuit is electrically isolated from the mains supply. Take care with the choice of trans- former! During the testing of our prototype we found that a small, inexpensive (printed circuit board) transformer caused quite a phase shift. Even during full sunlight inci- dence on the sensor, the lamp con- tinued to light, albeit dimly. The phase shift in a good quality trans- former is minimal; the lamp can then be controlled over the full range of 180° (in each half period). The maximum power drawn from the circuit should not exceed 500 W (resistive load) which is ample for most applications. Footnote Light flux, measured in lumens, is the rate at which light is passing to, from, or through a surface or other geometrical entity. Light incidence, measured in lux (lumens per square meter), is the flux per unit area, normally per- pendicularly incident upon a sur- face. Light intensity, measured in candela, is the flux per unit solid angle edi- ting (or diverging) from a source of finite area. thermometer A common or garden diode like the 1N4148 is in principle an excellent sensor for a reasonably accurate electronic thermometer because the voltage drop across the diode de- creases by 2 mV for every degree Centigrade rise in temperature. As can be seen in figure 1, a constant reference voltage is applied to the non inverting input of the op-amp. The current flowing through the resistor, and therefore through the diode, is also held at a constant level. Variations in the output voltage of the op-amp can occur only as a result of a change in the voltage drop across the diode and this in turn can only be caused by tempera- ture variations. The output voltage is therefore directly proportional to the temperature of the diode. In the complete circuit diagram shown in figure 2, the op-amp is A2 and the diode is D1. The reference voltage is derived from IC1 via voltage divider R3/P1/R4. The output volt- age of A2 is amplified by op-amp A3. The non-inverting input of A3 is also held at a constant level (again derived from R3/P1/R4) and the values of R6 and R8 have been chosen so that 0 V corresponds to 0°C ambient To enable the measuring of tempera- tures above and below zero without the use of a symmetrical power supply, a rather uncommon solution was arrived at. The first requirement was a regulator, 1C 1 , which provides a reasonably constant reference volt- age for A2 and A3. An additional amplifier, A1, generates, together with R 1 and R2, a voltage of +2.5 V relative to the negative supply line. This 2.5 V line is then used as the 'earth' for the rest of the circuit. Pin 1 1 of IC2 is therefore at -2.5 V and pin 4 at +6.5 V with respect to this 'earth'. The supply to the op- amps is therefore 'symmetrical'. The current consumption of the circuit is about 5 mA so that for incidental temperature measurements a 9 V battery will be adequate. If continuous use is required, a simple mains supply will have to be used; this need not be stabilised in view of IC1. Most voltmeters will be suitable as an indicator. If the Universal Digital Meter described in our July/August 1981 issue (circuit 60) is used, a battery will not be required as the supply can then be taken from points U 0 and 0. The thermometer will then have a range of —9.99 . . . . +99.9 degrees Centigrade. The circuit is calibrated be setting PI to obtain 0 V at 0° Centigrade and then P2 to obtain 0.999 V at 99.9° Centigrade. M 7-30 microprocessor 'stethoscope’ It is often necessary to see exactly what logic activity is occurring on the address, data or control busses of a microprocessor system. This is easily done by displaying it on an oscilloscope but not everybody can lay their hands on an oscilloscope at short notice. The 'stethoscope' here enables a microprocessor system to be tested without the need for an oscilloscope. Of course it is not intended as the be-all and end-all of test equipment, but then even a doctor's stethoscope has limitations. The actual circuit is fairly simple. The stethoscope probe is connected to the clock input of a divider. The frequency of the input signal is divided by a certain factor. This factor depends on what output of IC1 is selected with SI and can be between 488.3 Hz/MHz (with SI in position 1) and 15625 Hz/ MHz (SI in position 6). By changing the position of this switch we can symmetrical harmonic oscillator The remarkable thing about this oscillator is not that it operates on the third overtone of a crystal nor that it is symmetrical, but that it does not use a tuned circuit. Os- cillators without tuned circuits normally operate on the funda- mental crystal frequency: as soon as it is required to work on har- monics, a tuned circuit becomes necessary to resonate at the desired elektor july/august 1983 The clock signal is an example of a periodic signal which is always present If periodic signals are to be present on the three busses then the microprocessor must be working on a program(loop). This could be part the 6502 programs shown below can be used to test data lines and address lines. Test programs placed directly (without modifi- cations) in virtually any location of memory. Because the pro- be of the monitor program, for example cessor reads periodic opcodes and a routine to test whether any key has been pressed. Special test pro- grams can also be used and there are thousands of possibles, depending LOOP BCC LOOP (18 90 FE) CLC LOOP BCC LOOP (18 90 FD) operands the R/W signal will appear periodically. As there are a certain number of clock periods needed for a number of periodic instructions we can expect this to be reflected in a number of outputs whose dividing factor is reduced. This stethoscope is powered by the circuit it tests. The probe itself is not very expensive as it can be made from a small screwdriver. H The circuit has been designed for crystals with a fundamental fre- quency of 6 ... 20 MHz and this gives an oscillator frequency between 18 ... 60 MHz: a pretty good range Moreover, the oscillator can be built around most normal RF tran- sistors. Finally, the output voltage of 500 mVpp is sufficient for most applications. H overtone. The circuit described is reminiscent of an astable multivibrator, but it uses a novel way of connecting the crystal: between the emitters of the two transistors and in series with a small trimmer capacitor (C5 = 40 pF). It is the trimmer which enables the tuning of the oscillator to the fun- damental as well as to the third 7-31 . elektor july/august 1983 stepped- voltage generator This circuit converts an input signal into one that is composed of a num- ber of discrete steps but which re- mains otherwise identical to the input signal. Because the steps are of equal height, the harmonic con- tent of the output signal will be dependent upon the amplitude of the input signal. This chararac- teristic is extremely useful in the making of electronic music. The circuit uses quantitised pulse- width modulation for the adding of the step-shaped input signal. Pulse-width modulation is obtained by comparing a triangular voltage with the analogue input signal by means of a comparator; the quan- tising, that is the adding of the steps, takes place by replacing the triangular voltage with a stepped voltage. The stepped-voltage generator con- sists of three gates, N1 . . . N3 and transistor T1. N1 operates as an astable multivibrator, that oscillates at a frequency depending on the value of Cl and R1. Transistor stage T1 functionsas a charger circuit: each time the output of N1 is logic 1, the transistor transfers the charge on C2 to capacitor C4. During the next half cycle C2 is recharged via D1 . In this way the voltage across C4 increases in discrete steps, the height of the steps being deter- mined by the ratio C2:C4. When the voltage across C4 rises above a certain value, N2 switches transistor T2 on via gate N3 and discharges capacitor C4. When the capacitor is completely discharged, N2 switches off T2 and C4 con- tinues to charge again in discrete steps. The stepped voltage is set to the inverting input of IC2 which is connected as a comparator. Low- pass filter R4/C7 in the output of IC2 converts the pulse-width modu- lated signal back to an analogue one. The d.c. voltage level at the non- inverting input is set by potentio- meter P2 to half the magnitude of the stepped voltage. The setting of PI is dependent upon the input signal which must be attenuated such that the maximum value at the slider of PI is always smaller than the maximum value of the stepped voltage. The number of steps can be selected by varying the value of C4. It is possible to use a varicap in place of C4 with the varicap voltage being controlled by the music program or the input signal. Interesting and individual effects can be obtained in this way. H f power backup for CMOS ICs during mains power failures Even very brief mains power failures cause problems for electronic circuits. Stored data are lost and the oper- ating statuses are no longer what they were before the power failure. Mains power failures cannot be prevented, but methods can be employed to provide a voltage backup for the duration of the fault. For this reason, mains-powered equip- ment is often fitted with backup batteries (nicad or lithium cells) to maintain operation during a mains power failure. In view of the low currents (microamperes) required for data storage with modem RAMs, there is an alternative backup method which is well worth consider- ing: power backup with an electro- lytic capacitor for energy storage! The circuit diagram shows just such an application. The 'power stand-by' capacitor Cl is 4700 jiF and with a maximum load current of 10 /iA, the discharge time at an output voltage of 5 V is approxi- mately 53 minutes. The operating voltage of the circuit itself is 15 V, 10 V higher than the output voltage. As long as the 15 V supply voltage is applied, capacitor Cl charges up to the value of the operating voltage via diode D1. Simultaneously, a bias voltage of approximately 2.3 V is applied to the gate of field effect transistor T1 via voltage divider R1/R2. This ensures that T1 is turned on and capacitor C2 is charged up. The output voltage at the source terminal of the second 7-32 elektor july/august 1983 field effect transistor remains a constant 5 V. The two FETscan be thought of as a voltage divider. If the supply voltage fails, electro- lytic capacitor Cl will become the temporary power supply. Since the gate voltage is removed from T 1 it turns off. Capacitor C2 is no longer being charged. However, it'can only discharge very slowly because T2 has a very high input resistance. The voltage across C2 remains almost constant. Capacitor Cl supplies the operating voltage required for T2 so that it conducts and maintains the output voltage at 5 V. Capacitor Cl discharges very slowly, as a function of its insulation resistance (Rins approximately 1 M) and the load current flowing. The output voltage at the source lead of T2 remains a constant 5 V, until the voltage across Cl has also dropped to 5 V. If this voltage drops even further, FETT2 remains turned on but the output voltage decreases proportionally. For correct functioning of the circuit, it is very important to select an MKT type of foil capacitor for C2. (M stands for metallised and KT is the standard designation for polyester foil). (Siemens Application) 14 8 V >i doorbell memory On occasion it may be useful to know when a visitor has called in your absence. This is especially true in the case of an enforced absence when a visitor is expected. Confusion reigns supreme on these occasions. The circuit here helps to rectify the situation by providing a 'memory' for the doorbell. On your return a LED will advise you whether or not a visitor called. The circuit is powered by the bell transformer via diode D1 and capacitor Cl. This provides a d.c. voltage level sufficient for the 'memory'. Under normal conditions (with no one ringing the doorbell) transistor T1 will be switched off and T 2 will be conduc- ting to provide a form of latch for T1. Obviously LED D3 will never light under these conditions! Now our visitor arrives! With a joyful cry of 'Avon calling' they press the doorbell — only to lapse into total embarrasment when there is no answer! However our circuit now leaps into action. Via D2 and R1, the doorbell switch SI provides a base drive current to T1 which switches off T2 and, in passing, LED D3 on. Now the transistor ’£ 'latch' (T2) swings the other way and T1 is held on by the current path to the positive supply through S2 (normally closed) R5 and R6. The unfortunate visitor goes away totally deflated but the LED will indicate his 'past presence'! On your return the LED will be noted and the circuit 'reset'. This is carried out by simply pressing S2 which breaks the base currents path holding T1 on causing this transistor to switch off. In doing so the LED will be switched off and T2 will be switched on. The 'latch' will be back in the original position where T1 is held off by the fact that R5 is effectively in parallel with R2. A further refinement would be to provide an automatic reset when the front door is opened. In this case S2 is a switch operated by the opening door. However the LED must then be mounted outside the door (poss- ibly in the doorbell switch housing) or the LED will be off by the time you get into the house to look! On the other hand a second circuit could be built as a 'memory' for the 'automatic' memory and then it would be no problem to open the door! This second circuit will of course require a reset switch! M 7-33 capacitance meter In this capacitance meter, the value of a capacitor is determined by giving it the same charge as a refer- ence capacitance and then comparing the voltages across them. This relies on the formula C = Q/V where C is the capacitance in Farads, Q is the charge in Coulombs and V is the voltage in volts. If therefore two capacitances have equal charges, their values can be calculated when the voltages across them are known. Two circuits ensure that reference capacitor C r and the capacitor to be measured, C x , are charged equally. The circuit for C r consists of C2, D1 and T1 and that for C x of C3, D2 and T3. Each time the output of gate N2 rises, the charges of capacitors C2 and C3 are transferred to C r and C x by transistors T1 andT3 respectively. When the output of N2 drops, C2 and C3 recharge via diodes D1 and D2. Gate N2 is controlled by astable multivibrator N1 which operates at a frequency of about 2 kHz: C r and C x are therefore charged at that frequency. The voltage across C r is compared by IC2 with a reference voltage derived from the power supply via R3/R4. When the voltage across C r exceeds the reference voltage, com- parator IC2 inverts which inhibits N2 and causes N3 to light LED D3. The charges on C r and C x are now equal and the meter indicates by how much the voltage across C x differs from that across C r . Buffer IC3 presents a very high load impedance to C x . Pressing reset button SI causes both C r and C x to discharge via T2 and T4 respectively, after which the charging process restarts and the circuit is ready for the next measurement. The meter is calibrated by using two identical 1 0 nF capacitors for C r and C x . Press the reset button and, when the LED lights, adjust preset PI to give a meter reading of exactly one tenth of full scale deflection (fsd). That reading corresponds to 1 x C r . If, therefore, C r = 100 nF and C x = 470 nF, the meter will read 0.47 of fsd. To ensure a sufficient number of charging cycles during a measure- ment, C r and C x should not be smaller than 4.7 nF. To measure smaller values, capacitors C2 and C3 will have to be reduced. For instance, to enable a capacitor of 470 pF to be measured, C2 and C3 have to be 10 . . . 20 pF. The circuit is reason- ably accurate for values of C x up to 100pF. Above that value the measurement will be affected by leakage currents. To measure capaci- tors of up to 100 /jF, the values of C2 and C3 should be increased to 1#iF. Current consumption is minimal so that a 9 V battery is an adequate power supply. H A standard tuning fork produces a tone of 440 Hz, that is, the inter- national A (orchestral pitch). It is not very difficult to make an elec- tronic alternative. An oscillator, a divider, a loudspeaker and a battery are all that is required. To be useful, an ‘electronic tuning fork' must, of course, be a compact unit. As the use of special, and therefore costly, crystals was precluded, a little research showed that it would be possible to use relatively simple and standard components. It ap- peared that the required frequency can be derived from a readily avail- able 1 MHz crystal which, by means of a trimmer, can be pulled to 1,000,120 Hz which is the nearest frequency containing a whole num- ber times 440 Hz. The oscillator is constructed a- round gates N1, N2 and tuned to 1,000,120 Hz (with a frequency counter if possible), by means of trimmer C2. The oscillator output is fed to IC2 which divides bv 2273 (2° + 2 5 + 2 6 + 2 7 + 2" ). A practically symmetrical signal of 440 Hz is then available at output Q11 of IC2. This signal is then buffered by gates 7-34 elektor july /august 1983 N3 . . . N6 and the balanced output stage gives a level sufficient to drive a small loudspeaker. In spite of the current consumption of 65 mA, a standard 9 V battery (preferably alkaline-manganese) will suffice, because tuning forks are by their nature used for short periods only. If the fork is used for longer periods, it might be advisable to consider a rechargeable battery. K noise and vibration detector Whether it is the hi-fi next door, the cat purring quietly, or a knock at the door, the detector described here does not miss a thing. Whenever it picks up a sound or vibration, it emits an ear-piercing tone. The circuit is based on the use of an 8 SI loudspeaker as microphone/ loudspeaker. As the signals from this microphone are very small, they are amplified in A1 and rectified. The resulting DC signal is then compared with a reference voltage in A2. When a noise or vibration is picked up by the microphone, the voltage at the inverting input of A2 (pin 6), rises suddenly to about 4 V and then slowly decays to 0 V. The decay time depends on the time constant R6/C3. The voltage at the non-inverting input of A2 (pin 5) is held constant at 0.7 V by R3/R4. When the input at pin 6 rises above 0.7 V, the output of A2 (pin 7) instantly switches to —4 V, which causes the squarewave oscillator A3 to start. The frequency (tone) of the oscillator can be adjusted by preset potentiometer PI . The oscillator output (pin 8) is fed to amplifier stage T1 which drives the loudspeaker. The oscillator will continue to run however, so C3 charges steadily and will keep the output at pin 7 of A2 negative. As this is not the purpose of the circuit, the incoming signal must be interrupted somewhere in the chain. To do this, an FET, T2, is used as a switch. As soon as the output of the comparator becomes negative, D3 conducts, T2 is cut off and the incoming signal is interrupted. When C3 has discharged to the extent that the voltage across it drops to below 0.7 V, the output of A2 (pin 7) becomes positive, D3 is cut off and T2 conducts. This should, however, not happen too rapidly, otherwise there is the risk that a false alarm may be given. Therefore, the gate (drive input) of T2 is connected to earth via capacitors C2 and C8. The consequent delay ensures that the circuit is not reactivated before half a second after the loudspeaker has gone quiet. The earth potential is fixed by the voltage divider R9/R10 and im- pedance converter A4, which derive a symmetrical supply of ± 4.5 V from the 9 V battery. When T1 conducts, the supply voltage will drop a little because a battery cannot deliver energy as well as a mains power supply. It can therefore happen that the output signal of A3 is superimposed on the supply voltage. This undesired feed- back should be prevented by C5 and C6. If in spite of these capacitors diffi- culties are encountered, it may be beneficial to increase the values of R5, C2 and C8 by trial and error. If that fails to improve matters, increase the value of capacitors C5 and C6. M 7-35 car PDM amplifier This power amplifier, designed for use in a car, delivers 10 W into 4 12 and because it uses the principles of PDM (pulse duration modulation) its efficiency is nearly 100%. Basically it is an expanded version of the regenerative PDM amplifier described in Elektor July/August 1982. The block diagram is shown in figure 1. An op-amp drives a schmitt trigger, the output of which is integrated and fed back to the inverting input of the op-amp. The system regulates itself so that the voltage is the same at both inputs of the op-amp. That can only happen if the pulse width (or pulse duration) is variable, otherwise the circuit tries to change the oscil- lating frequency as a method of regulation. The heart of the PDM system (figure 2) is made up of IC2, N1 . . . N6, T1 and T3. To build this up into a power amplifier an out-of-phase con- trol signal is formed by N7 . . . N12. This is not the ideal situation as these are not part of the feedback loop and also there is some cross-over distor- tion because switching takes a finite time. However the quality is improved somewhat by using a symmetrical feedback loop consisting of the Parts list Resistors: R1.R2 • 47 k R3.R4 = 22 k R5.R6 - 100 k R7,R8 = 270 k PI = 5 k log potentiometer Capacitors: C1,C2,C8,C9= lOOn C3.C4 - 1 p/16 V C5-470p C6 - 680 n C7 = 220 p/25 V CIO = 220 n C11 - lOOp Semiconductors: T1.T2 = BD 131, BD 241A T3.T4 = BD 132.8D 24 2A IC1 = CA3140 IC2 = CA3130 IC3.IC4 = 4049B Miscellaneous: L1,L2 = 40 pH. 3 A inductors components around IC1. This digital amplifier operates much the same as an analogue equivalent, which would have to be much bigger. The BD 131/ 132 transistors give an output of 10W with a total harmonic distor- tion of 0.3%. The maximum power 7-36 >r july/august 1983 without clipping (10% distortion) is about 12W. If BD 241/242 transistors are used these figures are not quite so good because the cut-off fre- quency (actually the 3 dB frequency) is much lower. With a total harmonic distortion of 0.3% the output is only 8 W and the maximum power available without clipping is 10W. The minimum input signal to the circuit is 800 mV and current con- sumption is about 1 .5 A. Because of all the 'noise' on car voltage lines the supply must be filtered. Generally this only requires a simple LC filter with a 2200///25 V capacitor and a 1 mH inductor with a low coil resistance. In principle more than one amplifier can be used and fed from a single low-pass filter. Because it has to be mounted in a car this amplifier should be put in a sturdy case. There is a difference in size between the BD 131/132 and BD 241/242 transistors and this must be taken into account during con- struction. The photo shows the method of mounting heatsinks and clearly the end result is a very compact amplifier. M The performance of the operational amplifier, the circuit diagram of which is shown in figure 1. is best seen from its input/output charac- teristic shown in figure 2. For small input voltages, the amplification is high; when the input voltage rises, the amplification drops off and finally remains almost static for further increases in input voltage. Some applications of a logarithmic amplifier are: driving a graphic recorder in weather stations, and in remote control systems (for instance, to avoid a too sudden and strong deflection of a servo arm). When used in conjunction with other equipment, the logar- ithmic amplifier is very flexible: analogue instruments a row of LEDs can be to its output. Operational amplifiers A1 and A2 form a non-inverting pre-amplifier. As the input signal of A3 should not under any circumstances be- come negative, the input level of the circuit can be shifted with poten- tiometer PI as required. At the same time, this stage works as a high- impedance input buffer for A3. As shown, the amplifier accepts inputs up to 8 V. If a higher value is required, the amplification factors of A1 and A2 can be suitably modi- fied. The 'logarithmic' part of the circuit consists of A3 and transistor array IC2: the voltage at pins 4 and 5 of the array is related logarith- mically with the output signal of A2. The output stage of the circuit consists of amplifier A4 which amplifies the inverted signal from A3. As the amplification factor of this stage can be altered by means of preset potentiometer P2, the output of the circuit can be matched to the load. To preset P2, connect a multimeter to the output of the circuit and a signal at maximum level to the input: adjust P2 to the required output voltage. * 7-37 >r july/august 1983 There are many occasions when a switching delay is required. One way of achieving this is to use an RC network and an inverter (see figure 1). This is quite practical and obvious as there are nearly always some gates 'left over' in a circuit. Unfortunately, every electronic component has a definite tolerance and so it is vir- tually impossible to determine the delay precisely in advance. However a considerable improvement can be achieved by connecting two inverter/ RC networks in series as shown in figure 3. The nominal threshold voltage of the inverter in figure 1 is half the supply voltage and has a tolerance of ± 30%. Figure 2 shows the signal input to the gate. If this input is between U c = 0.35 U b and U c = 0.65 U b the inverter may consider it either logic '0' or T! These voltages occur when a capacitor is charged through a resistor after a period of 0.43 t and 1 .05 r respectively, (r is the time constant of the circuit and is equal to R x C). The nominal threshold voltage U c = 0.5 U b is reached after a time of t = 0.69 t. If the two inverters and RC networks of figure 3 are used, each RC net- work must produce the same delay, equal to half the total value of figure 1. The total delay will then be % x 0.43 r+ % x 1.05 t = 0.74 rat its worst case! This is a lot closer to the nominal value of 0.69 t. The foregoing should make it clear why the circuit of figure 4 gives such consistently reproducible results. However, for really satisfactory operation, CMOS inverters must be used. The reason is that these gates have a threshold value of about half the supply voltage. Further, 1 their output will always be either zero or the supply voltage. Schmitt triggers should not be used! If the delay times using 4000 series CMOS are found to be too long the new 74HCXX series can be used. These are pin and function compatible to the 74LSXX series and just as fast! M stable zener As everybody knows the voltage drop across a zener diode is depen- dent on the current passing through the diode. Therefore, depending on the type and power of the device, there can be very noticeable devi- ations from the nominal zener voltage. This can be a problem. especially in circuits where a stable d.c. voltage is essential. The most logical way of solving the problem is to keep the current through the diode constant so that the zener voltage can not change. In order that the load connected to the zener diode draws a constant current, the zener can be supplied by means of a current source. Then the current through the current source is made dependant on the zener voltage. In our circuit we use a zener diode with a zener voltage of 6 V. Other zener values could be used if re- sistors R 1 . . . R4 are changed to suit another value. The maximum input voltage is mainly limited by the power which can be dissipated by T1 and T2. The d.c. input voltage must be at least as high as the sum of the zener voltages of D1 and D2. The current source consisting of T1 , R1 and D1 ensure that the current through D2 remains constant Tran- sistor T2, resistor R2 and zener diode D2 in turn form a current source for zener D1 so that the current through 12. ..25V 7-38 elektor july/august 1983 this diode also stays constant Diode D3 and the voltage divider, consisting of R3 and R4, ensure that this circuit can 'start' (just as a thyristor made of transistors). As soon as the voltage is switched on a current flows through D3 causing T2 (and therefore T1) to conduct. The value of R3 must be selected such that diode D3 blocks as soon as the voltage across the zener diode has stabilised. So care must be taken that the voltage at the anode of D3 is less than the zener voltage of D2 plus the diode's own voltage drop of 0.6 V. This is defined by the formule: — x U, < Un? + 0.6 V. Also R3+R4 1 uz the voltage at the junction of R3 and R4 must be at least 1.2 V, otherwise T2 will never conduct. M symmetrical voltages from a doorbell transformer This circuit is of interest not merely because it uses a bell transformer with a single secondary winding to provide symmetrical voltages for low-current applications but also because the final output voltages are greater than the normal bell transformer (220 V/8 V) output. In fact the final output can be as much as twice this value. This multiplication is achieved using two voltage doublers each consisting of two diodes and two capacitors, connected head to tail. Each diode/capacitor couple takes every alternate half cycle of the sinusoidal voltage such that the output voltage U is (theoretically) equal to 2\/2 U e ff., where U e ff. is the effective output voltage of the transformer. A current of 150 .. . 200 mA and 1 V of ripple can be expected using the capacitor values shown here. In order to increase this current without a similar increase in ripple the values of the capacitors may be made greater but Cl must be approxima- tely the same as C2, and C3 about the same as C4. To get a stable symmetrical output of ± 1 5 V two voltage regulators, a 7815 and a 7915, should be used. This will then allow a bell transfor- 'mer to be used for any small circuits with operational amplifiers requiring a symmetrical supply of 14 or 15 V and a current of 0.1 .. . 0.2 A. M If an LED is used in a circuit, the current for that LED is normally set with a limiting resistor. The LED can then be switched on and off by means of a transistor. However, the method shown in figure 1 does not take into account any variations in the supply voltage. A small vari- ation in the LED current can be very conspicuous especially when high efficiency LEDs are used. The addition of just one transistor can transform the circuit of figure 1 to a current source which can be switched on an off (for instance, with TTL levels). The circuit of figure 2 shows that resistor R1 has been moved to the emitter of T1 . When a drive voltage is applied to the input of T1, this transistor conducts which causes a current through R1. Transistor T2 controls the base current of T1 such that the voltage drop across R1 remains at 0.6 V. The current, I, through the LEDs and R1 is calculated by I = 0.6/R1. If, for instance, R1 is 12 SI, the current through the LEDs is 50 mA. Bear in mind that the dissipation of T1 is somewhat higher than in the circuit of figure 1 , but against that, the dissipation in R1 is not as high. M 7-39 .elektor july /august 1983 of will only play a minor part in the supplying of energy. The present interest in solar energy is therefore not surprising. Some work has already been done with solar cells and solar panels. However, these only operate with optimum perform- ance when positioned exactly at right- angles to the sun. Unfortunately, this situation is not usual in our latitudes unless the solar panels are rotated with respect to the sun. The efficiency of a solar panel system can be improved if the panels track the sun, and remain as long as possible at the most favourable angle of incidence. The circuitry required is relatively simple. It uses a window comparator which keeps the drive motor idle, as long as the two LDRs are subjected to the same illumination. Half the operating voltage is then applied to ’the non-inverting input of A1 and to 'the inverting input of A2. When the position of the sun changes, the illumination affecting LDRs R1 and R2 is different, if they are at an angle to each other as shown in figure 2. In this case, the input voltage for the window comparator deviates from half the supply voltage, so that the output of the comparator provides information to the motor for clockwise or anticlockwise ro- tation. Transistors T1 ... T4 in a bridge circuit cater for reversing of the motor. Diodes D1 . . . D4 serve to suppress voltage peaks which can be produced when the motor is switched. Preset potentiometers PI and P2 are used for alignment. They are adjusted so that the motor is idle when the LDRs are subjected to the same illumination. If less light reaches LDR R2than LDR R 1 , the voltage at point A rises to more than half the supply voltage. The result is that the outputof A1 goes high and transistors T1 and T4 conduct. The motor then 7-40 elektor july/august 1983 runs. If the illumination of the LDRs is then changed so that the voltage at point A drops to less than half the supply voltage, output A2 goes high and transistors T3 and T2 must conduct. The motor then rotates in the opposite direction. Small geared motors of the type used for models, with a suitable voltage and maximum operating current of 300 mA, are suitable for driving the solar panels. The use of this control circuit makes it possible to control the solar panel in one plane. Of course, in order to track the sun from sunrise to sun- down, two control circuits will be required: one for horizontal and one for vertical tracking. M 19 emergency mains cut-out If the voltage of the mains supply of a computer rises too high, compo- nents on the printed circuit boards can easily be damaged or even de- stroyed. This emergency cut-out placed between the mains supply and the load interrupts the supply when the voltage level exceeds a predeter- mined value. For many reasons it is possible for the output voltage of a power supply to rise to a dangerous level. The emergency cut-out described here has been set to the maximum supply voltage of 5.25 V that is stated by the manufacturers of TTL ICs. Zener diode D1 starts conducting just before the stated zener voltage is reached. A small current flows in the anode-gate circuit of thryristor Thl ; the level of this current can be set with preset potentiometer PI con- nected in parallel with the gate- cathode circuit of Thl. When the mains supply rises, the current through the zener diode becomes large enough to cause the thyristor to fire. The firing level lies between 5.2 ... 6 V. As soon as the thyristor fires, the mains supply voltage drops substan- tially because the thyristor virtually short-circuits the mains supply. In the case of a supply without current limiting, fuse FI prevents the current attaining too high a value. The rating of the fuse depends, of course, on the load requirement. During testing and adjusting of the circuit, it is important that the thyristor continues to conduct after it has been fired until its current has dropped to zero. The firing voltage level can be set by means of a mains supply with a current limiter before it is put into use. If it proves imposs- ible, for instance because of the tolerances of the zener diode, to set the firing voltage to the required value, try using a 5.1 V zener diode. simple baud rate generator The generator described is a good- value-for-money alternative to the commercially available types; it uses only one CMOS-IC and provides up to seven different baud rates. Each serial data interface requires a baud rate generator: terminal, printer, tape interface ... It is often not possible to use the same generator for input and output, so it would be useful to add one to, for instance, the UART in the computer or the UART in the terminal. To keep the costs of such an addition down, we have developed a generator which uses just one 1C, two resistors, one preset potentiometer and a capacitor. The CMOS 4060 is a 14-stage binary counter with an internal oscillator which only requires the frequency determining RC components. As the reset is connected to earth, the counter begins to count upwards when the supply is switched on. A clock frequency then becomes available at the outputs: the higher the number of the output, the lower the frequency available at it. In the circuit shown the frequencies avail- able at the various outputs are: Q4 = 9600 baud Q8 = 600 baud Q5 = 4800 baud Q9 = 300 baud Q6 = 2400 baud Q10=150baud Q7 = 1200 baud If the outputs are wired as shown in the circuit diagram, the required baud rate can then be selected by means of a wire link. The oscillator frequency can be set precisely with PI, and measured either at pin 9 of the 4060 or at one of the outputs Q4 , . . Q10. With the values shown, the frequency at pin 9 should be 38.4 kHz; at the outputs Q4 . . . Q10 the relevant baud rate. It is often required that the clock frequency is 16 times the baud rate (for instance, with asynchronous operation of the 6850, 8251, Z80- SIO. . .). In that case. Cl must be replaced by a 27 nF capacitor and the oscillator frequency must be set to 614.4 kHz. H jr july /august 1983 flashing running light Roadworks are usually marked during the hours of darkness by yellow flashing lights. These may often be linked together to form a 'running' flashing light. Road diversions and the like are then clearly visible. The circuit described here provides a similar effect but for use in model roadways for instance. The speed of the 'running' row of LEDs is determined by the fre- quency of the clock generator N1 . 1 Depending on the type of 1C used, this frequency will be of the order of 6 Hz ± 30% when potentiometer PI is in mid position. The output of the clock generator is fed to the Johnson counter IC1. The outputs of this counter become logic 1 in sequence. The counter is reset to the start when Q4 goes to logic 1 . This explains the link between pins 15and lOof IC1 .Outputs QO . . . Q3 are connected to four monostable multivibrator circuits consisting of N2 . . . N5. The multivibrators are triggered by the negative going edge of the square wave outputs of QO . . . Q3 and the pulse period can be preset with potentiometers P2 . . . P5 which of course determine how long each group of LEDs will light. These periods need to be more or less equal to ensure smooth running of the lights. The circuit uses four groups of four LEDs each. The LEDs in each group will light simultaneously. Figure 2 shows how the LEDs should be connected for road markings in a bend: LEDs D16, D15, D14and D13 0 Resistors: R 1 = 47 k R2 . . . R5.R10. . . R13- 10k R6 . . . R9 = 22 k R14 . . . R17 = 47 n PI . . . P5 = 1 M preset potentiometer Cl = 330 n C2 . . . C5 = 100 n C6 = 10 p/16 V T1 . . . T4 = BC 547 B D1 ...D16 = LED yellow IC1 =4017 IC2 = 40106 7-42 elektor july/augus! 1983 light first, followed by D1 2, D1 1 , D1 0 and D9, and so on. Schmitt triggers N2 . . . N5 are not capable of supplying sufficient cur- rent for the LEDs and therefore the buffers T1 . . . T4 are included. The current through the LEDs is about 30 mA during each flash; the average current taken by the circuit operating at the highest frequency is of the order of 30 mA. When, however, the flash period is longer than the running period, the current con- sumption may rise to a maximum of 100 mA. The printed circuit board (see figure 3) is fairly compact. The preset potentiometers are neatly grouped together and all terminals are located at one edge. The four groups of LEDs are connected to pins A . . . D which are clearly marked on the circuit diagram and the-board. H It can be very handy if the micro- processor can be put into single step mode when debugging home made programs. This little extra can be realized by constructing the circuit described in this article. Readers who own a 2650 /xP - amongst them a lot of game computer owners - have had to do without this facility . . . until now. The 2650 can be put into single step mode by making the /iP believe that it is connected to a very slow memory. Consequently, the address and data bus remain valid during each read or write mode until a switch is pressed. In this way, all addresses and data can be checked step-by-step without running into problems. The circuit, consisting of two flip- flops, a switch and a logic gate, uses the OPREQ (operation request) and OPACK (operation acknowledge) signals to combine them in to a 'new ' OPACK signal. The 'old' OPACK signal is combined to output Q of FF2 via OR gate N1. The original OPACK line must be broken and particular attention paid to ensuring that the pull up resistance at the PVI side remains. OPREQ is logic 0 before each memory cycle, thus setting the 74LS74 and making OPACK logic 1. The memory cycle starts wh en OPREQ, together with OPACK , is logic 1 : this indicates that the processor must wait until OPACK is made logic 0 by pressing SI. Flip-flop FF1 is used to debounce switch SI. A multimeter can be used to check the data and address bus once this extension has been installed. How- ever, owing to the interrupts, some "weird' things may take place inside the games computer. As the processor directly carries out an interrupt after the reset has been pressed (address bus = 0000, data on FI ), it seems as if there's something wrong. It is, therefore, advisable to get rid of the interrupt between CPU and PVI, but remember, when doing this, that the pull up resistance at the CPU must remain. Once this is done, reset the program and there will be no further problems. Last but not least, a practical hint: it is recommended to use a push button with change-over contact for SI. H CPU OPREQ PVI o o 7-43 >r july/august 1 983 23 1MHz time base without crystal Clock generators, for instance, those used in microprocessor systems, are normally crystal controlled. Although crystals have become cheaper over the years, they are still expensive items. A ceramic res- onator offers an inexpensive alterna- The sixth significant digit is not often of great importance in a 1 MHz time base, but high frequency stability is. And that is guaranteed by a ceramic resonator (or filter, as it is often called). The circuit shown produces a clock frequency of precisely 1 .07 MHz and is eminently IC2 ICt suitable as clock generator for a microprocessor system. There is not much to say about the circuit which consists of two ICs, a resistor, a trimmer and the ceramic resonator. The oscillator proper consists of N1, N2, PI, R1 and the ceramic filter: its output is applied to inverter N3 which improves the slopes of the signal. The signal is then fed to input B of decimal counter IC2. As output Qq is fed back to input A, the frequency of the output available at Qa is exactly one tenth of the oscillator fre- quency. IC2 can also be connected as a 5 : 1 divider to give a clock frequency of 2.14 MHz, which may be of interest to Z80 enthusiasts. The circuit also works very well with a 455 kHz ceramic filter. To ensure correct operation of the oscillator at this low frequency, preset poten- tiometer PI has been included. The clock frequency is, in this case, 45.5 kHz (or 90.1 kHz if a 5 : 1 division was decided upon). A final note about the 74LS90. Contrary to usual practice, the power supply pins are: pin 5 (+) and pin 10 (— ). H N>S machinegun- soundgenerator Oh r‘0l Computer games are even more fun when they are accompanied by sound effects. As most such games have a more or less destructive character, a machinegun-sound gene- rator will often come in very handy. The circuit consists of three nearly identical generators of which the output signals are added in a particu- lar ratio. This gives the impression that there are three machinegun posts. Each sound generator consists of three astable multivibrators (AMVs) which are connected in series by diodes. Each AMV can only associated with the final pair of oscillate if the output of the preced- AMVs to enable control of the fre- ing AMV is logic 0. Two of the gener- quencies. These frequencies deter - ators have a preset potentiometer mine the 'speed' of the gun fire. The output level can be set with poten- tiometer P3. The current consump- tion of the circuit is not greater than 2 mA for a supply voltage of 5 V. 7-44 july /august 1983 The simulated gun fire sounds best if the final amplifier is ad- justed for maximum bass and mini- mum treble. The volume should be set so that the amplifier does not clip, as this will produce unnatural sounds. If you don't like the sound of machinegun fire, the circuit can be used to imitate the sound of a woodpecker. This is rather more peace loving, but it will be difficult to find an exiting computer game heavily involved with woodpeckers! In spite of the advantages of a visual display unit for a computer this, now common, medium has not entirely eclipsed its predecessor- paper; in fact one of the most important computer peripherals is the printer. With this in mind, the 1982 July/August issue contained a circuit for using a printer with the Elekterminal (Elektor No. 87/ 88, page 7-91). Here we deal with the same basic idea but with a more up to date, versatile project which, moreover, is better suited to the Centronics interface used by most current printers. We refer to Centronics as the norm because reading through the users manuals supplied by various manufacturers it is obvious that the only difference between them is that the wiring of the con- nector is different or certain signals are just left out completely. So it is a good idea to check the wiring of the connector of any printer before using it. For our interface we have only kept the signals which are common to all current models: there are 8 data lines (the Centronics interface has parallel input), a data checking bit (DATA STROBE), the BUSY line which is active to signal that the printer cannot receive any data, and the SELECT line which deter- mines whether the printer is in use or not. And of course there are also the earth connections and the shielding wires (twisted pairs). Secondary signals are possible such as Paper Out (or Paper Empty), Fault, . . . and so on but as we are not using them anyway there is no need to list them. On the Junior Computer interface card the VIA 6522 has two ports which can be used without any complication. As can be seen from the diagram, lines PA0 . . . PA5 are left free, and could be used to control particular signals for example! Everything else is quite straightfor- ward: the eight data bits (PB0 . . . PB7) can handle the com- plete set of ASCII characters (7 bits), and also allow particular features of the printer to be used (for example graphic symbols, Greek letters, Japanese ... or whatever). Line CB2 of the 6522 provides the data checking signal, consisting of a pulse of at least a microsecond transmitted at least one microsecond after the data bits are fixed on port B. Line PA7 is an input to receive the BUSY signal, while PB6 transmits infor- mation to the computer regarding the mode of the printer: if SELECT is at a high logic level the user knows that the printer is printing; if SELECT is logic low then the printer is not printing! It should be noted that the SELECT line is also influenced by the 'out-of- paper' detector: when the printer runs out of paper it deSELECTs itself. Included here along with the pin designations of the Centronics connector is a small set of instruc- tions, in the form of a subroutine, which enables the best use to be made of this parallel interface. Note that the configuration of input and output ports is renewed every time the subroutine begins, which means with each character. The ASCII code of the character to be printed must be present in the accumulator when the subroutine starts, as the contents of registers X and Y are not safeguarded. The LDA AHOLD instruction found at the end of PAROUT is needed with the DOS on the Junior Com- puter, which calls this subroutine, but what appears is not in fact the code of the character to be printed in the accumulator, which is contained in AHOLD. DOS-Junior users should note that another small modification is needed as well as including the subroutine at address S24E2. This occurs at address $231 7 where $9E must be replaced by $E1. The 10 instruction described in the Ohio Scientific users manual allows very versatile control of the printer: 10,08 should be used if only the printer is in use; 10,09 if the parallel and serial outputs are used simul- taneously. H 745 It happens from time to time that it would be nice to read the position of a potentiometer with a micro- processor. For those many computer enthusiasts we have designed a simple circuit to do this. Only one 555 and one input line to the processor are needed. Care must be taken in the construction to prevent hum. The interface should also be of interest to other computer enthusiasts who just want to experiment with their equipment. Integrated circuit IC1 oscillates con- tinuously: capacitor Cl is charged via resistor R 1 and potentiometer PI and then discharged through PI. This means that the discharge time is dependent on the setting of PI and this, in turn, means that the time during which the output of IC1 (pin 3) is logic 0 is directly pro- portional to the resistance of PI. If the resistance of PI becomes less than lOkfl, there is a likelihood that oscillations will cease. When the microprocessor measures the time that the output of IC1 is low, it produces a number which is directly proportional to the resist- ance of PI . This can be done easily by incrementing a register until 37E8 00170 A 000 010000 00180 A003 1E80 00190 A 005 21E837 00200 A 008 7E 00210 A 009 A3 00220 A00A 28FC 00230 A00C 7E 00240 A00D A3 00250 A00E 20FC 00260 A01 0 03 00270 A01 1 7E 00275 A012 A3 00280 A013 28FB 00300 A015 0 9 00310 0000 00320 00000 TOTAL ERRORS INPUT EQU START LD LD LD LOOP0 LD AND JR LOOP1 LD AND JR ZERO INC LD AND JR STOP RET END 37E8H BC. 0000 E.80H HL, INPUT A. (HL) Z, LOOP0 A, (HL) E NZ, LOOP1 BC A, (HL) E Z. ZERO the output of IC1 becomes logic 1 again. A large value of PI gives a high count. The program is a sub-routine which can be placed on any free address in a Z80, 8080 or 8085. Instructions LD A, (HL) and AND E read the level at pin 3 of IC1 which in this case was connected to the seventh data bit (E contains 80 i 6 ). During loop 0 there is a delay until the output of 1C 1 becomes 1 ; this is necessary because it may happen that the routine is started during a 'O'. Subsequently, during loop 1 there is a delay until the output of IC1 is low. Thus the real count -loop zero continues as long as pin 3 of IC1 is logic 0. Counting takes place in a double register (BC) but can equally well be done in a single register. In the latter case, the run is slightly faster, that is, 27 instead of 29 clock pulses. Input is the address to which the output of IC1 is connected. In line 190 the input mask in register E is set: only bit 7 is read. Finally, the calculation of Cl . If PI has a value of 100 kfi, BC must con- tain for instance, 100io, for which 100 x 29 = 2900 clock pulses are re- quired (for a 4 MHz clock this would be 725 ps). The time, t Q , during which the output of IC1 is 0 is given by t Q = 0.69 P 1 C 1 . In the case being considered. Cl would be 10.5 nF; in practice the next standard value of 12nF would be used and P2 adjusted until the register has the correct value. If you have to buy 1C 1 , choose the 7555 CMOS version which causes far less interference to the power supply! M fairly independent of the amplitude of the signal and could be used, for example, as a trigger for an oscillo- scope. Op-amp IC1 is connected as a buffer stage and its non-inverting input is set to half the supply voltage by means of R1 . . . R3 and C2. The reference voltages are derived from the (buffered) input signal, via D1, D2, C3 and C4. Capacitor C4 charges through D1 to half the supply This circuit gives an output voltage when the input voltage rises above a certain reference level which is derived from the positive and negative peak voltages of the input signal. Therefore the trigger circuit is elektor july/august 1983 voltage plus the positive peak voltage of the input signal. C3 is charged through D1 and PI , but in this case diode D2 ensures that the voltage across C3 is not more than half the supply voltage minus the peak negative voltage. The values chosen in this part of the circuit are such that the reference voltages across the capacitors stay very constant when the input signal has a fre- quency of more than about 10 Hz. The signal output from I Cl travels directly to the non-inverting input of comparator IC2. The inverting input of this comparator is connected to the wiper of PI, and this poten- tiometer is used to set the reference voltage. This reference level can be anywhere between the positive and negative voltage peaks of the input signal. As long as the voltage level of the input signal is now above the reference value IC2 will deliver an output voltage (which is in practice equal to the supply voltage). If the level of the input signal falls below the reference level the output of the op-amp falls back to zero. H LED 'amplifier' The light emission of an LED is normally pretty low. If more brightness is required, the following circuit will help. The LED to be 'amplified' is replaced by an LED in an opto-coupler which switches a lamp (for instance, a signal lamp) connected to the mains supply. When the LED in the opto-coupler lights, the photo transistor con- ducts. This causes a gate current to flow to the triac via R1 : the triac fires and the lamp lights. Resistor R1 is connected to 30 VDC which is derived from the mains supply via D1 and R4. Two zener diodes, D2 and D3, limit the voltage across buffer capacitor Cl to 30 V. The three transistors T1 . . . T3 ensure that the triac can only be fired at the moment the mains supply changes from positive to negative, thus reducing interference problems. When the voltage in the positive half-cycle of the mains supply rises above 7 V, the voltage at the junction R3/R4 becomes high enough to cause T1 to conduct. The cur- rent through R1 is then fed to T1 so that the opto-coupler can no longer feed a gate current to the triac. The same thing happens during the negative half-cycle but then T2 and T3 conduct when the voltage across R2, R3 and R4 goes more negative than —7 V. This is a form of zero voltage switch and it ensures that firing of the triac can only take place when the mains supply is about 0 V. K 29 economic LED R = UB ~ ULED ■ led Thus the voltage difference between supply voltage and forward voltage is dropped by the limiting resistor. However, the disadvantage is that the power dissipated by the limiting resistor is fairly high if the supply voltage is relatively high. Thus, for example, with a supply voltage of 24 V and a current of 25 mA the The usual method of operating an LED from a voltage which is higher than its forward voltage is well known. A limiting resistor is used to limit the LED current to its rated value. Calculating the value of the resistor is simple enough: supply voltage minus LED forward voltage divided by the maximum current rating of the LED. The formula is: 7-47 elektor july /august 1983 power dissipated is greater than 0.5 W. There is an alternative: the circuit shown here only requires 0.1 W. It is effectively a switched current source. The current source is based on transistor T1 and the oscillator uses a 3140 operational amplifier. When transistor T 1 conducts, a current flows via coil LI, LEOD1 and resistor R3 to earth. The current curve is shown in figure 2. As soon as T1 turns on and a current flows, the current rises together with the volt- age at R3 from zero volts. This voltage is now applied to the non- inverting input of the operational amplifier. A reference voltage of approximately 0.25 V is applied via voltage divider R1/R2 to the in- verting input. If the rising voltage at the non-inverting input reaches the level of the reference voltage, the output of the operational amplifier switches to a high voltage potential. Transistor T1 turns off and the current through the LED flows via diode D2. As shown in figure 2, the current drops; the voltage at R3 therefore drops also. Once the current and voltage are sufficiently low, the operational amplifier switches over again and the transistor turns on. This operation is repeated periodically. The switching point is adjusted with -preset potentiometer PI. This -governs the changeover voltage at pin 3 of the operational amplifier which, in turn, governs the maximum LED current. It should not exceed 50 mA. The frequency of the oscillator (which is also the switching fre- quency for the transistor) is deter- mined by coil LI and by the switching hysteresis adjusted with PI. With the specified value of 4.7mH the switching frequency is about 15 kHz with a period of approxi- mately 65 ps. Two other switching frequencies using different coil in- ductances can be found in the following table: Coil T F 2.2 mH 35 ps 30 kHz 10 mH 150 ps 6 kHz PI should be adjusted to obtain the lowest frequency at which the circuit still starts to oscillate. M 30 simple regulated power supply If you compare the expense and the rating of this power supply you will get a surprise, because the output voltage and current are fully ad- justable between 0 ... 18 V and 0 ... 1 .8 A respectively and smoothing capacitor (C2). Diode D5 and capacitor Cl produce a negative auxiliary voltage, which is stabilized by zener diode D6 and capacitor C4. The negative voltage provides the negative supply for the two ICs. All this is necessary to enable the output voltage to be adjusted down to zero volts. During the construc- tion of this part of the circuit bear in mind that the positive lead of elec- trolytic capacitor C4 is connected to earth! Regulation is provided by IC1 and IC2. Capacitor C3 suppresses any residual transients at the input of IC1 and it should therefore be connected as closely as possible to IC1 (similary C4 and IC2). The reference level output from pin 4 of IC1 goes to the voltage divider made up of R5 and P2 (this pot sets the value of the output voltage). IC2 is connected as a differential amplifier and compares the signals at its two inputs. The difference between the inputs is the voltage drop across 'current' sensor R4. This 1C feeds the current sensing input (pin 2) of the L200. PI in the feedback loop of the 741 is used to vary the output current of the circuit. IC1 must be mounted on a suitable heat sink as it dissipates nearly all the power of the circuit. The power supply can quite easily be built into a case and a voltmeter and ammeter mounted on the front panel. In view of the accuracy of the circuit these should ideally be digital meters, but virtually any type will do. H have still been kept very reasonable. Refering to the circuit diagram: the input comprises a mains switch, fuse, transformer, bridge rectifier and 7-48 slekior july/august 1983 31 software RAM tester Elsewhere in this issue we have a circuit designed to aid fault-finding in microprocessor systems. However, there are fault-finders and fault- finders and here we have one of the latter types. In fact it is a RAM-test program and it is aimed at helping amateurs or hobbyists who do not want (or cannot afford) special test equipment. Many RAM-test programs are simple and can trace simple faults such as defective memory locations. How- ever, they do not show up all the possible faults such as a defective 18FA START LOOP TEST address decoder or buffer, timing faults or any of the various other problems that can (and do) occur. Of course a logic analyser would make the job of trouble shooting a lot easier, but for many people such equipment is in the category de- scribed as 'Very nice, but. . .'. So here is a program that uses the computer to trace faults in RAMs and display them on the oscillos- cope screen. What could be simpler? The program example (for a Z8Q) shows the principle of this type of software. The address of the memory location under scrutiny (TEST') is loaded into HL In the program loop (called 'LOOP' for some strange reason) the contents of this memory location is read, and then inverted (so '1' becomes '0' and vice versa) and finally it is written into the same memory location. This oper- ation is repeated ad infinitum. The write pulse of the system is used to trigger an oscilloscope. Thus the scope is triggered once every time the 'LOOP' is executed and thus the data is displayed on the screen. HL .TEST ; MEMORY TEST LOCATION A,(HL> ; READ MEMORY 8FFH : COMPLEMENT (HL).A i WRITE MEMORY LOOP ; AGAIN Correct data will keep alternating between '1 ' and 'O', if the data is not correct (for example if a T is continually read), the processor continually writes exactly the op- posite (a '0'). This is, of course, immediately evident on the oscillo- scope. By 'following' the data with the probe of the oscilloscope as it travels through the system, the problem point can be traced. The suspect 1C can then be replaced or whatever measures necessary can be taken to cure the fault. This program could easily be ex- panded so that HL is incremented by one every time the loop is executed, so the next memory location will automatically be selected unless a fault is detected. This would make a separate RAM-test program superflu- ous. Obviously either read or write instructions could be used with absolute addressing, in which case the HL register is not needed for addressing. Alas, not every processor, has this facility. hp E tester This hFE tester is interesting because of its simplicity and because it enables the 0 of both PNP and NPN transistors to be measured. Further- more the measurement is independent of the supply voltage of the tester. As the diagram shows, the base current of the transistor under test travels via R1 . Its base current Ib is thu. „ u xv r -Ube The voltage drop across the collector resistor is hFE x Ib x R2. PI is used to set a reference voltage derived from voltage Uxy - UD1 < or D2for a PNP transistor). This means that the setting of the potentiometer is directly proportional to the hpE of the transistor under test and is independent of supply voltage. The voltage across R2 and the voltage set with PI are compared by IC1 which is connected as a compara- tor. Potentiometer PI is now set so that the LED at the output of the op-amp just lights or is just dimmed. At this setting the voltage across the potentiometer is equal to the voltage across R2. Switch SI is used to switch from NPN to PNP (or vice versa) by reversing the polarity of voltage Uxy LEDs D3 and D4 in the supply lines ensure that the input voltages to be measured are within the common mode range of the op-amp used. H 749 prelude buffer In the final Prelude article. Prelude p.s. in the May issue, we described a buffer stage that can be used at the inputs and record output of the unit. As promised here we have the design for the printed circuit board (figure 2) for this buffer. The circuit diagram is repeated again in figure 1 . The buffer consists of a super emitter follower, in which the actual emitter follower is formed by connecting T1 and T2 in cascode. The load of the emitter follower is a current source, consisting of another cascode con- nection (T3 and T4). The resultant circuit has excellent linearity and very low output impedance: effec- tively zero ohms. There are significant advantages to be gained by the use of these buffers: Crosstalk between the channels and between the various inputs is reduced to a negligible level (better than 60 dB). I The External-In input can also be provided with level control by using one of these buffers. 2 The output impedance of Tape Record 1 and 2 and Ext. Out will no longer be dependent on the preset potentiometers. The original presets on the connec- tion board (P2 . . . P5, P2' . . . P5') have an effect on the crosstalk; to what extent depends on the position of the wiper. This is because they increase the source impedance of whatever audio equipment is Resistors: R1,RT = 100 k R2,R2* = 2k2 R3,R3' = 47 k R4,R4' = 1 5 k R5,R5' = 3k3 R6,R6' = 12 k R7,R7’,R8,R8' = 1k5 R9,R9- = 820 n RIO, RIO' = 330 k PI, PV = 50 k (47 kl preset potentiometer Capacitors: C1,C1’ = 330 n C2,C2‘ =10 m/ 16 V C3,C3’ = 680 n C4,C4' = 22 m/ 10 V Semiconductors: T1 , . . T4,T1- . . . T4' - BC 55GC connected, by up to 62.5 k (with the wiper in mid position). A buffer board gets around that particular problem. That is not to say that an input buffer is always necessary. Forgetting about unused inputs for the time being, an input buffer is unnecessary in all cases when the source impedance of the signal source plus preset or voltage divider is not greater than about 2 k (when dealing with crosstalk the aim is to reduce the source impedance to 2k, but there is no need to reduce it any further). Because the printed circuit board should be as small as possible, all resistors are mounted vertically, and the same goes for C2, C2', C4 and C4'. The boards should be connected as close as possible to the inputs and outputs. Where a channel is fitted 7-50 elektor july/august 1983 with a buffer the original preset potentiometer is removed and the wiper and the connection which was not grounded are bridged with a wire. Buffers are not needed for the MM outputs as their impedance is already very low. Figure 3 shows how one or more buffers can be mounted. There is a provision made for two places where the phono sockets can be connected, but a different jumper must be included for each. This is either the one shown dotted, or its solid equivalent. Figure 4a aux. inputs, and figure 4b is the method to be used with the tape 1 , tape 2 and ext. inputs. For one board four 3 mm holes must be drilled in the connection board. Break the connection between the phono sockets and the back panel of each input to be buffered and connect the buffer board with two short pieces of wire. Connect the 1 point to ground on the back panel. The supply voltages ±A and ±A' can be taken from the MC board. H shows how the buffer can be nected in series with the tunei battery economizer slektor july/august 1983 electronics and plant physiology That trees and plants have a soul has been known to plant lovers and gardeners for a long time. For all those who have never given this a thought and who have never done more to plants than water them, we give here a circuit which will make it possible to get into closer contact with those oft-forgot- ten members of his or her 'family'. Many will dismiss this experiment as belonging to the realms of parapsy- chology, but it has already been pos- sible to measure a non-periodic signal between 1 and 40 Hz with an ampli- tude which varied between 0 and a few microvolts. These signals can without any doubt be traced back to plant activities. The oscilloscope traces are often not directly connected with manipu- lation of plants. Particularly at the beginning of a series of experiments, a violent reaction could be observed in the plant before the traces shown in figure 3 could be made. Whatever caused the traces, it is certain that in order to understand plant be- haviour and make further measure- ments, an amplifier with a high degree of amplification and noise suppression is necessary. The input circuits (see figure 1) are therefore high-input-impedance amplifiers, A1 and A2; the input impedance is 1 M ( R 1 and R2). The signal is subsequently applied to a differential amplifier, A3, which has an amplification factor of about 10. The amplification of the input amplifiers has therefore been kept low, so that A3 can not be driven to saturation. Mains hum and high fre- quencies are filtered from the output of A3 and this is done by means of active low-pass filter A4, the cut-off frequency of which is about 50 Hz. A passive high-pass filter (C3, R13) then removes any DC components which have not been filtered by A4; the cut-off frequency of this filter is about 1 Hz. Subsequently, the signal is fed to a non-inverting amplifier, A5, of which the amplification factor is about 1000. Because of the high input impedance of A5, it does not have much effect on the high-pass filter. As each amplifier stage reintroduces pass and a high-pass filter. It would be possible, with a suitable oscillo- scope, to make measurements across R1 9, were it not for the fact that we want to connect a recorder or VCO or something similar and the signal will therefore have to undergo further amplification. This is effected by A7. The total amplification of the circuit can be adjusted by means of potentiometer PI between 85 dB and 120 dB. At maximum amplification, the '1 V per scale division' range of the oscilloscope will measure 1 microvolt. To prevent mains interference in 7-52 elektor july/august 1983 this highly sensitive amplifier, the supply is provided by two batteries. And to really be able to make full use of the sensitivity, mains inter- ference should also be filtered from the oscilloscope or recorder or VCO mains supply. This could be done with an opto-coupler but an LED and LDR in a light-proof box will do nicely. The absorption circuit of the LDR could be supplied from a mains power unit, but here again a battery would be preferable to prevent interference finding its way to the amplifier. If you want to obtain measure- ments which can be used as proof, a series of measurements will have to be made over a period of time (including when you're not home). d.c. voltage doubler using a 4049 This simple circuit can produce a d.c. voltage which is approximately twice the supply voltage, in the no- load condition. The 4049 1C contains a total of six inverters. Two of them, N 1 and N2, form an oscillator together with R1 and C3, of which the frequency is about 10 kHz. The remaining inverters, N3 . . . N6, are connected in parallel and operate as a buffer stage to reduce the load- dependence of the circuit. Depending on the clock signal of the oscillator, pointA in figure la is connected to the earth rail for a particular time per period and to the supply voltage for a particular time. Whilst point A is connected to earth, capacitors Cl and C2 charge up to the supply voltage via diodes D1 and D2. The oscillator then switches point A to the supply voltage potential during the remain- This cannot, unfortunately, be done by just an oscilloscope, but by a data recorder. This is, however, a very expensive piece of equipment and can be substituted by a VCO of which the signals are recorded on And now for the method of measure- ment. The first that's needed is a signal detector and the simplest is a set of gold-plated pins from an 1C socket. Better are small sensor plates which have been lightly covered with conductive paste before they are attached to the plant. Three pins or sensors are required: the central one must be connected to the screen of the connecting cable; the other two go to inputs A and B. It is important that both these conductors are separately screened, the screen being connected to earth at the amplifier end. The detectors should be attached to branch or plant stem not more than 2 ... 3 cm from one another (figure 2). The recording equipment must be earthed at the mains input. It also advisable to build the amplifier into the smallest possible case; an earthed metal one is not absolutely necess- ary, but it cannot do any harm. With properly functioning equip- ment, the output signal should re- semble the traces shown in figure 3: these give the required information as to the voltage variations occurring in plants and trees. The resolution in case of a data recorder should, of course, be such that a readable trace is produced: paper feed speeds of 0.5 ... 1 cm per second are ideal, but in order to keep paper costs down, it is advisable to use lower speeds. Finally, we would be most interested in hearing from readers about their researches into plant physiology. N Table. ing period, capacitor Cl transfers a part of its charge to capacitor C2. This causes the voltage across capaci- tor C2 to rise to almost twice the supply voltage. If D 1 is connected to earth and the polarities of diodes D1, D2 and capacitors Cl, C2 (figure 1b) are reversed, the output at A will be a negative voltage and, in the no-load condition, it will be at the same level as the supply voltage. In both cases, unfortunately, the output voltage is dependent upon the load. As the load increases, the output voltage drops; in contrast, the superimposed a.c. level rises. The table shows the values measured in the circuit for load currents of 5 mA, 10 mA and 15 mA. H 7-53 voltage booster regulator There are various ways and means of drawing more current from a voltage regulator 1C than it was originally intended to supply, but most methods have their disadvan- tages. If, for instance, a power transistor is connected in parallel with the 1C, the supply will no longer be protected against short- circuits. That can, of course, be remedied by adding a current sensor in the shape of an extra transistor which, during overload conditions, cuts off the base current to the power transistor. But this solution suffers from a heavy power loss during short-circuit conditions, which is not really acceptable either. The circuit given here shows that a simpler solution is possible: the power transistor, T1, is provided with an emitter resistor! This ef- stay awake alarm Do you turn over in the morning and then often oversleep? This circuit could prevent you being late for work, but it can also be used as an egg-timer (soft-boiled only). When you first wake up, switch on this alarm: nothing happens at first, but after a time lapse of between 20 seconds and 4 minutes, adjustable by potentiometer PI, a soft warning tone sounds. If you're still awake, press the reset button. If you do not, 7-54 suitable for currents up to 2 A. If higher values are required, some components need to be changed according to the table. For currents above 7 A, transistor T1 must be replaced by two parallel-connected transistors each of which has an emitter resistor, R1 and R1' res- pectively. H fectively solves the problem, because the current through T1 is then proportional to the current supplied by the voltage regulator. If the 78XX regulator and T1 are moun- ted onto the same heatsink, the transistor is also thermally protected! The output voltage is dependent only on the type of voltage regulator used and, as drawn here, the circuit is because you fell asleep again, the alarm tone, which is a lot louder than the warning tone will really tear you away from those dreams. You can press the reset button again and doze off for another alarm cycle, or if you're really awake you can switch the alarm off! Operation of the circuit is as follows: N5 functions as a clock generator for the seven-stage binary counter IC1. After every 16 clock pulses output Q4 of IC1 changes state from 'V to '0' or vice versa. After 128 pulses output Q7 is logic '1', but as Q4 is then logic 'O', the output of gate N1 remains '1'. Now the inputs to N3 are '1' so the output of N4 is also '1' and this drives the audio oscillator consisting of N7, R5 and C4 which in turn drives transistor T2 and sounds the warning tone. Sixteen clock pulses later, Q4 again becomes logic '1', and the output of N4 becomes logic 'O'. Audio oscillator N7 is cut off and the warning tone stops. At the same time, however, the output of N2 becomes '1' and actuates alarm tone oscillator N6. This drives T1 and the alarm tone sounds. After yet another 16 clock pulses, output Q4 is '0' again, and the output of N1 is logic '1'. Again, the warning tone is sounded. And so on . . . If the reset button is not pressed, output Q7 is again logic '0' after 256 clock pulses. The outputs of N1 and N3 both become logic 'V and N2and N4, 'O': both oscillators are now cut off and the situation is as it was on switch on. As the logic 1 level for the reset signal is taken from output Q7, the counter can only be reset via SI when Q7 is 1. If you want to cheat, you can, of course, unsolder R3 from the 1C and connect it directly to the 9 . . . 15 V supply. Neither T1 nor T2 conducts when the oscillators are off so this reduces the quiescent current to only about 0.2 mA. As shown, the current drawn is about 4.3 mA during the warning tone and 120 mA while the alarm tone sounds. The loudness of >r july /august 1! both tones can be adjusted to meet individual requirements by changing the values of R6 and R7, but neither should be less than 10 £2. The oscillator frequencies can also be varied by means of C3/R4 and C4/R5 respectively. Instead of output Q4 it is also possible to use outputs Q3 or Q5. When Q5 is used, the change-over between warning and alarm tones takes twice as long as when Q4 is used, whereas Q3 gives half the time lapse of Q4. H 2 • Burglars are often grateful for the fact that someone goes on holiday for a couple of weeks and leaves the home untended. We often make it very easy for the burglar as well: if, for instance, no light is seen in the house for, say, a week, it is pretty certain that nobody is at This circuit was designed to mislead potential burglars: the anti burglar light switches on one or more of the house lights when it gets dark and leaves them on for 1 ... 5 hours. During that time the lights are switched on and off at random. When darkness sets in, the resistance of the light dependent resistor (LDR) R1 increases causing the output of gate N6 to go to logic 'O'. The point at which this occurs can be preset with PI. The reset input (pin 12) of counter I Cl is then also logic '0' and IC1 begins to count. The counter contains an internal clock oscillator the frequency of which is determined by capacitor C2, potentiometer P2 and resistor R4. P2 enables the ad- justment of the frequency between 0.9 Hz and 4.5 Hz. From the time that IC1 starts to count, the output of N5 will be logic 'V but the output of N7, and therefore transistor T1, will remain unaffected until a logic '1' also appears from N8. This will obviously be generated by IC2 and its associated gates. During the time that IC1 is counting it is feeding clock pulses to IC2. These are taken from the Q9, Q10 or Q12 outputs (pins 13, 15 or 1) of IC1. The out- puts of IC2 together with gates N1 . . . N4, N8 and N9 form a quasi random generator that, via gate N7, controls transistor T1 and switches the house lights on and off. This hopefully puts off our burglar friend by giving the appearance that the house may not be as empty as he would have liked! After a certain period of time (1 to 7-55 >r july /august 1983 5 hours), output 14 of IC1 eventu- ally returns to logic '1 This causes a number of things to happen. Via diode D1 it stops the internal clock oscillator. This then holds Q14 at logic '1'. Now gate N7 is inhibited thus switching off the house lighting. All will remain at peace with the house (our phantom occupants are in bed) until the following evening when the process begins again. By now our less than happy burglar has gone off to less active residences! Calibration of the random generator is fairly simple. The sensitivity of R1, that is the light level at which N6 desides to switch, is set by PI. The total operation time (of IC1) is set by P2 while the random 'pattern' is determined by which of the Q outputs of IC1 is used to clock IC2. If the random generator is not re- quired then obviously IC2 and its collection of gates can be omitted. However, do not forget to connect pin 6 of N7 to the positive supply line. The house lights can be switched on and off by means of a relay con- nected to T1 . Take care that the maximum current drawn by the relay does not exceed 50 mA. In the event that more current is required at this point, T1 and the mains transformer must be uprated. One final note. The LDR should not be mounted in a situation where street lights or car headlamps could cause false triggering of the circuit. If this should happen the house lights could go on and off all night. Our insistent burglar could come to the conclusion that there is an all night party going on and decide to join after all . . . M mains wiring tester Here we have yet another simple cir- cuit, consisting of two neon lamps (with built in series resistors) a push- button and an optional 100 k re- sistor. Can this circuit really be con- sidered as a piece of 'test equip- ment'? Of course it can. In fact simple ideas are the ones that are used over and over again until they become indispensable. Consider how simple a phase tester is! However, those devices can only show whether the 'live' mains connection is good or not, which leaves the user guessing about the negative and earth lines . . . But not any more! The mains wiring tester shown here will enable all three lines to be checked by simply pressing a button. When the circuit is connected to the mains both neons will light dimly. If the push button is now pressed one lamp will go out completely and the other will light properly. This in fact tells us three things: there is a phase present, the 'live' line is the one with the lit neon, and all three lines (live, neutral and earth) are working. In correctly wired domestic systems, the live and neutral connections are known in advance. In this case a further 100 k resistor can be added © © r push to test 83415 as shown. The lower neon should then light initially; operating the push button should cause the upper neon to light. Any other result indi- cates a fault! H very narrow crystal filter Good filters can be expensive and a manufactured one with a band-pass characteristic as good as the circuit described here would leave you considerably lighter in the pocket. In spite of its performance, the circuit uses only standard components and is ideally suited for applications in CW receivers. As the circuit diagram shows, the filter is of the normal ladder configuration with standard 1 MHz crystals. However, ample proof of the performance is provided by the photograph taken on a spectrum analyser. It shows that the 6 dB pass-band is only 1 20 Hz, while that at 60 dB is only 400 Hz! The insertion loss of 4 dB is reasonable. Furthermore, as the tolerance of 1 MHz crystals is relatively small, the filter can be 'repeated' very 7-56 signal purifier for SSB telegraphy receiver It is a well-known fact that the readability of radio telegraphy signals is often affected by interference. One of our readers therefore had the idea to design a circuit which will remove most of the interference. The (com- pressed) AF output of the receiver is fed to two tone decoders, IC1 and IC2, which are connected in parallel to increase the bandwidth. The pass bands of the tone decoders overlap to give a resulting pass band of 100 Hz centred around 800 Hz. The exact position of the pass bands can be set with potentiometers P2 and P3. Ideally, the receiver used should have its optimum AF sensitivity at 800 Hz. The output of N1 will be logic 1 if a signal between 750 . . . 850 Hz is applied to the inputs of the tone decoders. As long as this situation continues, N2 will pass the output of an external oscillator to the clock input of counter IC4. This counter moves one step for each pulse. After 256 clock pulses its output Q9 will become logic 1 , causing bistable FF 1 to change state: output Q of this flip-flop will then^ become 1. Conse- quently, output Q of FF 1 becomes 0, gate N3 is blocked and the counter resets. The counter does not react to pulses at its input as long as the reset input is held at a logic 1 . The fact that outputs Q9 of IC4 and Q of FF1 are logic 1 indicates that an AF signal was applied to the inputs of the two tone decoders 256 pulses before. As soon as the AF signal ceases the output of N1 (0) triggers MMV2. Output Q of this monostable then becomes 1 and causes bistable FF2 to change state^ The consequent logic 0 at output Q of FF2 then allows IC5 to start counting. After 256 clock pulses its Q9 output becomes 1, thus clearing FF1 via N4. The Q output of FF1 going to a logic 'O' indicates the end of the AF input signal plus a delay of 256 clock pulses. When FF1 is cleared, its output Q becomes 1, so that NAND gate N3 'opens' counter IC4. The cycle can elektor july/august 1983 The frequency of the external oscillator lies between 1 kHz and 30 kHz: because of the likelihood of morse signals being received, this frequency should be set so that the period of time taken by 256 clock pulses is shorter than the time taken by one morse dot. If it happens that the output of N 1 becomes logic 1 (due to an inter- ference signal), it will become 0 again, to trigger monostable multi- vibrator MMV2, before IC4 has counted 256 pulses. This will clear MMV2 and via the output of N3 (logic 1) IC4 will stop counting. Flip- flop FF2 is not affected by the Q output of MMV2 becoming 1 because it is blocked by the Q output of FF1 via 'gate' D1/D2. The blocking of IC4 thus causes the interference signal to be eliminated. When counter IC4 causes FF1 to change state after 256 clock pulses, FF2 is no longer blocked. If MMV2 is triggered by a negative inter- ference voltage, F F 1 changes state and causes IC5 to start counting. This counter then clears FF1 after 256 clock pulses. However, before the count has reached 256, the negative interference signal has ceased, which causes MMV1 to be triggered. Output _Q of MMV1 becomes 0, output Q of FF2 becomes 1 and this blocks counter IC5. And that eliminates the negative inter- ference ... 7-57 horse paces simulator In horse riding it is very important to know exactly what the horse is doing with its legs at all times. A simple electronic circuit can be used to demonstrate, with LEDs, an idealised order of footfalls to indi- cate when each foot comes to the ground. The only problem is how do you explain to your horse that he has been replaced by an electronic circuit? The circuit diagram for this device is given is figure 1 , and it is obvious that no complicated electronics are involved. Despite this simplicity the circuit does have a few nice features. Obviously every horse moves in a slightly different manner, and this also depends on the age and level of training of the horse (and its rider), so what we have here is an idealised version of how a horse moves. One LED is used for each foot; when the LED is lit the foot is on the ground. There are basically four different ways of moving catered for, walking, trotting, cantering and galloping and each lights the LEDs in a different sequence. The speeds at which the LEDs are lit is also con- trollable and there is even a "one step at a time" mode. video pattern generator Focussing by eye is possibly accept- able with a B/W set but the resultant pattern will be an egg-shaped The circuit contains a counter (IC2) driven by a 555 timer (IC1). The latter provides a clock signal, the frequency of which can be changed by varying PI , thus determining how fast the sequence of lighting LEDs is. The actual sequence is realised by the counter. The outputs of IC2 (pins 2, 3, 4 and 7) are con- nected to driver transistors T1.. . .T4, the open collectors of which are connected to an encoding mod- ule. It is the design of this encoding module which determines which LEDs are illuminated at any particu- lar time. Because there are four different sequences (walk, trot, can- ter and gallop) there are also four different encoding modules. These can either be designed as separate entities to be plugged into the con- trol board or all four can be incor- porated into the control unit printed circuit board and switched using a 4 pole 4 way switch as shown. Each of these modules simply consists of wiring, with a different layout used for each. Each of the counter outputs goes high (logic "1") in turn and this causes the appropriate transistors to conduct. This then drives the LEDs, D1 . . . D4. Switch SI is used to select either clock-controlled able, or D5. . .D20 if separate plug in modules are used. Switch SI is used to select either clock-controlled or step-by-step operation, and in this latter case S2 is used to advance to the next step. D1 = right fore leg, D2 = left fore, D3 = left rear and D4 = right rear leg. H 'circle'. This haphazard method of tuning is totally out of the question with a colour TV set and a pattern generator is essential in this case. 1C manufacturers Ferranti saw the need for such a device and have introduced a complete video pat- tern generator on a single chip. When combined in a circuit with a few external components this 1C delivers an excellent synchron- ization signal (CCIR standard) and five possible patterns. With S2 included in the circuit there are actually seven patterns availiable. The trick in getting an extra two patterns is quite simple. Considering that 'no pattern is also a pattern', white (switch pos- ition A) and black (G) are also possible. The other patterns are (with switch positions of S2 shown in parentheses): vertical lines (B), dots (C), crosshatch (D), horizontal lines (E) and degrees of grey (F). The breadth of the vertical lines and the intensity of the shades of grey can be set with P2 and PI respectively. Mixing the video and synchroniz- ation signals is done by T1. Both the video signal and blanking signal (via D5) are supplied to the base of this transistor. The synchronis- ation signal is set by means of P3 and P4 during the blanking signal (with T1 not conducting). The relationship between video and synchronization is set with P3, output level is set with P4. 7-58 ilektor july /august 1983 45 car lights warning device Anyone who has ever forgotten to switch the car lights off, after having driven in poor weather con- ditions, and returned later in the day to find the car battery flat will appreciate this circuit. The circuit sounds a buzzer when you turn off the engine and have forgotten to switch off the head lights. When required, the circuit can be reset with push button SI . This may be necessary, for instance, when you have your headlights on, get stuck in a traffic jam and turn the engine off to keep the carbon monoxide level down. When you turn the ignition key and start the engine, the dynamo or alternator runs, relays are operating, the electric fan comes on, the auto- matic radio aerial extends ... All these produce large voltage spikes on the car's electrical system and any electronic circuit must be protected against these. The circuit is connected to contact breaker S3 and the lighting switch S2. At first sight the use of the contact breaker as an indicator for 'engine running' may seem surpri- sing but, during the testing of the circuit, it became apparent that if the ignition switch is used instead, the circuit will not work properly. The cause for this was found to be variations in the battery voltage. The pulses from the contact breaker charge capacitor Cl via resistor R1. Once Cl is fully charged, there is a stable dc voltage at the collector of transistor T2: the trigger input (terminal 2) of the timer 1C (555) is then not driven. When the engine is turned off, Cl discharges, T1 is cut off and the base- emitter voltage of T2 rises. This causes the collector voltage of T2 to drop to 0. This voltage change is converted into a trigger pulse for the timer 1C by differentiating network R9/C4. The 1C is then operative and causes the buzzer to sound; with values as shown the warning tone will last for three seconds. The time can be lengthened increasing the value of C6. The circuit does, of course, not operate with the car lights switched off as it is powered from the car lights switch! H 7-60 elektor july/august frontdoor. If you don't know the four-digit code, you cannot open the door. Of course, this doorlock can- not prevent the door being broken open, just as a normal lock cannot do so. The electronics for this codelock is based on an integrated circuit specially manufactured for this pur- pose: the LS 7220. The keyboard has ten keys for the digits 0 ... 9, four of which are used to key in the code; they are connected to pins 3 ... 6 of the 1C. The remaining keys are connec- ted to Reset input pin 2. The circuit diagram shows the connections for code number 4179 (pins 3 ... 6 determine the sequence of the code: in the sample, pin 3 is connec- ted to key 4, pin 4 to key 1 , and so on). When the correct code is keyed in, output pin 13 of the 1C connects the positive supply line to T1 and T2. These transistors then conduct and operate the door-opener. Re- sistor R2 and capacitor C3 determine the time during which the door- opener remains active. If the door is not opened during that time, the code must be keyed in afresh. If required, this time can be lengthened by giving C3 a higher value. The supply voltage for the circuit and door-opener can be provided by a commercial 8 V bell trans- former in conjuction with a simple smoothing and stabilizing circuit as shown in figure 2. The electrical door-openers that are commercially available are normally operated by the AC output of a bell transformer, but will, of course, work perfectly well from the DC voltage provided by the supply shown. H When using a digital measuring instrument with another electronic circuit it is often necessary or desir- able to completely separate the supply for the meter from that for rest of the electronics. The problem can be solved by using two separate supplies, but it can also be done using a single supply and a DC-DC converter. The type of converter described here is quite compact and can deliver a current of about 50 mA. The circuit consists of an astable lultivibrator (IC1), which switches I the voltage supply for a transformer | (Trl) on and off via a transistor (T1). The transformer secondary voltage i: half-wave rectified and smoothed. The output voltage is then limited by zener diode D5. The transformer used should have a ratio between the windings of 1:1. The firing transformer used for thyristors is ideal for the job, but a small audio transformer (from a pocket radio) is also suitable. The frequency and pulse width of the circuit can be adapted to the type of transformer used by means of PI and P2. Firing transformers give the best results at frequencies of about 100 kHz, while audio trans- formers usually work best between 0.5 and 40 kHz. The transformer must, of course, be connected with correct polarity. The frequency is found as follows: * = 0.7 x (PI + P2 + R 1 + R2) x CV ^charge = 0.7 x (PI + R1)xC1.' discharge = 0.7 x (P2 + R2) x Cl. h 48 darkroom light Working in a darkroom is always fraught with problems. You surely know Murphys Law of . . ., but let's not go into that here. Suffice it to say that normal lights cannot be used in a darkroom when photo- graphs are being developed - not even if you drop your glasses! The circuit here is a simple, inex- pensive design for a darkroom torch (or light) that can be mounted in a case small enough to fit into your pocket even with a 9 V battery included. It gives enough light for note-taking or finding this or that in a darkroom, but the light is emitted by three special yellow LEDs which can safely be used near black/white or colour paper. Red LEDs are used for orthochromatic material (we had to look it up too, it means 'giving correct relative intensity to colours in photography'!). An energy saving circuit is included that auto- matically switches the lamp off when the ambient light is above a certain level. The diagram for the circuit makes it look like a mini power supply. When the circuit is switched 'on' with SI T2 conducts and provides, in turn, a base drive current to transistor T1. This transistor then supplies the base current for T2 via R5 and PI. Switching SI 'off' causes Cl to de- liver a negative pulse to the base of T2 and this transistor then stops conducting. T1 also stops conducting and the LEDs go out. The energy saving circuitry requires the addition of just one component, the LDR. When enough light falls 7-61 elektor july/august 1983 on it the LDR's resistance causes T2 to switch off and extinguish the LEDs. The lightlevel at which this happens is set by means of preset PI . LEDs D3 . . . D5 must be high effic- iency types and are either red or yellow depending on what sort of photographic paper is used. There are various high intensity LEDs available, although the light intensity level can also be changed by varying the current flow through T1 (by substituting another value of resistor for R1 ). With the values stated about 20 mA flows through the LEDs and. seeing as the current consumption when the LEDs are off is only a few nA, the 9 V battery should last quite a while. Finally it is important to remember that some types of photographic paper are sensitive to all colours, including red and yellow, so check this before using the lamp. H portable egg timer Packing a rucksack to go camping always poses problems. Either you pack everything exept the kitchen sink and stagger under the weight, or you keep the weight down but find yourself without something essential. An egg timer is not absol- utely essential, of course, but it is often very handy. This circuit is aimed at people who want a small, battery-powered timer, which could also be used at home, if you don't have a mains socket free for an electronic egg timer. One half of the 556 timer is used to sound the buzzer. It is connected as an astable multivibrator and oscillates at about 2 kHz. The actual timing is controlled by the other half of the timer. The sequence starts when S3 connects the trigger input of the 1C to ground. The length of the timing pulse is determined by the P1/R3/C network. For the prototype, C consisted of seven 47 pFA> V capacitors in parallel. The total capacitance, about 300 n F, gives a time of 6% minutes with PI in mid-position. SI is the power switch for the cir- cuit. Assuming this is 'on', pressing S2 resets the timer. Then the dur- ation to be timed can be set with PI and started by pressing S3. In case of a false start S2 will reset the circuit. Current consumption is about 23 mA. A scale can easily be calibrated in minutes and mounted behind the dial of PI, otherwise timing will still be a hit-or-miss affair! * In the circuit described here, a refer- ence voltage level is derived from the comparison of the frequencies of two signals. Basically, the comparator has two input signals, one of which causes a capacitor to partly discharge while the other causes it to charge. The average charge on the capacitor (the desired reference level) will there- fore be a function of the frequencies of the two inputs. The 'reference' capacitor is Cl in the circuit diagram. In the quiescent state the capacitor will be charged to half the supply voltage by the voltage divider con- sisting of R3 and R4. One input signal is fed to the base of T1 which switches on and off at the frequency of the input. There then follows what is commonly referred to as a 'diode pump'! The action of this aptly named circuit is to produce a series of pulses that correspond to the frequency of the input signal. The pulses are used to control transistor T2 which proceeds to switch on and off thereby discharging Cl in pulses, again at the frequency of input 1 . Eventually of course Cl would be completely discharged but this is 7-62 elektor july /august 1983 prevented by the activities of the other side of the circuit. Here the input at T4 drives another diode pump consisting of T3, C3 and D2 that is attempting to charge Cl , again in short pulses that cor- respond to the frequency at input 2. The end result is that the charge level on Cl 'averages' out to provide a reference level that is a comparison of the two input frequencies! It will be obvious that if the two input frequencies are the same, the charge and discharge cycles of Cl will be identical and therefore the voltage level across Cl will be equal to half the supply voltage. If the frequency of input 1 is lower than that of input 2, the reference voltage will be lower than 5 V. If input 1 has a higher frequency the reference voltage will be higher than 5 V. H This simulator gives a faithful repro- duction of the chirping of a cricket. The circuit comprises four oscillators of which the first, N 1 , produces the basic high note. The frequency of this note is set by potentiometer PI such that it lies within the resonant range of the crystal buzzer: the tone is then loudest. To obtain the typical chirping noise, the 4 kHz square wave output of N1 is amplitude modulated by a fre- quency of 10 ... 20 Hz. This fre- quency is produced by oscillator N2 and the modulation takes place in digital frequency changer N4. To make the end-result realistic, the 'cricket' must, of course, not chirp continuously but with suitable pauses. This is effected by oscillator N7/N8 and frequency changer N6. The oscillator output has a duty cycle ratio which is directly pro- portional to the ratio of the two sections of potentiometer P4, and can therefore be changed as desired. The duration of the total oscillator cycle is about 30 seconds, but because of tolerances this can vary appreciably. If the pauses can not be set long enough, C4 should be replaced by a larger value. The initial adjustment to the circuit is that of PI to achieve the basic tone. For this the buzzer must be connected directly to the output of gate N1 (pin 3 of IC1). The buzzer is then connected to pin 11 of IC1 and P2 is adjusted to obtain the typical chirping tone of a cricket. Next, connect the buzzer to pin 3 of IC1 and adjust P3 so that the chirping noise is heard three to six times per second, according to Finally, connect the buzzer to the output of the simulator and the (artificial) cricket is ready for use. Depending upon the value of C4 and the setting of P4, it may take a little while before the cricket emits its first chirp. As the current consumption of the circuit is only about 1 mA, the cricket can chirp away quite happily for a long while on a 9 V battery. M 7-63 >r july /august 1983 pulse/pulse train generator This circuit has two modes of oper- ation. If the pushbutton is just pressed once a single noise-free pulse appears at the output; the pulse can be positive or negative depending on whether the positive or negative output is chosen. If the pushbutton is pressed and held then, after a short delay, a pulse train is produced which continues until the button is released. This dual-function oper- ation makes this a very handy circuit which can be used, for example, where a counter must be driven either step-by-step or at a fixed frequency. The whole circuit consists of an anti-noise network (R2/C1), a pulse shaper (N1), an oscillator (N2) and two Schmitt triggers (N3 and N4) which enable it to produce both positive and negative pulses. When SI is pressed once R2/C1 eliminate any interference which might be present (switching noise for example), and then Schmitt trigger N1 delivers a clean pulse which is further cleaned up by N3 (and ultimately N4) and finally appears at the outputs. If SI is held longer, there follows a certain time delay (which can be varied by PI) during which C2 is charged via R4 and PI to such a level that oscillator N2 starts. This gate then produces a pulse train signal whose frequency is adjustable with P2. This pulse train then travels via N3 and N4 to the outputs. R3 and D1 ensure that C2 discharges quickly so that if SI is quickly pressed and released repeatedly the oscillator will not start If the range of PI is found to be too small then C2 can be changed for another value, and the same applies for P2 and C3. The approximate oscillator fre- quency is given by the formula 1 -. The actual fre- (R5 + P2) xC3' quency also depends on the trig- gering threshold of the 1C used, and this can vary from manufacturer to manufacturer. Total current con- sumption of the circuit is only a few mA. M 4"L ST 3 A < [j- urn ’1- B ["U _hiir tr 7-64 elektor july /august 1983 not affected by offset, because the input and output of the op-amp are isolated from d.c. voltages by means of two capacitors (Cl and C3). If the circuit is imagined with- out these two capacitors it ap- pears as a normal active rectifier. The feedback for the positive half cycle is by means of D1 and R2, and feedback for the negative half cycle is via D2 and R3. R4 controls the d.c. setting of the op-amp. At the output we get the rectified a.c. volt- age component of the input voltage supplied. Between output 1 and output 2 the full rectified sinus- oidal signal is availible; the recti- fied positive half cycle is between output 1 and ground and the recti- fied negative half cycle is between output 2 and ground. In measuring these values the supply for the meter must be totally isolated from the supply for the op-amp. Note that IC1 reverses the phase of the input signal so the negative half cycle becomes positive (output 1) and the positive half cycle becomes negative (output 2). Potentiometer PI is used to set the 'symmetry' of the positive and negative regulated signals. For precision applications the whole circuit should be built using 1% tolerance resistors and the diodes should be compared to see that they have the same voltage drops. The maximum input voltage is 4 V pp , frequency range is up to 20 kHz.The op-amp is powered by a symmetrical supply of between 6 and 12 V. Current consumption is very small (a few mA) so a battery could be used to power the circuit. 54 W. Meislinger RC generator This tone generator uses two RC networks (all-pass filters) connected in series to achieve the necessary phase shifting. The frequency range is from 20 Hz to 20 kHz and distor- tion is kept to a minimum by the extensive use of amplitude stabil- isation. Op-amps A1 and A2 are the bases for two phase shifting networks in the circuit diagram of figure 1. A stereo potentiometer PI sets the frequency so that each network shifts the phase of the signal by 90°. Switch SI selects the required range; 20 Hz . . .200 Hz, 200 Hz... 2 kHz or 2 kHz ... 20 kHz. Op-amp A3 gives a further 180° phase shift and amplifies the signal so that the system will keep oscillating. Capaci- tor C5 is included in the feedback loop of A3 to suppress HF oscil- lation above 100 kHz. The output of both A2 and A3 are rectified by diodes D1 and D2 before being passed, via P3, to the inverting input of A4. This op-amp compares the feedback signal to a reference voltage set by zener diode D4. The output of op-amp A4 causes the F ET T 1 (which acts as a variable resistor) to conduct to a greater or lesser extent. This controls the gain of A3 and maintains its output amplitude at a constant level. Capaci- tor C3 in the feedback loop of A4 integrates the input signal to this op-amp while C4 and R12 are included to suppress rapid fluctu- ations in the control system. Diode D3 protects the FET against any high positive voltages. The printed circuit board layout for the RC generator is shown in figure 2. C3 and C4 are mounted vertically on the board. The circuit requires a symmetrical supply of between 10 and. 15 V. Current consumption is about 8 mA (positive supply) and 12 mA (negative supply). The circuit is adjusted as follows. Set P3 to its mid position and adjust P2 I 7-65 elektor july/august 1983 R1 . . . R4,R8 = 10k R5,R6,R14 = 1 k R7.R9 ■ 470 It RIO, . . R12 = 47 k R13 = 100 k PI ■ 10 k log stereo potentiometer Capacitors: C1a.C2a = 6n8 Cl b,C2b 68 n C1c,C2c = 680 n C3- 1.5 p/25 V C4 = 1 0 p/25 V C5 = 47 p C6.C7 = 1 00 p/25 V Semiconductors: D1 ,D2,D3 - 1N4148 D4 = zenerdiode 5.6 V/ so that the d.c. voltage at the output was extremely low; at 1 kHz it was of A4 is between -1 and -2 V. Then about 0.01%, rising to 0.03% at P3 adjusted to provide an output 20 kHz. At 20 Hz the distortion was voltage from A3 of 1.5 V rms . The 0.1%. Amplitude stability within any distortion measured in the prototype range was about 0.1 dB. H interior temperature control for cars The single most important part of any car is its driver and it stands to reason that the better the driver, the better the overall standard of road safety will be. Of course we could just leave the car to its own devices with a bit of help from a computer, but we all know what computers can do. ..! No, there are some things better left undone. The alternative is to help the human driver to do a better job This circuit is not a design to produce perfect drivers but it does aim to improve the environment in a car. Basically the circuit enables the desired temperature in the car to be set between two limits. The ambient temperature is sensed by an NTC thermistor with a nominal value of 47 kfl at 25° C. The value of the thermistor at any time is used to set the level at one of the inputs of an op-amp in the LI 21. This op-amp sets the triggering level of the internal logic which drives the 1C output stage. Potentiometer P2 controls the second input of the same op-amp and is used to adjust the temperature at which the circuit operates. When the temperature inside the car increases the resistance of the ther- mistor decreases and the voltage on pin 3, the non inverting input of the op-amp, also decreases. After a period of time the level set by P2 is reached and the logic control 7-66 slektor july/august 1983 circuit in IC1 is triggered. This drives transistor T1 causing it to conduct and switch on the cooling- fan motor. Cool air is then blown into the car. As soon the tempera- ture falls to a certain level, set with PI, the circuit switches the fan off again. The circuit is powered directly by the car battery but zener diode D3 is needed as a protection against the spikes that always occur on car voltage supply lines. Note that the thermistor must be mounted in a suitable location in the car (best found by trial-and-error). M SGS Applications VFO with variable inductor An LC oscillator as shown in figure 1 is not exactly something new: transistor T1 is connected in a common base configuration and its emitter functions as virtual earth. Transistor T3 is a voltage follower buffer; its emitter voltage, in conjunction with the impedance of the series LC circuit, determines the collector current of T1. If therefore the resistive losses at resonance of the LC circuit are smaller than the collector resistor R4, the LC circuit will oscillate. The level of the oscillator output voltage across R9 is determined by the value of R9, the collector current of T1 and the current through R8. An LC oscillator with variable capacitor tuning has been around for some time as well: change C (C3) in figure 1 to a variable type and you'll be able to adjust the oscillator frequency over a certain range. An LC oscillator with variable inductor tuning as shown in figure 2 is not so usual. Two coils, LI and L2, are mutually coupled (coupling factor, k = 1 ). If the currents through 3 ETEl the coils are in anti-phase, the mag- netic field of L2 will oppose that of LI : the self inductance of LI appears to become smaller. Therefore, the larger the magnetic field of L2, the higher the oscillator frequency. As the current through L2 is kept to a fraction of that through LI, the magnetic field of L2 cannot exceed that of LI . The reduction in magnetic field- strength is effected by replacing T1 in figure 1 by a long-tailed pair, T1 and T2, in figure 2. As you probably know, the collector currents in a long-tailed pair are in anti-phase; their ratio is determined by the dc voltage applied to the base of T1. This voltage is set by resistors R1 and R2, diodes D1 . . . D3, and potentio- meter PI . When the wiper of PI is set for maximum resistance, T2 is cut off, L2 does not oppose LI and the total self inductance of the circuit is maximum: the oscillator frequency is then minimum. When the base voltage of T1 is reduced, T2 begins to conduct, L2 starts to oppose LI and the oscillator fre- quency rises. When T1 and T2 are balanced as far as dc supply is concerned, the self inductance of the circuit is theoretically zero: the consequent, infinitely high oscillator frequency is, however, unattainable because the oscillator has stopped long before this frequency is reached. In a practical circuit, with C3 = 500 pF and LI = L2 = 365 pH, the oscillator can be tuned between 370 and 520 kHz; if C3 = 56 pF and LI = L2 = 5.5 pH, the frequency range is 9 . . . 12 MHz. In view of the stringent requirements as to the magnetic coupling between LI and L2, these coils must be bifilar wound as indicated in figure 3. For instance, a value of 365 pH is obtained when the number of turns, N = 1 91 , wound on a former of diameter, d = 2 cm, and a coil length, I = 4 cm. The variable inductance oscillator instead of the familiar variable capacitance version is not just 'nice to know', but has sound practical applications. After all, it makes it possible to control frequency by means of voltage control of the base potential of T2: you can now tune the IF stages of an FM receiver visually, for instance, and in general you can sweep or wobbulate to your heart's delight! H 7-67 elektor july/august amplified triac drive A well-known shortcoming of vir- tually all electronic components is their sensitivity to temperature changes. It is true that triacs are not too bad in this respect, but they do not like low temperatures: they just stop working! This is caused by the fact that triacs require a higher gate current at low tempera- ture. Triacs are often triggered by opto-couplers which are not capable of supplying these higher currents. The circuit described, in contrast to 'normal' triac triggers, contains an amplifier which ensures sufficient gate current under all tempera- ture conditions. The amplifier is formed by transistor T1 , which raises the signal from the opto-coupler to more than adequate level. The use of capacitor C2 as a 'dropping' reactance ensures that the dissipation in the drive circuit is virtually nil; it also prevents the circuit presenting a dc load to the mains supply. The switch-on current surge is limited to a safe value by resistor R3. As the drive circuit is supplied directly from the mains, the mains voltage must, of course, be reduced to an acceptable level. This voltage is therefore rectified by D1 and smoothed by Cl. Zener diode 1 D2 stabilizes the supply to the circuit to 15 V. As soon as transistor T 1 conducts, capacitor Cl discharges via T1 and the triac gate, provides a gate current of about 40 mA. The discharge time, and consequently the trigger pulse, is not greater than 1 millisecond. RC network R4/C3 protects the triac against high voltage peaks. Siemens application. M action flash Very fast acoustic electronic-flash releases as used by professional photographers and in quick-motion film apparatus for action filming are beyond the means of most amateur photographers. Simpler acoustic re- leases are normally not fast enough: a picture of a burst balloon is not very interesting; one of a bursting balloon is! If you want to film events which happen in a split second and which make a sound at the same time, the circuit described is just right for you. To make possible the filming of events which are over before the sound reaches the camera, we have designed a simple light barrier through which, for instance, a drop of water can be made to fall (see below). The level at which the electronic flash fires is then preset by either PI (acoustical) or P2 (light barrier). The output is connected to ==c i r* t the timing input of the electronic flash unit. The power supply is no problem: as the current consumption of the circuit is only about 30 mA, a 9 V battery will last quite a time. First a few words about the circuit. ICI.an audio amplifier 1C, is used as microphone amplifier with a maxi- mum amplification of 200. IC2 is used here as a monostable multivibrator. If a pulse caused by a noise input arrives at pin 2 of IC2, it triggers the multivibrator. The output of the multivibrator (at pin 3) triggers thy- ristor Thl which in turn triggers the thyristor in the electronic flash unit. Where the light barrier is used, the part of the circuit to the left of terminals 1 ... 3 in figure 1 is 7-68 eleklor july /august 1983 replaced by the light barrier circuit shown in figure 2. And finally a few hints on the use of the circuit. When you are photo- graphing (naturally, in a darkened room) a falling drop of water at the moment of impact, try out various colour filters. A (dim) coloured light source can produce interesting effects. Try also to let the drop fall onto a mirror; if the photograph comes out well, if should be one of the more remarkable ones in your collection. If unwanted reflections from the mirror spoil the photograph, try out various filters and also change the angle between the axis of the camera and the mirror. H temperature indicator The temperature indication of a heat sink on a power transistor in high power circuits can be extremely useful. A simple, inexpensive tem- perature indicator would be ideal for this purpose since accuracy is not an important factor. In the design for the temperature indicator here, the voltage drop across a diode that is held at ambient temperature is used as a reference level. The temperature detection is carried out by a transistor mounted on the heat sink and/or close to the power transistor in question. In the circuit diagram the temperature detector is transistor T1 and its base emitter voltage is compared to the reference level at the junction of D1 and R1 via the preset PI . The tran- sistor will remain switched off as long as its temperature remains below a certain level, a level that is effectively set by PI . The base emitter voltage of the transistor will drop by about 2 mV for a rise in temperature of about 1 degree Centigrade. When the base emitter voltage of the transistor drops below the voltage level at the wiper of PI the transistor will conduct and light the LED D2. This will happen gradually and thus provide an indi- cation over a fairly wide range. The values of R1 and R2 are of course dependent upon the supply voltage, Ub, and can be calculated as follows: R1 kfi For optimum performance of the circuit it is important that the reference diode is situated in the free air at room temperature — defi- nitely not above the heatsink! The transistor should be mounted on Ub (or even in, if drilling the heatsink is acceptable) the heatsink as near the heat dissipating element as is practical. It must be remembered however that the maximum expected temperature should not exceed 1 25°C if you value your transistor. The current consumption of the temperature indicator will be little more than the LED current, about 20 mA, and then only when things are starting to cook! M 7-69 elektor july/august 1983 circuit will be amplified by op-amp A1, which also acts as a buffer; its consequent output signal will cause a current through R3 and the meter which will give a reading. The most suitable meter for this purpose is the type used in FM receivers as tuning indicator: that is, with a centre zero. Capacitor Cl ensures the suppression of any hum present. The general emotional condition of a person can be ascertained by measuring the average resistance of the skin over a period of time. This indication is provided by a meter connected to point B in the circuit Op-amp A2 is connected as an integrator and enables the circuit to adjust automatically to the average skin resistance. The period of time during which the skin resistance must be measured is determined mainly by R5, C2 and C3. Until this time has lapsed, a meter (a universal meter is suitable) connected across output B will not give any reading, although diodes D1 and D2 ensure that the circuit reacts as quickly as possible. Potentiometer PI enables setting of the delay time of the circuit. Because the skin resistance varies from person to person, it may be necessary to alter the value of resistor R 1. As a further refinement, this resistor can be replaced by a potentiometer if desired. Too high a reading on the meter at output B indicates that the skin resistance of the 'guinea pig' is low (which is characteristic of people with clammy hands) and it would be advisable to reduce the value of R 1 . H electronic pocket-pinball I This highly portable pocket-pinball game may not exactly be a substi- tute for its big brothers in the amusement arcades, but it still provides a lot of fun. The circuit is relatively simple: three CMOS ICs, nine LEDs, six resistors, one capacitor, one push- button and a 9 V battery. Together with R1, R2 and Cl, NOR gates N1 . . . N3 form a clock generator whose signal is applied to decimal counter IC3. For as long as the player presses pushbutton SI, clock pulses are counted. When the button is released, the counter is inhibited for the incoming clock signals and only one of LEDsDI . . . D7 will light. The carry output of the decimal counter toggles flip-flops FF1 and FF2 which are configured as 2-bit binary counters. Depending on the counter status, the player is entitled to a free ball (LED D8 lights) or he can double the score (LED D9 lights). Obviously, this simple circuit is not equipped with a points counter. The points gained by each player must therefore be noted on a piece of paper. The values are indicated next to the corresponding LEDs on the circuit diagram. If only one of LEDsD5. . . D7 lights, the ball is out of play; with '0' it was through the middle, and with '25' to the right or left. It is then the turn of the next player. If, however, D8 7-70 can try his luck again. With a little care, the front panel can be designed with the LEDs pos- itioned in such a way that the game resembles the full-scale pinball machine (figure 2). M lights in addition to the '25' LED, the player has gained a free ball. He elektor july /august 1983 62 simple sawtooth generator Sawtooth generators are frequently required in most branches of elec- tronics. We therefore feature a new design for a circuit which makes use of components which can be found in almost every box of goodies (or 'rubbish' to unbelievers!). The basic version of the circuit as shown in figure 1 uses a 9 V battery as supply. The circuit itself can be readily understood: capacitor Cl is linearly charged by constant current source T1, R1, PI. Transistors T2 and T3 are used as substitute for a silicon controlled rectifier (SCR) and if you bear this in mind, the circuit is somewhat easier to understand. The 'SCR' is not, as usual, fired by a pulse. Instead, the 'gate' is biased by voltage divider R3/D2 and once the 'anode to cathode' voltage ex- ceeds this bias, the 'SCR' conducts. Cl then discharges rapidly through the "SCR' and current limiting re- sistor R2. When the voltage across the capacitor has dropped to about 1.4 V, the current through the 'SCR' has become low enough for it to cut off. Cl again charges and the cycle repeats. The resulting sawtooth output voltage is shown in figure 1 . The frequency of the output voltage can be adjusted over a range of about 10 J ; with the values shown the fre- quency range is 5 . . . 500 Hz. The smaller Cl, the more rapidly it will charge, and the higher the frequency. The circuit was tested in our labora- ries with frequencies up to 100 kHz, but higher frequencies are possible. The amplitude of the sawtooth volt- age is determined by the 'gate' bias across zener diode D2 and it can therefore be modified by changing this diode. It should, however, be borne in mind that the zener voltage must not be more than half the supply voltage to ensure correct operation of the generator. If an exponential ramp is required instead of a linear one, T1 can simply be omitted and R1 connected directly to the supply voltage. Cl will then charge directly from the supply and automatically provide an exponential waveform. K optical voltage indicator This circuit indicates, by means of a flashing LED, when a voltage being monitored or measured falls below a predetermined value. The only active component is an op-amp which functions as comparator and as oscillator. The voltage to be monitored is applied to terminal A and the refer- ence voltage to terminal B. As long as the voltage at the non-inverting input of the op-amp is larger than that at the inverting input, the output of the op-amp is 12 V and the LED does not light. If the voltage at terminal A, and there- fore LT, drops below the reference voltage, LT, the op-amp inverts and the LED lights. A feedback loop, R2/R1, causes U* to be reduced somewhat. Capacitor Cl charges via R3 and the output of the op-amp. Diode D1 cuts off, so that the voltage at terminal B no longer affects U . When U has dropped till it is just below the level of U\ the op-amo changes state again, the LED' extinguishes and, because of feedback via R2, U* is increased a little. Cl discharges until U becomes just larger than IT; the output of the op-amp becomes logic 0 and the LED lights again. In this way the LED will flash on and off as long as the voltage to be monitored or measured lies below a predetermined value. The circuit can be used, for instance, as a coolant temperature indicator in a car: if the temperature becomes too high, the LED will start to flash. For this purpose, the network shown < o ) in figure 2 is connected to the circuit in figure 1 . The temperature indicator 7-71 elektor july/august 1983 (sometimes thermometer) and tem- perature sensor are already fitted in the car. Calibration is carried out as follows. Switch on the car electrics (but not the engine) at the ignition switch. Connect across the tempera- ture sensor a resistor with a value which causes the needle to just get into the red sector of the meter. Then adjust PI so that the LED just starts to flash. Do not forget to remove the resistor from across the temperature sensor once cali- bration is completed. H Siemens applications 64 heatsink thermometer This thermometer was designed for measuring the heatsink temperature of a Crescendo power amplifier, but it can, of course, be used for other power amplifiers and indeed for other applications. The thermometer does not only display the temperature of the heatsink on two displays, but it also provides a switched output which, for instance, can be used to switch on a fan if the temperature rises above a pre-determined value. The circuit consists of four parts: a reference voltage source, IC1, the sensor, IC4, the display section, IC2 and IC3 and the switch section, IC5. IC1 , a 723, provides a stable supply voltage for the sensor and switch section. This voltage is about 8 V. The temperature sensor provides a temperature dependent voltage of 10mV/K. At 0°C, for instance, the voltage across IC4 amounts to 273 x 0.01 = 2.73 V (0° C = 273 K) The display section is constructed around two old faithfuls: ICs CA3161E and CA3162E. IC2 con- tains the A/D converter and the multiplexing circuit for the displays. IC3 is the BCD seven-segment decoder driver. Only two displays are used, so that the temperature can be read in degrees. 1C 2 measures the difference between the voltage provided by the sensor and the reference voltage set by pot PI. This is necessary to eliminate the '273 degrees below O’, that is, the voltage of 2.73 V. To make this possible, the read-out section and the measuring/switching section are powered seperately. The earth of IC2 and IC3 is connected to the wiper of PI which is at a potential of 2.73 V, while the input of 'meter' IC2 is connected to sensor IC4. In this way, the 2.73 V is compensated so that the voltage measured by IC2 Parts List Resistors: R1.R4 « 470 n R2.R5 = 2k2 R3 = 68 n R6= 18 k R7 = 8k2 R8 = 5k6 R9 - 33 k RIO = 22 k R11 - 15k PI = 2 k 10 turn preset P2.P3 = 10 k 10 turn preset P4 = 50 k 10 turn preset Capacitors: Cl = 470 (i/25 V C2.C5.C6.C8 = 4p7/10 V tantalum C3 = IOOp/25 V C4= 100 p C7 = 270 n Semiconductors: D1 . . . D8= 1N4001 LD1,LD2 = 7750, 7751 (CAI T1 ,T2 = BC 559B T3 = BC547B IC1 = 723 IC2 = CA3162E IC3 = CA3161E IC4= LM335Z IC5 = LF 356 IC6 = 7805 Miscellaneous: Trl = mains transformer 2x9 V/0,5 A (isolated secondaries), heatsink for IC6 7-72 rises at 1 0 mV per degree centigrade from 0 C and the displays read degrees centigrade. The last, but not least, part of the circuit is the comparator and switching output (IC5 and T3). The voltage provided by the sensor is compared by IC5 with a voltage derived by R9and RIO from the reference voltage of 1C 1 . When the sensor voltages rises above this secondary reference voltage, the output of IC5 changes state and the transistor conducts. T3 can, for instance, by means of a relay switch on a fan to provide additional cooling of the power transistor. It is also possible to switch off the loudspeakers by means of the protec- tion relays in the amplifier, so that the dissipation in the power transis- tors is greatly reduced, assuming, of course, that the loudspeaker drive was the cause of the overheating! With values of R9and RIO as shown, the comparator changes state at about 80 C. This depends also, of course, on the reference voltage provided by IC1 which has quite a tolerance. The temperature at which IC5 changes state can be altered by changing the value of R9. If the thermometer is built on the printed circuit board shown, nothing much can go wrong. It is important, however, that the earth of the supply for IC1, IC4 and IC5 is connected to the earth of the power amplifier. The power supply for the thermometer must be self-contained with a trans- former having two isolated second- aries. The sensor must be fitted as close as possible to the power transis- tors on the heatsink. If you want to build the circuit on a board of your own design, bear the following points in mind. The two power supplies must be kept isolated from one another. The only two connections between the meter and the measuring section are clearly indicated on the circuit diagram. IC2 and IC3 have a separate supply line from the output of the 5 V regulator, while the emitters of T 1 and T2 must have a separate supply line from the output of IC6. IC3 must have its own 0 V line from the regulator. These precautions are necessary to prevent IC2 being affected by interference caused by high peak currents occur- ring during the multiplexing of the two displays. An accurate, preferably digital, meter is required for adjustment of the thermometer. First link Y and Z together and adjust pot P4 to obtain a reading of 00 on the displays. Then remove the link and apply a d.c. voltage of about 0.9 V to Y. Next adjust P3 to obtain a display of the same value as that at Y (measured with the accurate meter!). Bear in mind that the last digit is not dis- played! For instance, if the voltage at Y is 883 mV, the display will read 88. Then link Y and X together. Measure the voltage across C5: if necessary, this should be adjusted to 2.73 V with pot PI. As regards the temperature sensor, if you're happy with a accuracy of about 3° C, pot P2 can be omitted. If you want a more precise ther- mometer, the sensor should be immersed in melting ice and P2 adjusted to give a display of 00. It is also possible to immerse the sensor in water at about 37° C, and measure the temperature of the water with a clinical thermometer. P2 is then adjusted to give a display equal to the reading of the clinical ther- mometer. If it is required that the loudspeakers are switched off at temperatures above 80° C, the collector of T3 should be connected to the base of T5 in the protection circuits de- scribed in 'Accessories for the Crescendo power amplifier' featured in our January 1 983 issue. H 7-73 1983 on/off with a single push button A very useful function expressed in a simple circuit that is suitable for many applications. Basically the out- put of the Schmitt trigger N1 changes (toggles) when the switch is closed momentarily. This toggle function is achieved in such a simple circuit by the fact that the inputs of the trigger are held be- tween the switching threshold levels. If we assume that the output logic level (Q) of the trigger is at logic 1 , capacitor Cl will charge via R1. When switch SI is closed the input of the trigger will now be taken to logic 1 (because the capacitor is fully charged) and the Q output will of course become logic 'O'. The capacitor will now discharge but not completely because the closed switch will hold the level to that existing at the wiper of PI. However this drop in voltage at the input of the gate will not cause its output to change state again because the input level will still be above the lower switching threshold of the Schmitt trigger. 1 ■& ~f" m i This 'intermediate' voltage level will remain while the switch is closed. When the switch is eventually released. Cl will then discharge com- pletely. The 0 V across the capacitor will not affect the trigger since it is no longer connected to the capacitor (the switch is open). Now when the switch is closed the 0 V will reach the input of the gate and its output will once again change state. It is essential that PI is set correctly for the circuit to function but it will be found in practice that this presents no problem. Various types of Schmitt trigger are suitable for this circuit: 4093, 40106, 74LS14, 74LS132. If TTL ICs are used, the supply voltage must be 5 V ± 0.25 V; for CMOS ICs it should lie between 5 V and 15 V. M inexpensive 45 MHz crystal filter A receiver with an intermediate frequency, IF, which is higher than the highest received frequency, f c , has the great advantage that the sep- aration between the received fre- quency and the image frequencies, f c ± 2IF, is large. A filter with a high centre frequency and narrow pass-band which is eminently suit- able for SSB reception can be built from relatively few components. Oscillator crystals often have one or more spurious resonances and this makes their application in filters undesirable because of the risk of unwanted pass-bands. The broader the filter response, the greater this risk becomes. It is possible to use 27 MHz third-over- tone crystals (standard in most CB equipment) in their fifth overtone mode. Figure 1 shows the circuit of a coarse 45 MHz filter using two 27 MHz crystals. The photo shows that the attenuation outside the passband is far from satisfactory: there is hardly any difference be- tween the required and the unwanted passbands. With the use of more crystals, the pass-band of the filter becomes narrower and the likelihood of spurious frequencies coinciding becomes smaller. Figure 2 shows the circuit of a ladderfilter using five crystals, which reduces the likelihood of spurious pass-bands greatly. The 6 dB bandwidth of the filter of figure 2 is about 3 kHz, while that at the 40 dB points is only 5 kHz. The input impedance, Rg, lies between 1 50 il and 200 and the output impedance is 50 f 2. Its insertion loss is 7 dB. Coil LI is a bifilar winding of 2 x 8 turns of enamelled copper wire of 0.2 mm diameter. As this coil is 7-74 >rjuly /august 1983 not critical, it may be wound on a ferrite bead. Moulded RF chokes may be used for L2 . . . L5. Coil L6 is again a bifilar winding, 2x8 turns, enamelled copper wire of 0.2 . . . 0.5 mm diameter on a T50-12 former. The filter can be built on a small piece of Vero board. The coils must be screened from one another by earthed screens. The crystal housings must also be earthed. Further signal processing is best done at a much lower second IF of, say, 10 kHz, obtained by mixing the 45 MHz IF with the output of a crystal oscillator operating at 45 MHz ± IF2. The oscillator can also use a CB type third overtone crystal operating in its fifth over- tone mode. H A decimal keyboard, a CMOS 1C, three transistors and an opto-coup- ler . . . that is about all that is needed to make this electronic lock with a three digit combination. Locking is achieved by means of a cascade of analogue switches, each of which is connected, through a programming matrix, to one of the keys on the keypad. Suppose line A is connected to key 2, line B to key 9, and line C to key 5. If key 2 is now pressed ESI closes and stays closed because of the current delivered to it through R7. If key 9 is then pressed ES2 closes and remains closed (because ESI is already closed). Now all that is needed is to press key 5, where- upon ES3 closes thus activating the opto-coupler, whose transistor then conducts. The keys not used in the ABC code must all be connected to the D line. When one of these keys is pressed, in error or in ignorance, line D sets ES4 to an active high logic level (which it keeps because of R6) and T1 conducts and thus disables the circuit completely; in fact even if ESI is again activated, by the rel- evant key, it will not auto-hold as long as T1 is conducting. To start again, pushbutton SI must first be pressed, thus opening ES4 and blocking T1. It is also useful to be able to reset the lock externally and this is achieved by means of T2, which is connected parallel to the reset circuit and controlled by the # key. Key * could be used as an ordinary bell push, activating relay Re through transistor T3; thus driving the bell transformer. One further word about the oper- ation of the lock: consider again our combination of 295, and assume that the first key pressed was not 2 but 9, which is not wrong, merely misplaced. The B-9 connection causes ES2 to close but it cannot remain closed when key 9 is released because ESI is open. An opto-coupler is used here in pref- erence to other alternatives which might be chosen in other appli- cations, and proves to be simple, inexpensive and effective in this circuit. K 7-75 A 'glitch' is a very short duration pulse usually caused by the differ- ences in path times of various signals in a digital circuit. They can be the very devil to find (if at all) and create havoc in complex digital circuits. The circuit described here was designed to suppress glitches in the output signal of a word re- cognizer, where it is essential that the logic analyzer is not triggered by the spurious signals. The circuit consists of a monostable multivibrator (MMV) and six in- verters. If pin B of the MMV is connected to +5 V (wire bridge in position 2), glitches will not be detected. A signal at the input of N1 is inverted and applied to inputs A1 and A3 of the MMV. The multivibrator is triggered by the leading edge of the input signal and emits a pulse of about 7 /« (duration determined by the values of R1 and Cl). With the wire bridge in position 1 as shown, the circuit will suppress glitches of 80 ns and shorter, a time based on the delay line in inverters N1 . . . N6. The output of N6, and consequently the input at pin B of the MMV, is logic 0. As long as this situation persists, the MW will not react to signals at its inputs AT and A2. If a pulse appears at the input of the circuit, it will arrive at inputs AT and A2 after about 10 ns (that is, the delay of N1). After about 90 ns the pulse will arrive at the output of N6, so that this output, and therefore input B, becomes logic 1 and inputs A1 and S2 are 'open'. If the input pulse is shorter than about 80 ns, it is no longer available at AT and £2 by the time the delayed pulse arrives at input B. In this way the MMV will only pass signals which are longer than 80 ns. H o o — ® > "P- T- This window comparator uses only three CMOS inverters, two resistors, o preset potentiometers and one diode. Of course, the simplicity of the circuit means that some con- cessions must be made with regard ) quality. High-frequency input signals with short rise and decay es cannot be properly processed. Nevertheless, the circuit provides in inexpensive and simple alternative o the usual window comparators. The circuit itself (figure 1) does not require much of a description. The switching thresholds are adjusted with preset potentiometers PI and P2. The adjustment of PI governs the lower switching threshold U|_, whilst that of P2 governs the upper switching threshold Uh and thus “Qo-i establishes the window width u H -U L . Figure 2 clarifies the function of the circuit. The voltage values indicated apply to a supply voltage of 10 V. A triangular voltage is shown at the input of the window comparator, as well as the output voltage at point X If the input voltage exceeds the lower value Ul set with PI, the voltage at output X goes to logic 1 via inverters N2 and N3. If the input voltage reaches the upper threshold Uh set with P2, inverter N1 ensures that the voltage at output X goes to logic 0 again. The output remains in this state until the trailing edge of the input voltage drops below Uh again and the output goes back to logic 1 . It reverts to logic 0 as soon as the input voltage reaches the lower threshold U(_. M july/august 1983 sea murmur I simulator The heart of the circuit is the 'mur- mur source' consisting of T1 and RIO. This produces a signal which is amplified in voltage control led ampli- fier A1 and the following external AF amplifier. Transistor T2 is used as a current- controlled resistance which controls the amplification of A1 : the smaller the resistance, the stronger the output signal. The loudness of the surf also depends on the output of the triangular pulse generator consisting of integrator A2 and trigger A3. The output of the trigger is connected to the input of the integrator. Diode D3 is included to prevent the output signal of A3 going negative. This is necessary otherwise the lower parts of the triangular waveform from T1 would then be cut off and instead of a regularly increasing and dying down of surf you would have nothing but interrupted breakers. The slopes of the triangular signal can be adjusted by means of potentiometers P3 and P4. Diodes D1 and D2 allow the oscillator. Then adjust P2 until pos- positive and negative slopes to be sible clipping is avoided. Bear in adjusted independently. The poten- mind that PI and P2 affect each tiometers also determine the fre- other so that further fine adjust- quency: the smaller their total value, ments may be necessary, the higher the frequency. The ratio Now the 'shape' of the waves can be of the two potentiometers deter- adjusted with P3 and P4. Exper- mines the symmetry of the signal. iments have shown that a wave During the calibration of the circuit, normally lasts a couple of seconds connect the wiper of PI to earth from crest to crest. The rise is and then adjust P2 for a soft murmur usually 5to 10 times shorter than the in the loudspeaker. If P2 is opened fall and the required wave shape is further, the volume should increase. therefore more a sawtooth than a The background 'whispering' of the triangle. Setting P3 to about 470 k sea is now set. and P4 to around 100 k gives a Disconnect the wiper of PI from wonderfully realistic effect. These earth and vary the setting of the components are variable because potentiometer. The sound of the this enables the circuit to be used breakers should then increase and for other applications, for instance, die down at the frequency of the as a steam locomotive simulator. M busy indicator for the Junior Computer A 'busy' indicator can be useful if a printer is being used with the Junior computer. It simply requires the addition of a small circuit to the RS 232 printer interface and a few minor changes to the Printer Monitor software. As can be seen from the diagram, the additional circuit is not very exten- sive. The input of the circuit is provided by the 'busy' signal from the printer which is available at pin 1 1 of the RS 232 connector. The first transistor, T1, serves as a level interface between the RS 232 and TTL. When the input voltage is positive (logic '0') T1 will conduct and pin PB6 of the VIA will also be at logic 'O'. When a busy signal is received from the printer, the input will become '1', T1 will switch off and the PB6 line is taken to +5 V by R3. Transistor T2 will conduct and light LED D2 provides the 'printer busy' indication. Resistor R1 ensures that no busy signal is given to Junior (and the LED cannot light) if the input is open circuited. The modifications to the Printer Monitor EPROM are: 14F4 BUSY AD 00 18 LDAPBDVIA 14F7 29 40 ANDIMS40 14F9 D0 F9 PB6VIA-0? 14FB AD 82 1A LDA PBDPIA 14FB 60 RTS 7-77 simple stabiliser This is a very simple but nonethe- less reliable stabiliser circuit which can be used in place of a 78XX series 1C regulator. The heart of the circuit is based on a type CA3130 operational amplifier, A1, and one transistor. The reference voltage, U re f, is derived from the output by means of R1 and zener diode D1 and is therefore very stable. Operation electronic switch for audio signals The complexity of the problems as- sociated with switching audio signals is proportional to the sophistication of the playback system. In this field all roads lead to the mixing desk where the bundles of cables start or finish. The same signal must be sent, for example, to the control amplifier (monitor), the tone correction stages, the special effects stages, an output amplifier, a tape recorder ... and so on. In other words there are cables everywhere! So either the cables must frequently be moved from one place to another or some form of switching mechanism is needed. Mixing desks often have mechanical switches for this but these are far from ideal simply because they are not of high enough quality. Electronic switches, on the other hand, provide a very satisfactory solution and are devoid of clicks and is simple: if the output voltage, U 0 ut. shows a tendency to rise, the potential difference at junction R2/R3 will increase. The voltage at the non-inverting input of A1 will then become higher than that at the inverting input, because the latter is held at U re f by zener D1. The output of A1 therefore increases resulting in T1 being cut off and in a reduction in the output voltage of the stabiliser. If U ou t drops below the nominal value, the above oper- ation is reversed. The advantage of this circuit is the low voltage drop between input and output, which is dependent solely on the saturation voltage of T1. The unstabilised input voltage does not therefore need to be more than 0.5 V higher than the required output voltage. The calculation of the various parameters is simple: assuming a current of 1 mA through R2/R3 and a zener current of 5 mA, we arrive at the following formulas which everyone can compute without even a pocket calculator. R, = 0.2 x R 2 (kft) R z = (U 0 ut - Uref) * 1 kft R 3 = U r ef x 1 kft in which U ou t is the required, stabilised output voltage and U r ef = Uqi which is slightly lower than U 0 ut- lf . for instance, a stabilised output voltage of 8 V is required, the following values are arrived at: U re f = 6.8 V; R1 = 220 ft; R2 = 1k2; R3 = 6k8. K other such undesirables. The circuit consists basically of two integrated circuit analogue switches controlled by two push buttons. In the rest state the voltage at point C (the control input of switch ESI) is low. When the 'on' button is pushed the voltage rises and reaches the switching threshold of ESI, which then closes. When the pushbutton is released the control input of ESI remains at almost the same voltage as before because, in closing, the switch completes the circuit which ties its control input to +15 V via R3. The switch is then latched and stays closed. Pressing the 'off' button causes the control voltage to decrease and ESI opens. The circuit is then at rest again. The output of ESI controls switch ES2, through which the signal to be switched passes, so switching is simply a matter of pressing the right button. The control signal provided by ESI could be used to simultaneously open or close several analogue switches, either carrying the same signal in different directions, or dif- ferent signals in the same direction. Two of these parallel switches (ES3 and ES4) are shown dotted. This simple circuit makes no pre- tentions to being perfect; the prob- lems posed by switching a sinusoidal audio signal during its cycle (rather than when it crosses zero), are not soluble by such a simple circuit, but by the same token it is far better than what is often hidden under the shiny surface of many a 'Hi-Fi' mixing desk! M 7-78 elektor july/august 1983 74 Nigel Humphreys vector control for the Junior Computer The circuit described in this article makes it possible to read out the necessary vector data from the standard EPROM of the Junior Computer, without having to give up a considerable part of the address range and/or requiring an additional ROM. The vectors for NMI, RES and IRQ are located at the addresses FFFA...FFFF. The complete memory range of F000 . . . FFFF would be 'sacrificed' for 6 bytes if the above vectors were to be read out of the standard EPROM according to the method described in the Junior Computer Book 3. This means a loss of 4 K memory location. With the solution described here, only 16 bytes are reserved to read out these 6 bytes. Obviously, this circuit is only needed if the constructor IC1 IC2 IC3 l -P wants to put RAM in the upper memory range of F000 . . . FFFF, for example if the mini EPROM card (Elektor April 1982) is used. The circuit only consists of 8 gates. It generates two separate enable signals out of an 'ordinary' enable signa l, for this highes t 4 K range. A new ENABLE RAM signal is given at addre sses F000 . . . F FFF. How- ever no ENABLE RAM signal is given at addresses FFF0 . . . FFFF, but an ENABLE ROM signal is sent to the standard EPROM of the Junior Computer. The complete circuit can be mounted onto the corresponding RAM card because it only co nsists of three ICs. The old ENABLE line for the range F000 ... FFFF of the address decoder on the RAM card (which is output F of IC11 on the dynamic RAM card) is connected to the 'supplement/additional' circuit and the eight inputs of N 1 are connected to t he address lines A4 . . .All. A new ENABLE RAM signal will there- fore go to the RAM card, which means that this line is attached to one of the points V, W, X or Y of the dynamic RAM card. The ENABLE ROM line must be linked to K7 (pin 14a) of the connector. M 7-79 elektor july/august 1983 U 2 = (2x — 1 )U i where x rep- resents the position of PI. For example, with the wiper of PI fully clockwise Cup' in the circuit diagram) x = 1 , in the mid position x = 0.5 and fully anti clockwise x = 0. It should be noted that Ui may be a d.c. or an a.c. signal (fmax = 5 kHz). By adding an extra potentiometer P2, as shown, the circuit can also be used as an 'analogue hand-held multiplier'. The input level can then be preset with P2 and the multiplication factor with PI. Both potentiometers can be provided with a scale as shown. h microprocessor aid I Faultfinding in microprocessor sys- tems is an arduous and time- consuming task. It would be a great help if it were possible to display the information on the data and address bus of the processor. And that is exactly what the circuit described here does: the conversion of data and address into hexadecimal code onto six displays. The displays are controlled by an 1C which combines all the necessary functions: the 9368. This 1C accepts a four-bit binary code, converts it into the corresponding hexadecimal number and makes it visible on a seven-segment LED display. A latch 'memory' is also provided and the LED display is controlled directly by the 1C. From figure 1 it will be seen that, apart from the six ICs and six displays, nothing further is required. The power requirement 1 is 5 V at 750 mA. The printed circuit board for the aid is shown in figure 2. After all components have been mounted, the circuit is connected to the microprocessor. This is made easier by the use of an additional 40-pin socket with wire-wrap pins as shown in figure 3. The circuit here is then connected to the 40-pin socket by means of a suitable length of ribbon Parts list Capacitors: Cl = 10 m. 10 V C2.C3 = 100 n Semiconductors: IC1 . . . IC6 “ 9368 Technomatic LD1 . . . LD6 “ 7760 (CC) LED display cable. The various connections are made so that the first four displays jr july/august 1983 show the address and the last two the data. If an external power supply is used, the earth of the supply must be connected to the 0 V of the micro- processor board. There are two methods of using the circuit. The first is single step mode in which case the LE (latch enable) must be taken to 0 V and the display will read the data and address of each step. In the second method, the L? is controlled by the computer itself to enable a specific (and maybe momentary) data and address to be retained. The fact that it is not necessary for the computer to stop is an added advantage. dexterity game In electronics, as in everything else, we must be able to laugh, to have fun now and again, and games circuits are always particularly well received in the 'Summer circuits' issue. The principle of electronic manual- dexterity games is well known: the player attempts to pass a metal ring along a length of wire without touching the wire. An alternative version, instead of a wire, uses a metal tube which is open along its length (illustrated in the drawing). In this version of the game the tube is divided into four sections, each of which is more difficult than the last. The sound emitted, when the ring touches the tube, increases stepwise in frequency as the ring is moved closer to the end of the tube. The circuit consists of a few resistors and diodes, two CMOS ICs and, of course, a buzzer. The sound gene- ration circuit is based on N1, a Schmitt trigger inverter, and the oscillating frequency is dependent upon the number of resistors R3 . . . R5 short-circuited or left in series by the analogue switches ESI . . . ES3. If only R6 (and capaci- tor Cl ) is in the feedback loop from the output of N1 to its input, the frequency of the signal is at its maximum. This will occur if the ring touches the final section of the tube. Having reached the end of the tube the ring touches the finish 'line' and activates ES4 which sends the signal produced by the oscillator at N2 to ESI , thus switching from highest to lowest frequency. Every time the ring touches the tube the D1 . . . D5 diode network connected to inverters N3 and N4 drives N5 and N6 through 06. The N5/N6 couple is connected as a power stage and drives a buzzer while the ring touches the tube. The current consumption of such a simple circuit is quite small (=» 5 mAI so it could be considered as a 'pocket' game and powered by a battery. The values of resistors R3 . . . R5 is a matter of experimentation as the tone for each stage is a something for each user to decide. The same is true of the switching tone between two stages and at the end of a 'run( 5... 15 V N1 . . . N6= IC1 =40106 ESI ES4 = IC2 = 4066 Ot . . . D6 = 1 N4148 7-81 Our December 1982 issue featured the 2 x 140 watt Crescendo; here we describe the circuit for a main amplifier for those with more modest power requirements. A normal ampli- fier which is, however, not so normal. The output stage contains two type 2N 3055 power transistors: proven, reliable components. At first sight it appears that the output stage is not symmetrical because transistors T15 and T16 are NPN types but a second look will show that it is: the top half consists of NPN 'supertran- sistor' T1 1/T13/T15, while the lower half comprises PNP 'supertransistor' T12/T14/T16. These 'supertransis- tors' are complementary: as their emitters are connected together via R25 . . . R27 and R28 . . . R30, the output stage is symmetrical. The remainder of the amplifier is also constructed symmetrically: a double differential amplifier, T1/T2 and T3/T4, current sources T5 and T6, followed by driver stages T7 and T8. The output power is 40 watts into 8S2 or 60 watts into 4S2 for a distor- tion not greater than 0.01% over the frequency range 20 Hz ... 20 kHz. Maximum power at the onset of clipping is 45 watts into 8S2 and 65 watts into 4S2. The input sensi- tivity is 800 (850) mVeff for 40 (45) watts into 8S2 and 700 (725) mV e ff for 60 (65) watts into 4S2. The fre- quency characteristic is within 1 dB from 15 Hz to about 100 kHz. Partly because of the high current amplification of not less than 200,000, the output stage has a low quiescent current (which is not critical) of 25 ... 50 mA. Even with PI set for minimal resistance, a spectrum analyzer connected to our prototype showed a cross-over distor- tion of a very small magnitude. The quiescent current is set by means of PI, with a universal meter (dc-mV range) connected between the emitter of T15 and the collector of T16, that is across the series- connected resistor chain R25 . . . R30. A voltage of 33 mV corresponds to a current of 50 mA. There is no printed circuit board available for this project, but it can be constructed using Vero board. It is advisable to arrange the layout as much as possible in line with the circuit diagram. A common heat- sink of 1.5 .. . 2°C/W is required for T15 and T16, not forgetting the mica washers! T13 and T14 should each have a seperate heat-sink of about 12°C/W. Although the output stage, as far as quiescent current is concerned, is virtually unaffected by temperature, T9 and Til, as well as T10 and T12, may be thermally coupled, that is, they can be glued together by their flat vertical surfaces. LI is constructed by winding 2x10 turns of 0.8 ... 1 mm dia. enamelled copperwire around resistor R7. The power supply is quite normal. Current consumption amounts to 1.0 (1.06) A for 40(45) watts into 8J2 and 1.75 (1.81) A for 60 (65) watts into 4fi. M 7-82 79 O.M. Kellogg zero-crossing detector There is nothing very special about a zero-crossing detector. However, this particular circuit has an unusual feature. A certain signal level must be present at the input of the circuit before the signal at the detector results in an output signal. This therefore makes it possible for the circuit to ignore interfering signals at the input (such as noise and low- amplitude mains pickup). Potentiometer PI is used to set the sensitivity of the detector. The trigger threshold of the circuit is 300 mVpn when PI is fully rotated. Opamp Af is configured as a voltage follower. The signal is then applied to two | negative printhead supply Thermal and metal foil printers are equipped with a printhead which usually requires a rather high voltage, in order to be driven. For example, a metal foil printer needs a voltage of approximately 30 V. Some thermal printers require as high as 50 V! The maximum current that is required by the circuit is essential with printhead power supplies but good stabilisation is less important. The printhead of metal foil printers must 'heat' the surface of the foil paper, so that the metal parts of the foil evaporate, thus obtaining the 'print' that is wanted. The current value required ,,s n> Schmitt triggers whose hysteresis is determined by the ratio of resistors R9 : R4 and R8 : R7. Opamp A2 detects the zero-crossing of the rising input voltage. Preset poten- tiometer P2 is adjusted so that the at the instant of zero-crossing of the rising input signal. Opamp A3 has a different response. At the zero- crossing of the negative-going signal, the output switches from logic 1 (+15 V) to logic 0 (-15 V). The signals obtained in this way trigger the Schmitt trigger (A4) which operates as a storage flip-flop. The result is an output signal which is synchronised with the zero-crossing of the input signal, without being affected by low-amplitude interfering signals. H for this process is about 1 A. Basically the circuit is really an ordinary stabilised power supply. Resistor R1 ensures that the circuit can 'start'. The output voltage level can then be set with preset P2, via a feedback circuit, consisting of D1, P2, R7 and T2. The range mainly depends on the value of zener diode D1 and the level of the input voltage. In our case the output can be set to any voltage level between —22 V and -33 V. The complete control range can be 'shifted 1 by choosing another value for D 1 , let 1 s say 40 V. A rule of thumb is that the zener voltage must be identical to, or just below, the minimum output voltage. The circuitry around T3 takes care of the current limitation of the power supply. The maximum output current can be set between 1 and 2 A, with the aid of PI. Obviously the circuit requires only minor changes to obtain a positive output voltage. The 'recipe' for a positive output voltage is T 1 becomes 2N 3055, T2 and T3 both become BC547B and D1 and Cl must be turned 'upside down' to maintain the correct polarity. M 7-83 distance meter for thunderstorms The clouds in the sky are dark, giving an ominous warning of the thunderstorm that is on its way. Sure enough, the first flash of lightning is seen; it would be interesting to know how far away the thunderstorm is. The circuit described here is intended to provide the answer to that ques- Light (including lightning) travels at a speed of 300,000 m/s. Sound, in this case thunder, travels in air at an average speed of 333 m/s, depending on the ambient temperature. This is the reason why the thunder is usually heard a few seconds after the light- ning flash is seen. The thunder needs about three seconds longer to travel one kilometre than does the lightning; this is the same as 0.3 seconds per 100 metres. The circuit puts this theoretical knowledge into practice. The 555 timer 1C operates as an astable multivibrator with a frequency of 3.33 Hz; the period is 0.3 s. This is exactly the time differential between the propagation speeds of the light- ning flash and the thunder. As soon as the flash is seen, the distance meter is started by briefly pressing pushbutton S2. Counters IC2 and IC3, which are connected in series, are given a reset signal which resets them to zero. The output signal of IC1 is applied to the clock input of the first counter (IC2) and is then processed by the latter. LEO 01 lights after 0.3 s. Each subsequent clock pulse activates the next higher output after 0.3 s. The counting operation is interrupted by pressing pushbutton SI, as soon as the thunder is heard. The distance of the thunderstorm from the user's location is indicated by one or two of LEDs 01 . . . D18. Counter IC2, counts the distance from 100 m to 900 m. If the thun- derstorm is further than that, counter IC3 handles the kilometres. If, for example, only LED D5 lights, the thunderstorm is at a distance of 500 m; if LEDs D16 and D3 light up, the distance is 7300 m (maximum distance = 10 km). The maximum current drawn by the circuit does not exceed 30 mA; a 9 V battery is therefore sufficient to power the circuit. A digital watch with chronograph function is used to align the circuit. PI is adjusted so that the last LED D18 lights up 27 seconds after S2 has been released (the stopwatch must be started simultaneously)). Further refinements could include an LDR that will allow the lightning to automatically start the counter, and a microphone to stop it. How- ever, the LDR would be useful only at night and the problems associated with catching distant thunder with a microphone. . . Perhaps it would be better after all to do what we do . . . put your head under the pillow and forget the whole thing! M common base mixer Mixing of audio signals is normally I effected by means of a so-called virtual-earth mixer, in which the various input signals are applied to the virtual earth, that is, the inverting input of an op-amp, via a series of resistors. The mixer described here uses a different approach. The circuit is designed on the com- mon base principle in which the input voltages are transformed into alternating currents which, when added together, constitute the collec- tor a.c. component. The emitter of a common base configuration is low impedance and acts as virtual earth, so that crosstalk between the various input signals is virtually impossible. The output signal is taken from the collector of T1 . The amplification of the circuit is equal to R6 t R j where Rj is the input resistance (= one of the resistors R1 . . . R5). A current source, consisting of T2 and T3, has been provided in the emitter circuit of T1. This current source is high impedance for alternating voltages so that it does not affect the signals at the emitter of T1. The base volt- age of T1 is set by resistors R7 and R8. Capacitor Cl ensures that the base of T 1 is decoupled effectively. The number of inputs can be ex- tended as required. N 7-84 This simple circuit is of interest because it enables drill speed to be controlled irrespective of the load on the drill. The design makes use of the fact that as the load increases the back EMF of the drill falls and thus the current increases. It is clear, looking at the circuit diagram, that this circuit is not at all complicated, and the same is true of its operation. During the positive half-cycles of the mains C2 is charged up through R1 and D1, until the voltage across this capacitor is equal to the 'zener voltage' of the circuit at T 1 . The circuit based on T 1 is an adjustable zener in which the zener voltage is defined by the setting of PI. In fact the voltage between collector and emitter is defined by elektor july/august 1983 the ratio between resistors R3 and R2+ PI. The voltage drop across R3 is always equal to the base-emitter voltage of T1 (0.6 V) so it follows that the zener voltage is equal to PI + R2 + R3 R3 0.6 V. The motor is not connected in the usual place at the beginning of the circuit, but instead it is immediately after Thy 1. The firing time of Thy 1 is thus defined by the difference between the zener voltage and the back EMF of the motor. If the motor becomes more heavily loaded, the thyristor will fire sooner. Because a thyristor is used the circuit can only control 180° of the supply cycle; so with this circuit it is not possible to vary the drill speed from 0 to 100%, but such a controller is usually only used in low speed applications. A disadvantage of this circuit is that the motor 'stutters' a bit when it is not under any load but this effect disappears when there is a load on the drill. Inductor LI and capacitor Cl are used to filter out high frequency effects caused by phase-chopping. The thyristor must be mounted on a heat sink to ensure effective cooling. 84 S.P.T.S. single pole toggle switch As can be seen elsewhere in this issue, a press on/press off function (toggle) from a single pole push button can be achieved quite easily. In this case the circuit is slightly more sophisticated and uses an op-amp to provide the toggle func- tion. Switch bounce, (where the contacts quite literally bounce and provide a number of pulses instead of one) the ever present problem with all mechanical switches, is removed in this circuit. Even though an op-amp is involved, the circuit is still very simple. The gain (ampli- fication) of the op-amp is very high which means that its output can easily be high (+Ub or logic '1 ') or low (— Ub or logic '0'). A small portion of the output voltage level (for real fanatics about 1/23) is fed back to the non-inverting input of the op-amp. Pressing push button SI will connect capacitor Cl to the inverting input of the op-amp. If the output was low, the op-amp will immediately change state and Cl will begin to charge via R1. However, if SI is held the capacitor will only charge to a value of Ub x R 2 (R, + R 2 ) which works out to about 0.01 Ub- When SI is released the capacitor will continue to charge right up to Ub- Now that SI is open Cl is no longer connected to the op-amp and its output information is retained. If SI is then closed once more, the logic '1' across the fully charged capacitor will appear at the inver- ting input of the op-amp. The op-amp will again change state to provide a logic '0' at its output and the capacitor will discharge. We are back where we started! It must be remembered that when an op-amp is used with an asym- metrical supply, the junction of R2/R3 must not be connected to earth but to a point midway between the positive and negative supply level C/sUb). A potential divider consisting of a pair of resistors will be sufficient for this purpose. H 7-85 elektor july /august 1983 given in figure 2 in which the latch ( I Cl ), comparator ( I C2 and I C3) and the counter (IC4) are immediately evident. Other stages are a clock oscillator (N1, N2 and N3) and a buffer for the analogue output (IC5). The integrator (R3 and C2) is pre- ceded by two CMOS gates the supply of which can be derived from a reference voltage. To start reading of the data, an enable pulse must be given at pin 1 1 of IC1. The oscillator can be switched on and off by the input at f; if this input is open, the oscil- lator will do just that! It is possible to connect a second, external oscilla- tor to this input, in which case, the clock frequency will be that of the Special ICs are available to achieve an analogue output from a computer. A digital to analogue converter using these beasts can be simple but expensive. However, a simple cir- cuit can also be constructed from standard components. The circuit described is simple in conception, no special components (not even high stability resistors) are used and it provides two outputs: one pulse- width and one analogue. The operation of the converter can be seen from the block schematic diagram in figure 1 . An 8-bit data word from the computer determines the level of the analogue output voltage, and this data (0 . . . 255) is stored in a latch. An 8-bit counter continuously counts from 0 to 2® (256). The output data from the latch and those from the counter are compared by a comparator. The A > B output of the comparator will be logic 1 during the time it takes for the counter to run from 0 to the number in the latch. From that point on (that is from the num- ber in the latch to 2 8 ). it will be logic 0. This output therefore de- livers a pulse-width modulated signal, of which the pulse-width is deter- mined by the data the computer supplies to the latch. The available signal can be converted to an ana- logue voltage by integration and for this only a resistor and capacitor are required. The circuit of the D/A converter is 1 jinun Resistors R1 * 100 k R2, R3 = 10 k PI > 10 k preset potentiometer Capacitors C2 - see text C3,C4 = 10 n C5= 100 n C6= 10 p/10 V Semiconductors IC1 = 74LS373 IC2.IC3 = 74LS85 IC4 = 74LS393 IC5 = 741 , 3140 IC6 = 4049 7-86 elektor july /august 1983 external oscillator. With the com- ponent values shown, the clock oscillator frequency will be about 300 kHz. This results in a pulse width modulated signal at output P with a frequency of (1/256 of the clock frequency) a little higher than 1 kHz. The clock can go up to 10 MHz. If lower frequencies are desired the value of the integrator capacitor C2 must be increased. IC1 . . . IC4 are supplied from a single 5 V line at a current consump- tion in the order of 50 mA. The inverters in IC6 are supplied from a reference voltage U r . This voltage must be about 5 V and determines the stability and the maximum level of the analogue output signal. Buffer IC5 needs a symmetrical supply of ± 1 2 V ... ± 1 5 V. Preset potentiometer PI is included for adjustment of the off-set of the op-amp. The pulse-width signal can be used directly or via an amplifier to con- trol the speed of d.c. motors (which react well to pulse control). This signal can be taken from either pin 11 of N4 or pin 15 of N5. If the analogue output is not used, R3, C2 . . . 04, PI and IC5 can be omitted. The simple digital to analogue con- verter can be constructed on the layout for the printed circuit board shown in figure 3. The photograph is that of the output signal of the comparator (lower trace) at a clock frequency of 100 kHz and input data corres- ponding to number 15. M synchronous, constant- amplitude sawtooth generator This circuit was designed because we needed a sawtooth waveform with a well defined constant amplitude for applications in pulse-width modu- lation control systems. The circuit here is a generator that produces a sawtooth signal which can be synchronized with an input pulse. The circuit can therefore be consid- ered as a control system which is comparable with an analogue sub- routine. The average output signal level of op-amp A1 is compared with a reference voltage by com- parator A2. If necessary, the two levels are equalized by means of T1 and T2. The time-constant of the control system is formed by resistor R4 and capacitor C3. If the time-constant is made too small, the rising edge of the sawtooth will tend to become sinusoidal and the linearity of the signal will suffer. With the values shown, the frequency range lies between 100 Hz and 5 KHz, which can be extended upwards by the use of an op-amp with a higher performance. The value of capacitor Cl will then have to be modified accordingly. The amplitude of the output signal can be calculated from the formula: U out = R6/IR5+R6) x 2Ub- The circuit has been designed for a supply voltage, Ub. of 12 V: the current consumption will be less thanlOmA. H 7-87 preset the hard(ware) way Since the inspired 'eureka!' of one R. Moog while pondering the concept of voltage controlled sound synthesis modules, electronic music making has virtually stood still. Peremptory though it may seem this statement is none the less true and the same can be said of other 'up to date' electronic musical instruments. In fact there is only one novelty of note and that is the advent of 'musical microprocessors', and these are already commonplace in modern synthesisers. Their task is not really to supply music, rather to make up for the deficiencies suffered by many musicians who play from 'memory' and cling blindly to 'programming'. Programming and memorising cer- tainly give undeniable benefits which simply were not possible before. But not everybody is willing to pay the (high) price and many may prefer a completely different solution, so it is worthwhile considering a wired, dis- crete, inexpensive alternative. What we propose here is the basis of a 15 V system which can be expanded at will. A main switch allows a selection to be made between ordinary manual mode (with the original potentio- meters acting as usual), and pro- gramming mode. In this latter case the normal potentiometers are dis- abled; a multi-way switch (S2) switches, in turn, batteries of pro- gramming presets, each delivering the exact voltage needed to obtain a specific sound. All the control lines are connected by means of a system of diodes which prevent any interaction between the control signals which are inactive and those which are active. In order for this circuit to operate, the original wiring must be modified and, of course, care must be taken in rewiring, but this is a small price to pay for what could be the ultimate solution! K variable zener One of the problems encountered in developing circuits is the selection of correct values for various compo- nents. Often trial-and-error is used to find the most suitable value for a particular circuit. There is, however, one major problem with this method of selecting values; most people who build electronic circuits as a hobby do not have vast quantities of com- ponents to cover all the various values which might be needed. And, of course, there is always Murphys law to consider: you always have every value of component possible - except the one that you need. So, having been 'bitten' (not literally) once again by Murphy, we came up with a design for a 'zener diode' with variable zener voltage. Compared to 'normal' zener diodes, Rj is some- what higher (20 . . . 50 S2), the maxi- mum load lower and the temperature coefficient less ideal (about — 2 mV/ °C/0.6 V). The circuit is, however, quite straightforward and U 2ene r can be varied over a wide range (3 ... 25 V) which is, after all the whole idea. As soon as the voltage at the base of T1 is greater than 0.6 V this transistor will conduct. Consequently T2 con- ducts and the voltage cannot rise any more, just as in a zener diode. The ratio between P1/R1 and R2 defines the zener voltage of the circuit. To set the zener voltage the circuit must be connected via a 10 k resistor to a supply, and then potentiometer PI should be adjusted until the desired zener voltage is reached. If the circuit is used to replace a zener in an existing set-up the extra 1 0 k resistor is not needed, of course. The maxi- mum permitted current through this variable zener is 100 mA. Transistor T2 can dissipate a maximum of 100 mW. H 7-88 elektor july/ai known device with a wide range of possible applications. Elektor has already provided many applications and here is yet another. The timer is configured as a mono- stable multivibrator and monitors a voltage level. This can be, for example, the +5 V supply voltage of a microprocessor system. The voltage to be monitored is applied to trigger input pin 2, via preset potentiometer PI . The timer is in the quiescent state when the input voltage, is higher than the trigger threshold set with PI . Output pin 3 is then a logic 0. The green LED lights, indicating that everything is in order. If the input voltage drops below the set trigger threshold, the level at the output of the timer changes to a logic 1 . LED D2 goes dark, but the red LED D3 lights. This means that the input voltage has dropped below the minimum permissible Brief voltage failures are 'extended' by the 555 so that the red LED can clearly indicate them. In the event of a longer voltage failure the monostable 'restarts' continually. The on-time of the timer is cal- culated according to the formula 1.1 x R1 x Cl; it is approximately 1.65 s with the values specified. When the voltage monitor is switched on, the red LED lights briefly but only until capacitor Cl has charged up to more than 2/3 of the supply voltage. K mini compressor will flow from its emitter through diode D1. This diode in turn con- ducts more and more and shorts to ground an ever greater amount of the audio signal received via R1. That, basically, is how the cir- Diodes D3 and D4 are forward biased by T2 and R4 so that the detector can work with even very small input signals. The decay time of the con- trol system is defined by the values of C4 and R5. There is no timing control (unlike a similar feedback system), as such a timing signal can easily cause overdriving. Because of its very simplicity this compressor is most effective. With an input varying by about 50 dB the output stays constant to within ± 3 dB. The asymmetric set up does not actively keep distortion down to a particular level (it is a few percent), but that does not matter in most applications. One obvious use of this compressor is to build it into an amateur radio transmitter as there is nearly always a vacant space in such a device for a handy little circuit like this. H This is a circuit for a 'feed-forward' dynamic compressor which, unlike a 'feedback' system, does not use the output signal as a feed back into the control system. So rather than use a control loop, this circuit uses par- allel control. The diagram shows most of a feed forward set-up. The design criteria here was for a simple dynamic compressor using only one active component (T1). The audio signal received at the input normally travels via Cl, R1, D1, C2 and R2 to the output. However a part of the audio signal also feeds the detector of D3/D4 and sets up a control voltage for T1 . The higher the value of the input audio signal, the more T1 conducts and the more current 'VO® elektor july /august 1983 This circuit of a Random Access Memory controller is a real treat for owners of a 6809. It enables at least 128 k bytes of a dynamic RAM to be addressed and even then it has some spare capacity. The controller cannot be used for chips other than the 6809 as it makes use of a special feature of that particular processor. The memory refresh is produced by timing signals from the microprocessor E and Q. An OR function with these two sig- nals is performed by gates N2, N3 and N 10, and the timing diagram is shown in figure 3. The circuit of figure 1 shows only two of the eight memory ICs (4164); the corresponding signals must, of course, be fed to each of the eight memories of a 64 k block (see figure 2). A buffer for the data bus is not envisaged; if this is desired, take care that is operating speed is sufficient, otherwise it could up- set the operation of the controller. By 'AND ing' the E and Q signals, the CAS signal fo r both 64 k stacks is produced. The CAS1 select signal for the upper 6 4 k st ack is produced by 'NANDing' CAS and the 1Y outpu t of IC 5; that for the lower 64 k (CAS2) stack by 'NANDing' CAS and output 2Y of IC6. The software should ensure that during the row address time suitable signals (AO, A1, A2, A14 and A15) for driving IC6 and IC7 are present on 2 the address bus. It is almost impossible to show this correlation clearly, but the matter should be much more obvious if you imagine IC7 as being replaced by the four bistables which make it up. A final note: IC6 produces the MSB (address 15) at its 3Y output when strobed by the signal on address bus line A15. H 7-90 elektor july/august 1983 92 acoustic 'flag' for the RS232 interface In the course of their work pro- grammers rarely use their sense of hearing. Why not use these inactive Serial communication between a computer and its peripherals (no- tably the VDU) is in the form of pulse trains which make up the given transmissions. In the case of the Junior Computer and the elekterminal, for instance, the pulse width is determined by the trans- mission rate of 1200 baud; or 833 ps . . . which is of course within the audible frequence range! This fact gave rise to the idea of using these pulse trains as acoustic flags, thus allowing the programmer to concentrate on his screen, keyboard and especially his manuscripts, while entering data into memory. Similarly, while clearing the mem- ory (at the end of some particular type of research, for example) the user need no longer keep looking at the screen until the required out- put appears: a string of 8F F (or any other constant signal) gives an audible indication as long as the same signal (which could be programme instructions, for example) continues. You only have to listen. The actual circuit is very simple: it consists of a small amplifier which drives a miniature loud- speaker. The few components re- quired are mounted on a prin- ted circuit board which has a 31 pin male connector (or solder tags). This mates with the 31 socket female connector on the main card of the Junior Corn- respect to the actual logic level output from the RS 232 interface; consequently in the inactive state PB0 has a high logic level: thus the acoustic flag will be on stand-by during data transfer via the inter- Apart from the use outlined here, this little circuit can also be used as a complete amplifier for other A very nice power amplifier deliver- ing 10W into 2 n (two 4 loud- speakers in parallel) can be built using the TDA 2003 1C and a few passive components. The circuit diagram shows that a fully operational circuit need not be big and complicated. The signal in- put is via capacitor Cl to pin 1 of the 1C. There is a feedback loop be- tween pin 4 (the output) and pin 2 (the feedback input). The amplifica- tionfactor is defined by the relation- ship between resistors R1 and R2 and in this case, the amplification is about 100 times. Resistor R4 and capacitor C7 are included to ensure that the amplifier remains stable at higher frequencies. The loudspeaker is connected to the output via electrolytic capacitor C4. The RC network of R3/C5 acts as a component of the output load and compensates for the rising impedance of the loudspeaker at high frequency. The power supply is connected to pins 3 and 5 and maximum supply voltage is 18 V. Higher supply volt- ages will not necessarily damage the 1C but will mean that the output d.c. voltage drops to such a level that the 1C can no longer be driven. The 1C also includes short-circuit, over- load and thermal protection. To maintain stability it is rec- commended that separate wires are used to connect the 0 V of the printed circuit board and the loud- speaker independently to the main earthing point on the chassis. After construction is completed the current consumption of the circuit should be checked. It should be about 50 mA, and the value of the d.c. voltage at the output should be about half the value of the supply voltage. The output power is 1 0 W into 2 SI. 6 W into 4 O, and 3 W into 8 fl. K 7-91 \elektor july/august 1983 The full title for the description of this circuit should be '3 state 5 V logic tester', which at least hints at the fact that this logic tester is something out of the ordinary. And indeed it is, for not only does it differentiate between the two normal logic levels (high and low) but also it indicates when the signal under test is neither of these, be it a negative voltage, more than 5 V or even an alternating voltage. Similary it recognises unpolarised TTL or LS circuit inputs. And that is not all . . ., this circuit also enables the logic level indication to be made audible, so there is no need to concentrate on anything other than the circuit under test. To do all this the circuit uses an LM 3914, which is an 1C that can sense analogue voltage levels and directly drive 10 LEDs to pro- (at pin 6) is set in the circuit here to 10 V thereby providing 1 V between each 'step' in the dividing chain. The upper half of the drawing contains the circuit for the 10 step divider and display. The reference level is adjusted by P2. The circuit illustrated in the lower half is that of the audio indicator, a useful accessory to the logic tester. The various uses of the tester will be understood by the indications given by the display. LED D2 lit : in this case the 'Z' output is active 'low' (set to ground), to indicate 'high impedance'; there is no voltage at the B input and the input (pin 5) of the LM 3914 is held at slightly less than 2 V by means of R5, PI and T1. LED D3lit: point A acts as a refer- ence point in this case and is tied to the ground of the circuit under test, (which may be different from that of the tester), and point B is taken to the same potential as point A, pin 18 goes to logic low and output '0' is active, indicating 'low logic level'. This particular arrangement of A as a reference point also prevents the power supply of the tester from being affected by the logic levels of the circuit under test. LED D4 lit: when the potential difference between A and B is between 1 and 2 V LED '?' lights to signify a logic 'not sure'. LED D5 lit: if the voltage at point B is between 2 and 5 V the '1 ' LED will be lit to indicate that there is a 'high logic level' present. LED D6 lit: if there is a negative voltage between A and B, T1 con- ducts, followed by T2, resistor R6 is shunted. Immediately the voltage at pin 6 drops and LED 'D' lights, signalling a 'defect'. Similarly this LED lights if the potential between A and B is more than 5 V. The audible indication circuit con- sists of the four NAND gates of a 4093 and a 555 timer, and these two are all that is needed for a simple but usable device. The acoustic signals are as follows: ■ D2 lit: 'high impedance': silence. ■ D3 lit: 'low logic level': short ■ D4 or D6 lit: 'fault': continuous ■ D5 lit: 'high logic level': long tones. The prototypes worked very well and we found that current consumption is about 37 mA without the audible indication circuit, or about 50 mA with. One point to note is that precision resistors must be used because of the accuracy required for the 2 and 10 V references, and similarly care should be taken to select a good quality voltage regulator. 7-92 microphone amplifier with preset tone control The active parts of the circuit (ampli- fiers A1 and A2) shown in figure 1 are contained in IC1. A1 operates as a non-inverting ampli- fier and the microphone input is applied to pin 1 via coupling capaci- tor Cl . The amplification factor of this stage is determined by the ratio of resistor R5 to the parallel combination of R1 ... R4. With R1 switched in, the amplifi- cation factor is about 225, with R3 switched in about 60, and with SI in the centre position about 14. As the effective input sensitivity can be altered by SI, it can be matched to different input levels or microphones. The output of A1 is applied to a tone control stage, A2. The ratio R13/R12 determines the amplifi- cation (about 1 8 d B) of this stage. The effect of R11 and C6 is, in principle, the same as that of R2 and C2: a smaller value of C6 in- creases the lower cut-off frequency. The RC network between A1 and A2 is the real tone control. Potentio- meter PI sets the bass level and P2 1 elektorjuly /august 1983 the treble level. Use is made of the characteristic of capacitors behaving as frequency-dependent resistances for ac voltages. The output signal of the ampli- fier is available for connection to the main amplifier via C9 and poten- tiometer P3. This microphone amplifier has not only been tested in the Elektor laboratories but also by the de- signer during searching on-stage tests. A printed circuit board for this low noise amplifier is available. It is very narrow to enable it to be used as an input module in a Resistors R1 = 470 n R2 * 10 k R3 = 2k2 R4 « 27 k R5 = 100 k R6 = 10 k R7 = 10 k R8 - 3k9 R9 = 3k9 R10= 12k R11 = 3k3 R12 = 270 k R13 = 2M2 R14 = 1 k PI = 100 k lin. preset P2 = 500 k lin. preset P3 ■ 10 k log. preset Capacitors Cl = 100 n C2 = 10 p/35 V C3 = 1 p/35 V C4 = 47 n C5 = 4n7 C6 =2n2 C7 = 100 n C8 = 1 p/35 V C9 = 1 0 p/35 V CIO = 100 n C11 = 100 p Semiconductors IC1 = LM 387 Miscellaneous: pole change-over, centre off 1 microphone socket (mono) 2 Hh IhId-4 HH-H r RFrMi ^ = 0 = 7-93 ^g ^elektor july/august 1983 current source for photodiodes There are many circuits available today which use modulated light signals to transmit information. Generally, the actual receiver consists of one or more photodiodes. In such applications it is important that the dynamic range of the photodiode is sufficient. However, increasing the dynamic range can cause the sensit- ivity of the diode to decrease. Another disadvantage is that photo- diodes are sensitive to changes in ambient light conditions. The cir- cuit described here increases the dynamic range of the photodiode without affecting its amplification. It also filters out the effects of slow variations in light intensity so that the problems with ambient light are greatly reduced. As the diagram shows, the circuit is very simple. When light falls on 01 this diode produces a photocurrent, relative to the intensity of the light If the current is small, transistor T1 just conducts. When the light inten- sity (and thus the photocurrent) increases, the current through T1 also increases and this shorts excess current to ground. With rapid fluc- tuations in the light intensity falling on 01, T1 presents a high impedance (because Cl does not have time to charge). The input signal is then output directly at X. This means in effect that the dynamic range of the diode has been increased without reducing the amplification. The sig- nal at point Y, even though it is not directly proportional to the light intensity, can be used to examine the changes in the average light intensity falling on D1. In virtually all applications it is important that when the light is frequency modulated at 50 Hz (such as house lights) this must not be seen as a modulated signal. To ensure this. Cl must be at least 1.5 /jF. With this value of capacitor the change-over point from high-pass to low-pass is about 50 Hz. If, as shown in our diagram, C 1 has a value of 1 0 jiF the change-over point is about 7 Hz. M 5 ... 25 V To be able to check the connections to an unknown ASCII keyboard, you want to know first of all where the supply voltage is connected. This can quite simply be done by removing the cover and tracing a pair of the wider tracks to the ICs. Next, the strobe connection has to be found. After the supply voltage has been connected, pressing one of the keys must produce a short (strobe) pulse at one of the output pins. If an oscilloscope is used to find this pulse, it will be seen at once whether it's positive or negative. Once these preliminary checks have been carried out, the faultfinder can be used. Connect the outputs of the keyboard BCS47B to the faultfinder. Set the strobe T1 as shown in the circuit input to positive or negative with When one of the keys is pressed, a switch SI. A positive strobe is strobe pulse is produced which connected directly to SI ; a negative triggers the eight-stage bistable IC1 . strobe is first inverted by transistor The signals present on the data lines 7-94 elektor july/a are stored by the bistables and the resulting outputs are applied to IC2, which comprises eight inverting driver stages. If one of the bistable outputs is logic 1, the output of the corresponding driver is 0. Conse- quently the corresponding LED lights. If the input to one of the driver stages is logic 0, its output is 1 and therefore virtually of the same level as that at the anode of the respective LED which thus remains off. Now all that's needed is an ASCII table and the various connections are soon sorted out If you don't have such a table, you'll find one on page 6-59 of our June 1 983 A final important note: in the case of keyboards which have not only a parallel but also a serial output, it is possible that on pressing one of the keys a series of pulses is produced of which the level lies at ± 1 2 V. If you're therefore not sure whether the keyboard under test has only a parallel output, check this before connecting the faultfinder to it M When fault finding in a micro- processor system it is not always possible to work in single-step mode, as the processor would then have to stop completely. Not all processors have a wait-input; the Z80 (which is the system we used to evaluate this circuit) has such an input, but with this we get the problem that the refresh of any dynamic RAMs used is lost if the processor is stopped. With the fault finder described here, and the '^Processor aid' published elsewhere in this issue, both addresses and data can be looked at without the processor having to be stopped for any length of time. Operation is as follows. After the circuit sends a short reset pulse to the proce ssor the program is executed. This RESET pulse is supplied by monostable multivibrator (MMV) ICIa; pulse duration is about 2 ps (the pulse has to be short or the data in the dynamic RAMs might be corrupted). At the same time the second MMV, consisting of ICIb, is triggered. The duration of the pulse supplied by ICIb can be adjusted with the ten turn potentiometer PI . This pulse is comb ined w ith the Memory RequestJMREQ), Read ( R D ) , and Write (W R ) signals of the computer system so that a latch enable (LE) pulse is present at the output of N3 after the MMV time of ICIb has elapsed. This LE pulse is sent to the ^Processor aid which then reads and holds the data and address present at that moment. The pulse also goes to the input of ICIa so that when this LE stops another RESET pulse is automatically sent to the processor. In this way it is possible, simply by turning PI , to look at all the memory cycles one after another. This system gives a reliable read out of programs that are not more than a few decades of bytes long. However, the time delay is not stable enough for the system to be usable with bigger MREQ signals so that during a read or write operation the information content is read into t he ^Pro cessor aid. If only and MREQ were used, then only read instructions could be saved for ex amination. Using 1/91? and MREQ only write instructions are 'latched' into the ^Processor aid, and using and iViT only opcode fetches; other combinations are also possible, of course. RD and/or WR must still be used as addresses and data are only valid when these signals are active. If processors other then the Z80 are to be used then this circuit will have to be adapted to use the available signals. *• 2 99 thermal indicator for heat-sinks The temperature of a heat-sink can be measured with a wet finger: if it sizzles, the temperature is too high. The circuit in figure 1 is an alterna- tive method of checking that does not cause blisters: a thermal traffic light not unlike the audio traffic light featured in our March 1983 issue. A green 'safe' LED lights as long as the temperature of the heat- sink does not exceed 50° Centigrade, an orange 'caution' LED for tempera- tures of 50° . . . 75° Centigrade and a red 'danger' LED for temperatures above 75 Centigrade. The circuit is simplicity itself, two special zener diodes, D1 and D2, are connected in series to ensure an accurate zener voltage of 5.96 V at 25° Centigrade. The zener voltage will rise by 20 mV for each degree Centigrade rise in temperature. The voltage level corresponding to the temperature of the heat-sink is compared with two reference volt- ages by IC1 and IC2. When the temperature reaches 50“ Centigrade the output of IC2 goes high so T3 conducts and causes D4 to light and at the same time D5 is extinguished by T4. At or above 75° Centigrade the output of IC1 is high and T2 and T3 then conduct to make D3 light and D4 extinguish. Under normal conditions, that is, considering a heat-sink of sufficient cooling area, a temperature of 75° Centigrade will never be reached. Figure 2 shows the Pd/Po(max) relation between the power dissi- pation of a class B amplifier and its effective power output P 0 /Po (max) under normal condictions. The drive signal is a sine wave. The effect of the quiescent current on the dissi- pation has been ignored. It is seen R2 = 5k6 R3,R12 = 820 n R4 = 220 Cl R5= ison R6 = 470 n R7 = 4k7 R8,R9,R10,R1 1 = 15 k Semiconductors: D1.D2 = LM335 (National Semiconductor) D3 = LED red 5 mm D4 = LED orange 5 mm D5 = LED green 5 mm T1,T2,T3,T4 = BC547B IC1.IC2 = 3140 july/augu that the maximum temperature does not occur at maximum but at 40 per cent output. By comparison, the dissipation in a class A amplifier is highest in its quiescent mode and lowest at full output. Under abnormal conditions the heat-sink can get very hot. If the output is shorted, for instance, P 0 is nil, but the alternating output current is far from zero and the totally internally dissipated power is converted into heat Assuming that the extremely high temperature of the heat-sink is caused by a very low load resistance, T1, which conducts at a temperature of 75 0 Centigrade and higher, is used to remove the low load from the amplifier output If the collector of T 1 is connected to the base of T5 in the switch-on and d.c. protection circuits (featured in our January issue in 'Accessories for the Crescendo Power Amplifier') the loudspeaker relay controlled by T5 will open. If it is required to monitor both channels of a stereo amplifier such as the Crescendo, the thermal indicator circuit can be duplicated or ex- panded. To expand the circuit diodes D3, D4, D5 and resistor R12 remain as shown, while the LEDs are con- trolled by parallel connected tran- sistors T4 and T4', T3 and T3' and T2 and T2'. In that case the ’higher of the two heat-sink tempera- tures determines which LED will light. It is fairly simple to vary the tem- peratures corresponding to the orange and red, if so required. The reference voltage, U re f, of a compara- tor can be derived from the tempera- ture, t, according to the following '“T" 5960 * 20(1-25),, u "f To® v It is possible to set the two reference voltages very accurately by means of voltage divider R2 . . . R7. H Input & Display non-defined L 100 U e > U, |u e