[ 7 ] • * T ■ ^ j i] [ 1 1 1 [ «j I [(] » ! 4 k i r g jKijiiXiii s*. lbf>-4 fehi |l f : ;p> g !&■> mm ■ c * ^ • v* w7 jr» , elektor december 1977 — E5 The electret microphone preamplifier is a compact, low-noise, battery- powered device that can be used to boost the signal from electret and low-impedance dynamic microphones. The long straight copper tracks on the p.c. board oftheUHFTV modulator are actually 'stripline' inductors. This greatly simplifies construction, while at the same time making the circuit highly reliable. This is an actual-size reproduction of the prototype of the MW reflex receiver! However, it is not advisable to build it this small unless one has considerable experience in construc- ting HF circuits. s I This month's cover picture illustrates our intention to publish a sufficient number of smaller projects to counter-balance the big ones. . .The 'Santatronics' projects in this issue (each accompanied by a drawing of a gift-wrapped parcel) can be considered a foretaste of what is to come. selektor Iz-Ui analogue frequency meter 12-02 This article describes a 'frequency plug-in' that will enable any multimeter (or voltmeter) to read frequencies between 10 Hz and 10 kHz. experimenting with the SC/MP (2) H. Huschitt 12-04 Among the topics discussed in this second part of the series on the SC/MP microprocessor are programming techniques, the SC/MP status register and address decoders. In addition a CPU card is described, which is designed to accomodate both the CPU itself and future 'monitor software'. djolly djingle djenerator 12-15 electret microphone preamplifier 12-18 UHF TV modulator 12-20 TUP/TUN/DUS/DUG 12-23 cumulative index volume 3 - 1977 12-24 transistors 12-26 formant - the elektor music synthesiser (6) . . 12-27 C. Chapman The five waveshapes produced by the VCO, the description of which was concluded last month, can further be processed to produce a wide range of tone colours using the tone- shaping modules, which consist of the voltage-controlled filter (VCF), voltage controlled amplifier (VCA) and the Attack, Decay, Sustain, Release (ADSR) envelope shaper. This month’s article describes the VCF. heating control 12-34 missing link 12-38 stylus balance 12-38 signal injector 12-39 knotted handkerchief 12-40 sensitive lightmeter 12-41 The lightmeter described in this article utilises a silicon photo- diode, the most up-to-date method of light measurement, and may be used either for photographic purposes or for the measurement of illumination. MW reflex receiver 12-44 music box — M. Bolle 12-48 This simple little circuit can be used to make an amusing musical toy in the form of a drum which, when rolled along the ground, will play a musical scale, nursery rhyme or other tune. market advertiser's index 12-48 E-26 12-02 — elektor december 1977 analogue frequency meter To measure frequency one does not immediately have to ‘go digital’. The analogue approach will invariably prove simpler and cheaper, in particular when the analogue readout (the multimeter) is already to hand. All that is needed is a plug-in device, a ‘translator’, that will give the meter an input it can ‘under- stand’. This design is based upon an integrated frequency-to-voltage con- verter, the Raytheon 4151. The device is actually described as a voltage-to- frequency converter; but it becomes clear from the application notes that there is more to it than just that. The linearity of the converter IC is about 1%, so that a reasonably good mul- timeter will enable quite accurate frequency measurements to be made. Because the 4151 is a little fussy about the waveform and amplitude of its input signal, the input stage of this design is a limiter-amplifier (compara- tor). This stage will process a signal of any shape, that has an amplitude of at least 50 mV, into a form suitable for feeding to the 4151. The input of this stage is protected (by diodes) against voltages up to 400 V p-p. The drive to the multimeter is provided by a short- circuit-proof unity-gain amplifier. The circuit Figure 1 gives the complete circuit of the frequency plug-in. The input is safe for 400 V p-p AC inputs only when the DC blocking capacitor is suitably rated. The diodes prevent excessive drive volt- ages from reaching the input of the comparator IC1. The inputs of this IC are biased to half the supply voltage by the divider R3/R4. The bias current flowing in R2 will cause the output of IC1 to saturate in the negative direction. An input signal of sufficient amplitude to overcome this offset will cause the output to change state, the actual switchover being speeded up by the positive feedback through C3. On the opposite excursion of the input signal the comparator will switch back again — so that a large rectangular wave will be fed to the 4151 input. The 4151 will now deliver a DC output voltage corresponding to the frequency of the input signal. The relationship ainoibgui<2 frequency inndrei: A true 'universal meter' should be I between voltage and frequency is given able to read not only voltage, current and resistance — but also other quantities. The usual multimeter will only do this when used as a 'mainframe' in conjunction with 'plug-ins', that convert the input quantity into a form suitable for feeding into the actual meter. This article describes a 'frequency plug-in' that will enable any multimeter (or voltmeter) to read frequencies between 10 Hz and 10 kHz. ■9 ® by: U Rg • Rn • Cs T = 07486(R 1 „TP 1 ) (V/HZ) The circuit values have been chosen to give 1 V per kHz. This means that a 1 0 volt f.s.d. will correspond to 1 0 kHz. Meters with a different full scale deflec- tion, for example 6 volts, can, however, also be used. There are two possibilities: either one uses the existing scale cali- brations to read off frequencies to 6 kHz, or one sets PI to achieve a 6 volt output (i.e. full scale in our example) when the frequency is 1 0 kHz. The latter choice of course implies that every reading will require a little mental gymnastics! With some meters it may be necessary to modify the values of PI and/or R10; the value of R 1 0 + P 1 must however always be greater than 500 £2. The output is buffered by another 3130 (IC3). The circuit is an accurate voltage follower, so that low frequencies can be more easily read off (without loss of accuracy) by setting the multimeter to a lower range (e.g. 1 V f.s.d.). The out- put is protected against short-circuiting by R12. To eliminate the error that would otherwise occur due to the volt- age drop in this resistor, the voltage follower feedback is taken from behind R12. To enable the full 10 volt output to be obtained in spite of the drop in R12 (that has to be compensated by the IC) the meter used should have an internal resistance of at least 5 kohm. This implies a nominal sensitivity of 500 ohm/volt on the 10 volt range. There surely cannot be many meters with a sensitivity lower than that. If one has a separate moving coil milliameter available, it can be fitted with a series resistor that makes its internal resistance up to the value required of a voltmeter giving f.s.d. at 10 volt input. This alternative makes the frequency meter independent of the multimeter, so that it can be used to monitor the output of a generator that for some reason may have a dubious scale- or knob-cali- bration. Construction No trouble is to be anticipated if the analogue fre quency meter elektor december 1977 — 12-03 1 circuit is built up using the PC board layout given in figure 2. Bear in mind that the human body will not necess- arily survive contact with input voltages that may not damage the adequately- rated input blocking capacitor. If one contemplates measuring the frequency of such high voltages the circuit should be assembled in a well-insulated box! The power supply does not need to be regulated, so it can be kept very simple. A transformator secondary of 1 2 volts, a bridge rectifier and a 470 n/25 V A few specifications: frequency range: 10 Hz ... 10 kHz input impedance: > 560 k sensitivity: 50 mV p-p max input voltage: 400 V peak minimum load on output: 5 k (if 10 V out required) reservoir electrolytic will do the job nicely. Although a circuit that draws 25 mA is not too well suited to battery supply, one may need or wish to do this. In this case the battery should be bridged by a low-leakage (e.g. tantalum) 10 m/ 25V capacitor to provide a low AC source impedance. Figure 1. The input frequency is passed via a comparator (limiter) IC1 to a frequency-to- voltage converter (IC2, 4151), that delivers a DC voltage via buffer IC3 to a normal multimeter. Figure 2. Printed circuit board and com- ponent layout for the frequency 'add-on' (EPS 9869). Parts list for figures 1 and 2. Resistors: R1 = 560 k R2 = 10 M R3,R4,R12 = 2k2 R5,R6,R8 = 10 k R7 = 4k7 R9 = 6k8 R10 = 5k6 R 1 1 = 100 k PI = 1 0 k preset Capacitors: Cl = 22 n/400 V C2 = 22 n C3 = 3p3 C4.C5 = 10 n C6 = 1 m low leakage C7 = 56 p Semiconductors: D1,D2 = DUS IC1 ,IC3 = 3130 IC2 = 4151 Calibration The calibration can really only be done with an accurate generator (for example the precision timebase featured in Elektor No. 26, June 1977). A 1 0 kHz signal is fed to the input and P 1 is set to bring the multimeter to full scale deflection (e.g. 10 V). That com- pletes the calibration — although it is wise to check that the circuit is oper- ating correctly by using lower input frequencies and observing whether the meter reading is also (proportionately) lower. M 12-04 — elektor december 1977 sc/mp The majority of the SC/MP registers which are accessible to the programmer were discussed in the previous article (Elektor 31). However there remains an important ‘multi-purpose’ register still to be examined, and that is the status register. Status register (SR) The status register is an 8-bit register which, like the extension register, functions in conjunction with the accumulator (AC). By means of the instruction CSA (copy status to AC), the contents of the status register can be transferred to the AC, whilst the CAS-instruction (copy AC to status) does just the reverse. A second similarity between the status register and the extension register is that in both cases a number of bits are available on external pins. The functions of the various bits of the status register are shown in figure 1. From right to left: bits 0, 1 and 2 are the so-called ‘users flags’ (F0, FI and F2). By means of instructions these flags can be set or reset. For example, the instruction LDIX’02 followed by CAS results in flag 1 being set (i.e. storing ‘1’). This T’ is maintained until the contents of the AC, with a 0 in bit 1 , are once more copied into the status register. Among other things, the three flags can be used in conjunction with a driver stage to directly control various peripherals such as lamps, relays, etc.. Bits 4 and 5 of the status register are the ‘sense’ inputs, i.e. Sense A (SA) and Sense B (SB) respectively. By means of these two inputs information up to two bits long can be transferred to the CPU using the CSA instruction. The contents of bits 4 and 5 are determined exclus- ively by the logic level of pins 17 and 1 8 of the SC/MP. The CAS instruction therefore has no effect upon these two bits. An important function of the sense inputs is to set up programme loops. How this may be done is shown in table 1 . First of all the contents of the status register are transferred to the AC. Then, one bit at a time, the contents of the AC and the byte 00100000 are ANDed together, the result being once more stored in the AC. In the case where SB is ‘1’, the result of the above operation will be 00100000. Thus: (SR) = xxlxxxxx (AC) after CSA = xxlxxxxx AND with = 00100000 (AC) = 00100000 (x = don’t care) If SB is ‘0’ however, then the contents of the AC are also zero and a jump is performed to LABEL 1. The byte 00100000 or X'20 is a ‘mask’, its function being to sift out the non- relevant bits. The above type of oper- ation is a typical example of ‘bit- handling’, i.e. the manipulation of single bits. Further examples of bit handling are: • setting a particular bit of a byte and leaving the rest unaltered: CSA xxxxxxxx ORIX'04 00000100 CAS xxxxxlxx (x = don’t care, but in this case also unchanged!) • erasing one bit and leaving the rest unaltered: CSA XXXXXXXX ANI X'FB 11111011 CAS XXXXX0XX • inverting a bit and leaving the rest unaltered: CSA XXXXXXXX XRI X'08 00001000 CAS xxxxxxxx In addition to being a sense input, SA can also function as an interrupt input. This is the case when bit 3 of the SR, the interrupt enable flag, is T’. This flag can be set and reset by the instructions IEN (enable interrupt) and DINT (disable interrupt). The interrupt fa- cility will be examined in greater detail at a later stage. Bits 6 and 7 of the status register have an arithmetical function. Bit 7, the carry/link bit, is automatically set during all arithmetical manipulations as soon as there is a 1 -carry from bit 7 of the AC. For example: 1 0000000 or X’80 or —128 J0000000 X’80 -128 100000000 X’ 1 00 -256 In this case the carry/link bit indicates whether the result is negative or not. If there is no carry from bit 7, then the carry/link bit is reset. The CY/L bit can Among the topics discussed in this second part of the series on the SC/MP microprocessor are pro- gramming techniques, the SC/MP status register and address decoders. In addition a CPU card is described, which is designed to accomodate both the CPU itself and future 'monitor software'. H. Huschitt sc/mp elektor december 1977 — 12-05 Table 1. CSA transfer (SR) to AC ANI X’20 AND the contents of AC JZ LABEL 1 and 00100000 If (SB) = 0 jump to LD. label 1 If (SB) = 1 continue programme 2 BREQ i r 1 ^ 05 1 ADDRESS VALID mm in i\mm mm'y/ssjm DATA INPUT nRflfl DRP17 I/O STATUS W/A V//////////77777A I/O STATUS 1 DATA OUTPUT V////z NADS i — r ' 1 r/ss* 3rd State be regarded as an extension to the left of the AC. In all arithmetical instruc- tions the ‘content’ of the CY/L bit is added to the contents of the AC. The CY/L bit is set/reset by means of the instructions SCL (set carry/link) and CCL (clear carry/link). In the case of the instructions RRL (rotate right with link) and SRL (shift right with link), the CY/L functions as bit 8 of the AC. Finally, bit 6 of the status register is the overflow bit (OV) which is automati- cally set as soon as there is a carry from bit 6 to bit 7 of the AC, and is reset in the absence of this carry. The overflow bit can be used to prevent calculational errors in the CPU. A good example is the addition of two positive numbers where the result might other- wise appear negative: 01000000 or X'40 or 64 01000000 X'40 64 + 10000000 X' 80 -128 I/O status on the data bus In order to address a 64 k memory at least 1 6 address bits are necessary. However, as many readers have prob- ably realised, the SC/MP has only 12 address lines. The remaining four bits are in fact multiplexed on the data bus. During the NADS (negative address strobe), high-order address and status information, not data, is present on the 8-bit data bus. Table 2 shows how the 4 most significant address bits along with 4 status bits are multiplexed on the data bus, and figure 2 shows how the SC/MP controls the timing of the data input and output. The address infor- mation is only present on the data bus for a short period. To be able to address a memory (which is larger than 4 k) in this way it is obvious that this address information must be stored in an exter- nal register. The remaining four data bits which are available during the NADS are utilised as flags. The R-flag is ‘1* when a read cycle is executed, and ‘0’ for a write cycle. When the I-flag is * 1 ’ it signifies that the first byte of an instruction is being fetched. When the D-flag is ‘1’ it indi- cates the fetch of the second byte of a delay instruction. Finally a ‘1’ on the Il-flag denotes the execution of a halt instruction. Page structure of the memory Neither the programme counter nor the pointers have an automatic carry from bit 11 (the 12th bit) to bit 12. This means that when the counter reaches X0FFF it increments not to X'1000, but to X'0000. In practice the next instruction is therefore fetched from address X’0000. The same holds true for the pointers. If e.g., the address X'5FF0 is stored in PTR1, then the instruction ST IF (1) will not store the (AC) at address X'600F (even though X' 5FF0 + X' IF = X'600F), but instead at address X' 500F. This also applies to auto-indexed addressing. The four most significant bits of the PTRs and PC can only be altered by the instructions XPAH and XPPC. The Table 2. DB 0 - AD 12 DB 1 - AD 13 DB 2 — AD 14 DB 3 - AD 15 DB 4 - R-Flag DB 5 - 1-Flag DB 6 — D-Flag DB 7 - H-Flag Figure 1. Diagram showing the function of each bit of the status register and their pin connections. Figure 2. SC/MP data in- and output timing. Table 1. Specimen programme for testing a sense-bit. Table 2. During the NADS the 4 most signifi- cant address bits along with 4 status bits are loaded onto the data bus in the following manner. 12-06 — elektor december 1977 sc/mp contents of these four bits form the ‘page-address’ of the memory. A section of memory, the addresses of which stretch from X000 up to and including xFFF, is called a page. The SC/MP is unable to ‘turn’ these pages by itself. Once it has read a page it will simply begin to read the same page again. An advantage of this type of page division is that a faulty programme occurring on one page cannot affect the information stored on the next. By means of the instructions WPAH and XPPC the pro- grammer can reference the entire memory, which consists of 16 pages in all. Address decoding and memory structure A characteristic feature of computer structure is that each location in mem- ory and each peripheral is uniquely identified by its specific address. Thus both peripherals and memory locations require an element which will recognise this address, i.e. an address decoder. Memory chips such as RAMs and PROMs already contain an integrated address decoder. Thus the MM 2112 has an 8-bit to 1 of 256 decoder, i.e. from 8 bits of address information it can decode 256 addresses. Since the MM 21 12 has 4-bit locations, two ICs are connected with the address inputs in parallel, in order to be able to process 8-bit data. The result is a 256 x 8 RAM. Memory ICs are equipped with a CE (chip enable) or a CS (chip select) input. When this input is ‘1’, the chip will not access data, despite address information being applied to the address inputs. Only when the input goes ‘0’ will the IC be enabled (since a ‘0’ enables the chip, the input is labelled CE or CS, not CE or CS!). The CE or CS input can be controlled via an address decoder by the higher address bits. Figure 3 shows how address bits 8, 9 and 10 determine which of the 8 RAMs is addressed. The address decoder also possesses a CE input, thus permitting the use of more than one decoder. Of course, not only RAMs, but also peripheral units such as the LEDs described in the previous article, can be addressed. If, however, the LEDs are required to respond to a single address, the help of an 8 by 1 to 256 decoder is needed. If the LEDs are addressed solely by the higher address bits (via the address decoder) then this is known as ‘incomplete address decoding’. From a software point of view, this can save instructions, since the ‘low’ byte does not need to be loaded by the appropri- ate pointers. CPU card The CPU card replaces the exper- imenter’s board of the previous article; what the card contains is shown in figure 4. First of all of course, there is the CPU itself, ie. the SC/MP chip. In future the number of memory chips and peripheral units will be so large that the address outputs of the SC/MP will be unable to drive them all. For this reason the address outputs are equipped with tri- state buffers. The analogue switches which were used in part 1 are here replaced by ‘proper’ tri-state buffers. This is because these switches have a certain transfer resistance, considerably limiting the fan-out. Thus they are unsuitable in a situation where a large amount of memory and peripheral units Figure 3. This figure provides an example of the use of address decoders. In this case 8 RAMs, each 256 x 8 bits, can be fully ad- dressed by 11 address bits via a 3 to 1-of-8 decoder. Figure 4. The circuit diagram of the CPU card. 3 DATA bits 12-08 — elektor december 1977 sc/mp 4a NWDS— d O w O t NRDS — -|T 39]— NADS a— NENIN — *-{T sc/mp n m XOUT — — « - nenout-HZ m X IN — C >— NBREQ —Cl 36]— AD11 NHOLD — {I ISP_ 35 I— AD 10 NRST— {7 BA/6CJO Ti] — AD 09 CONT — 0E 3 } -«• AD 08 DB7 — {T 32 ]— AD 07 DB6 -—{jo ID— AD 06 DB5 --GI 3oI— AD 05 DB4 — GZ ‘ 29 )— AD 04 DB3 — d 25 } AD 03 DB2 --d H} - AD 02 DB1 — d 26]— AD01 DB0 -../Ts 25 ]— •- AD 00 SENSE A -d 13— SIN SENSE B — d ID— SOUT FLAG 0 — d 22]— FLAG 2 GND H Ti}— FLAG 1 9857.11 are linked to the address bus. | mum pin-compatibility A 74125 contains four buffers. IC9 . . . IC1 1 are used to buffer address bits 00... 11. Address bits 12... 15 are multiplexed on the data bus during the NADS and stored on four flip-flops (IC14). The outputs of these flip-flops can be put on the address bus via IC13 and IC1 2. Gates N4 and N6 together with Cl and R2 ensure that when the supply voltage is switched on the NRST input of the SC/MP is momentarily enabled. The SC/MP then begins to run the pro- gramme by jumping to address 0001 . IC4 and IC5 together form a second 256 x 8 RAM. IC2 and IC3 are EPROMs which are addressed via an address decoder IC1. These two PROMs, each 512 x 8, together form a 1 k memory in which the monitor software is stored. ‘Monitor’ is generally understood to mean a programme designed to conside- ably facilitate various chores such as programme loading, debugging etc.. The subject of monitor programmes will be examined in detail in a later article. with other commonly available SC/MP CPU cards (National ISP-8C/100 (E)). The board has sufficient space to accomodate all the components shown in the circuit of figure 4. However at this stage it is not yet necessary to mount all of these components on the board. The RAMs and PROMs for example can be temporarily omitted, as can the address decoder IC1. Until this 1C becomes necessary the 74155 of the RAM I/O card, which has become redundant, may be used instead. As yet, the tri-state buffers are not absolutely necessary either; however since they require through connections to be made on the board they are best mounted immediately. It is important to use good quality IC sockets and to ensure good solder connections, since tracing a faulty contact is no easy matter. The pin configuration of the connector is shown in figure 7, and the connec- tions to the RAM I/O card are shown in figure 8. A separate supply voltage is needed for the PROMs, making a total of three in all: -7, -12 and +5 V. Entering a pro- gramme into PROMs is a subject apart and will be dealt with at a later stage. CPU printed circuit board and construction A double-sided board (see figures 5 and 6) was designed for the CPU card, thereby reducing to a minimum the number of wire links required. All connections to and from the CPU card are brought out via a connector to DIN standard 41612, type C64. Both the wiring arrangement and the connector type were chosen with a view to opti- SC/MP II and the p.c. board So far, the description has been based on the original SC/MP chip ISP-8A/ 500D (PMOS). As noted in part 1 of this series, however, a more recent version also exists: the SC/MP II (ISP- 8A/600). This NMOS version has several advantages over its PMOS pre- decessor, and is basically compatible. The differences with respect to the older SC/MP are arrowed in figure 4a: • SC/MP II uses a +5 V supply: *+’ to pin 40, ‘0’ to pin 20 (GND). Note that the connections shown in figure 4 apply to the original version of the SC/MP, not to SC/MP II! 4b Figure 4a. SC/MP II is basically pin-compat- ible with SC/MP I. The differences are arrowed in this figure. Figure 4b. A slightly more complicated timing circuit is required for SC/MP II, as shown here. Note that a 2 MHz crystal is now required! Figure 5. The copper layout of the printed circuit board for the CPU. Figure 6. The component layout of the p.c.b. for the CPU. sc/mp elektor december 1977 — 12-09 r - V/V R - QOOOOOOOOOOOQQO. ■OOOOOOOO/f’.OOOOOOO.O .00000000 .noooooo. oooooooo. oooooooo Si 1^* — \rV|)~-' j \ O OUOOC TCr W OO U O O 1 *00 00 00 00* ' ~ / _/ / / 1 si j ' 0 0000 0 00000 mnm 9851a Parts list to figures 4 and 6 Resistors: R1 ,R2 = 4k7 Capacitors: Cl = 10 p/6.3 V C2 . C5 = 1 00 n Semiconductors: IC1 = 74155 IC2.IC3 = MM 5204 (National) IC4.IC5 = MM 21 12 (National) or equiv. IC6 = 4049 IC7 = 7437 IC8 = ISP-8 A/500 D (SC/MP) IC9 . . . IC1 2 = 74125 IC13 = 4050 I Cl 4 = 4042 Miscellaneous: Xtal = 1 MHz crystal Modifications when using SC/MP II: R600A = 100 k R600B = 1 k C600 = 56 p IC8 = ISP-8A/600 (SC/MP II) Xtal = 2 MHz crystal 12-10 — elektor december 1977 • ‘ENIN’, ‘ENOUT’ and ‘BREQ’ (pins 3, 4 and 5) are inverted in SC/MP II, becoming ‘NENIN’, ‘NENOUT’ and ‘NBREQ’ respectively. For the SC/MP, ENIN is connected to +5 V via the connector; for SC/MP II, NENIN is connected to supply common via the connector (see figure 8). (N)ENOUT is not used, so the fact that it is inverted is un- important. Since BREQ is inverted in SC/MP II, inverter N3 in figure 4 becomes redundant; pin 5 of IC8 is connected direct to the input of N2 and via R 1 to +5 V (not -7 V!). • The timing circuit for the SC/MP II is slightly more complicated than for the original SC/MP. As shown in figure 4b, a 2 MHz crystal is used for SC/MP II; a 100 k resistor (R600A) is added in parallel with the crystal; and an RC-filter network is added: R600B = 1 k and C600 = 56 p. Note that these values differ from early National Semiconductor infor- mation. Further preliminary information on SC/MP II is given in the National Semi- conductor data sheet no. 426305290- 001 A. The printed circuit board is suitable for both SC/MP and SC/MP II. Photo 1 shows the board with SC/MP II mounted; photo 2 is a close-up of the section where modifications are re- quired if the older SC/MP is to be used. For the SC/MP (ISP-8 A/5 00D), C600 and R600A are omitted; R600B is replaced by a wire link; the two other wire links are mounted in the position labelled ‘500’; a 1 MHz crystal is used; ENIN (pin 11A of the connector) is connected to +5 V; pin 28 A of the connector is connected to -7 V. For SC/MP II (ISP-8A/600), C600, R600A and R600B are mounted; the wire links are mounted in position ‘600’ (see photo 2); a 2 MHz crystal is used; NENIN is connected to supply com- mon; pin 28 A of the connector is connected to +5 V. Provision is made on an extension board that is to be published next month for selecting either a +5 V or a 7 V supply for pin 28A of the connector. Software However great his knowledge of com- puter circuitry or hardware, the pro- spective microprocessor user must be able to ‘speak’ a computer language in order to be able to communicate with the machine. Since the task of actually writing a programme represents by far the most difficult problem with which the user will be faced, a good deal of space will be devoted to the question of programming skills. Writing a programme is considerably simplified if the problem is approached in the following systematic fashion: • problem definition • hardware concept • flow-diagram • source programme • machine programme • programme test At every stage it is important to have a clear grasp of the problem to be solved and all the various factors which need to be taken into account (i.e. the problem) must be precisely defined. Once this has been done it is possible to calculate the amount of hardware which will be required; how much and what type of memory (RAM or PROM) is needed, what peripherals should be used (AD, DA- converters etc.), and so on. The flow-diagram represents a rough draft of the programme and provides an overview of the sequence in which the various programme steps will be executed. A flow-diagram is in fact simply a block diagram of a programme. The significance of the various block symbols is shown in figure 9. Having compiled a flow-diagram the rest is basically routine work. The flow- diagram is replaced by a source pro- gramme written in one of the various programming languages. The lowest level language used for this purpose is assembler language, in which each machine task is represented by a mnemonic abbreviation. When using an assembler language the programmer must be familiar with the machine structure. Figure 7. The pin configuration of the con- Figure 8. This diagram shows the connections between the CPU- and RAM-l/O-card. Photo 1 . The complete CPU card. Photo 2. Close-up of a section of the CPU card, showing the components and wire links required when mounting SC/MP II. sc/mp elektor december 1977 — 12-11 12V — 7 V(+5V) connector pins 12 V L — _ — (+5V)— 7 V CERAM 29C + 5V NWDS+ NRDS^ NHOLD (NENIN)ENIN 7] — AD10 2 ’ C Q CARD ENABLE SC/MPI sc/Mpn [) RAM - I/O CPU - CAPO NRST g cont g NADS ) 1 NRST || CONT [)nads [S NWDS The indications shown in brackets are valid for SC/MP II wire link wire link +5 m "" "" , NHOLO^J • *K^N 3890 09FF.X* ’ R now ■ wai-r-.-y - DBOOOvl DB92>V V DB04^. DB06 CONT-^* SA-^t SIN-*,. F2 — * l-^» ENOUT (NENOUT) ■*”# AD 14-^3 AD 12'^» AD18>»* AD 08' AD 06 -V® AD 04 AD 02 AD 00 NWDS + NRDS '* OAOO^OBFF''/’!* CE RAM ' S* CARDEN NRDS / — +5 0690 - 07FF -12 ‘IV NRST *VOBREQ 2^/DB 01 ,,^>B03 <*^>DB05 *«^.DB07 *«rVENIN (NENINi l^-SB It-'SOUT 1 0400 - 05F F NC **"*~NC ;;^'ADi5 rf>--AD 13 i v "AD 11 «VAD 09 C *V/AD07 AO 05 -./> AD 03 ,»>\AD01 **V\ X ' (XIN) it — 7(+5) OCOO -0DFF ^NADS 'nwds ^1 i 9851 - 7 The indications shown in brackets are valid for SC/MP II 12-12 — elektor december 1977 sc/mp This is not the case with higher level languages such as, for example, BASIC. Higher level languages are geared towards the particular class of problem to be solved rather than to the machine. Since the use of higher level languages in a microprocessor requires additional software, i.e. a compiler programme, they involve considerable outlay, and for this reason are not discussed here. The source programme is therefore written in assembler language and then translated into machine code. As was shown in the previous article, this ‘assembly’ simply consists of filling in the operation code for the mnemonic abbreviations and calculating the effec- tive addresses. Finally, when the programme is avail- able in machine language, it can be loaded into memory and tested. Experience has shown that it is ex- tremely rare for a programme to prove ‘good’ on its first run. Indeed tracing and eliminating faults (debugging) usually accounts for a considerable part of the time taken to develop a pro- gramme. An average of something like 4 machine instructions per hour would be considered quite good . . . Helpful programmes The operation of development systems can be considerably simplified by the use of a few special programmes. At this stage a simple programme can assume the function of the address switch. At a later date, the programme for this purpose (see table 3) will, in a more complex form, make up part of the monitor software. This programme must, naturally enough, itself be loaded into the RAM by the now conventional method of using the address switches. Once the programme has been loaded, and the NRST- and then the Halt-reset- switches have been depressed, the following takes place: The PC makes two jumps to the address 00EB. The higher byte of pointer 1 is loaded with the address of the data switch (02xx). PTR2 (H) is loaded with the address of the LEDs. PTR3 assumes the function of the address switch and thus addresses the RAM. For this reason both the higher and lower bytes of this pointer must be set. The programme which is written into the RAM by the load subroutine is the ‘user’s programme’. This user’s pro- gramme normally commences at address 0000 with the NOP instruction. The lower byte of PTR3 is therefore loaded with 00. The following instructions from the load subroutine both store the ‘state’ of the data switch (08) in the address indicated by PTR3 (0000) and also display it on the LEDs. PTR3 is then automatically incremented and therefore indicates the next address ( 0001 ). Tabla 3. START = 0000 00(30 08 NOP 0001 907 F JMP7F • ; jump 0082 9067 LOADER: • JMP LOADER ; jump again to LOADER O0EB C402 LDI H (SB) ; load PTR 1 with address of DS 00ED 35 XPAH 1 00EE C401 LDI H (LED) ; load PTR 2 with address of LEDs O0FO 36 XPAH 2 O0F1 C400 LDI L (ADR) ; load PTR 3 with initial address 00F3 33 XPAL3 ; of programme to be loaded O0F4 C400 LDI H (ADR) 00F6 37 LOOP: XPAH 3 O0F7 C100 LD0 (1) ; load (DS) O0F9 CA0O ST0 (2) ; and store in LEDs O0FB CF01 ST@1 (3) ; store in address 00FD 00 HALT ; increment PTR 3 00FE 90F7 JMP LOOP * END ; back to LOOP sc/mp elektor december 1977 - 12-13 The CPU is now stopped. By means of the data switch the data for the next memory location of the user’s programme can be set. Pressing the halt-reset switch once more results in this data automatically being read into the RAM. Only when the entire user’s programme has been loaded in this way should the NRST switch be again pressed. Then (after a halt-reset) the user’s pro- gramme will be executed by the CPU. At this stage the use of a load pro- gramme is only worthwhile if the user’s programme is substantially longer than the loader, since the latter must first be j written into the RAM. It is a natural step to store such programmes in a PROM since then they need not be continually reread. More about this later. Calculate- address-programme Translating a programme from as- sembler- to machine language involves, among other things, calculating effective addresses (EA). Naturally enough it would be nice if this task could be performed by the SC/MP itself, and, not surprisingly, this it can do. Calculating effective addresses is for the most part simply a question of deter- mining the difference between two 4- digit hexadecimal numbers. The SC/MP, like many other microprocessors, can- not calculate the difference between two numbers directly, but requires the assistance of an ‘add’ instruction. The instructions recognised by the SC/MP for this purpose are: CAD (complement and add), CAI (complement and add immediate) and CAE (complement and add extension). These instructions will result only in the complement (all bits are inverted) of the addressed data being added to the con- tents of the AC, which of course does not give the difference of the two numbers. In order to obtain a difference the two’s complement of the appro- priate number is needed. As is well known, the two’s complement can be obtained by adding a ‘1’ to the one’s complement. It was stated earlier in the article that during all arithmetical manipulation of data the ‘contents’ of the CY/L bit are also added to the AC. This fact can be utilised by preceding a complement instruction with an SCL instruction (set carry link), so that the contents of the CY/L appear as a number 0001, which will be added to the contents of the AC. In this way it is possible to obtain the two’s comp- lement of a number and therefore the difference between it and a second number. For example: X'55 — X’03 = X 52 01010101 11111100 (one’s complement of 03) 00000001 (contents of CY/L) + 01010010 The 1 -carry from the most significant bit is once more stored in CY/L, since it may be required in multi-bit calculations such as the following: X' 5555 - X'0003 = X' 5552 The lower bytes are handled in the same way as the previous example. The higher bytes are manipulated as follows: 01010101 11111111 (one’s complement of 00) 00000001 (carry from lower byte in CY/L) + 01010101 In the case of both 8- and 16-bit num- bers the two’s complement is obtained by adding one to the one’s complement. For this reason, even with 2-byte numbers only the first complement instruction is preceded by an SCL instruction. If CY/L remains set for the higher byte operation this means there has been a carry from the lower byte. So much for how the SC/MP actually performs the arithmetical operations; however, it is of course necessary to enter the addresses from which the difference is to be calculated. Table 4 shows the sequence in which the first four bytes are read from the data switch, and in which order the entered data and the resulting difference are read into a section of the RAM. This table introduces two commonly used terms in micro-programming, namely minuend and subtrahend. Minuend is the number from which the subtraction is made, and subtrahend is the number which is being subtracted. Figure 10 shows the flow-diagram for the calcu- late-programme, and the same pro- gramme is listed in machine- and assembler-language in table 5. After the start instruction PTR1 and PTR2 are loaded with the address of DS and LEDs respectively. PTR3 is used to address the RAM. The function of a ‘software counter’ may as yet be a little unfamiliar. This type of counter is used to cause a specific subroutine to be repeated a predetermined number of times. In this case the load programme is executed a total of 4 times, since 4 bytes are to be entered into the RAM. In actual fact a software counter is nothing more than a location in the RAM reserved for this purpose, which is loaded with 04. Each time the load programme has been executed the counter is decremented by one, and when the counter reaches 00 the main programme is continued. 10 12-14 — elektor december 1977 K/mp Table 5. START = 0000 0000 08 NOP 0001 C402 LDI 02 ; load PTR 1 with address of DS 0003 35 XPAH 1 0004 C401 LDI 01 ; load PTR 2 with address of LEDs 0006 36 XPAH 2 NEXT: 0007 C43F LDI L (RAM) 0009 33 XPAL3 ; load PTR 3 with address of RAM 000A C400 LDI H (RAM) 000 c 37 XPAH 3 000 D C404 LDI 04 ; load counter with 04 000F C82E ST COUNTER LDDS: ; label for load programme 0011 C100 LD0 (1) ; load DS 0013 CA00 ST0 (2) ; and store in LEDs 0015 CF01 ST@1 (3) ; and store in RAM 0017 00 HALT 0018 B825 DLD COUNTER ; decrement counter 001 A 9CF5 JNZ LD DS ; if counter + 00 fetch following byte from DS SUBTR: 001C C7FC LD@-4 (31 ; reload PTR 3 with address of RAM 001 E 0402 LDI 02 0020 C81D ST COUNTER ; load counter with 02 0022 03 SCL ; set carry /link fot two's complement NEXTBV: 0023 C701 LD@1 (3) ; load minuend 0025 FB01 CAD 1 (3) ; complement subtrahend and add 0027 CB03 ST 3 (3) write difference in RAM 0029 B814 DLD COUNTER 002 B 9CF6 JNZ NEXTBY ; if counter = 00 continue 002 D C402 LDI 02 002F C80E ST COUNTER ; load counter with 02 0031 C702 LD 2 (3) ; load address of diff. byte 1 into PTR 3 NEXTDI: label for next diff. byte 0033 C701 LD @ 1 (3) ; load difference byte 0035 CA 00 ST 0 (2) ; and store in LEDs 0037 00 HALT 0038 B805 DLD COUNTER 003 A 9CF7 JNZ NEXTDI ; if counter = 00 go to 0O3C 90C9 JMP NEXT ; next entry COUNTER * Byte ; reserve a byte for software counter RAM * END ; section of RAM for entry PTR3 is once more loaded with the RAM address (003F), and the counter is now loaded with 02. The following section of the programme is the calculate-difference routine and this has to be executed twice, once for the lower byte and once for the higher byte. When that is completed the counter is once more loaded with 02, since the calcu- lated differences must be displayed in turn by the LEDs; first the lower byte and then the higher byte. The ‘display routine’ must therefore be executed twice. When the counter reaches 00, fresh data can once more be written into the RAM. Actually running the entire calculate- address-prograinme is a simple matter. Once the programme as shown in table 5 has been loaded into the RAM the NRST is operated. The first byte is then entered on the data switch. A single operation of the halt-reset switch results in the byte being written into the RAM. The first byte is always the lower byte of the minuend (see table 4). Once the four bytes have been loaded, operating the halt-reset switch a fifth time will cause the lower byte of the difference to be displayed by the LEDs. Pressing the halt-reset a final time results in the higher byte of the differ- ence being displayed. This programme also suffers from the disadavantage that it must of course first be written into the RAM. This is a time-consuming exercise which is only worthwhile if a large number of addresses have to be calculated. In the course of time this programme will naturally be written into a PROM, but everything which is eventually stored in ROM or PROM must first be tested in RAM. (to be continued) Table 5. The listing of the calculate-address programme. djolly djingle djenerator elektor decern ber 1977 — 12-15 The circuit produces a tone of frequency f, where f is given by: f 1 being a fixed master frequency and n a small whole number (max. about 12), that varies at random. The basic idea is that tones whose frequencies are related by small whole-number ratios are musically more or less related; so that a succession of such tones may claim to be a melody. After all, it is well known that three tones in the frequency-ratio 4:5:6 form a major chord. Now, after fair warning, comes the ‘how it is done’. The principle Let us start with the block diagram of figure 1. The astable multivibrator AMV 1 de- livers a square wave of amplitude ui and constant (but adjustable) frequency ft . This drives a ‘diode-transistor-pump’ that produces a staircase waveform with a fairly small number of ‘steps’. Each step of the staircase wave of course lasts for one period of the signal from AMV 1 . The multivibrator has a ‘sync’ feedback from the staircase generator, to ensure that each staircase produced lasts a whole number of AMV 1 periods. The staircase wave therefore has a fre- quency n being the number of steps. The trick is now to make the number of steps depend on a control voltage, u c , that is derived from the staircase wave itself. This is achieved by having a sample-and-hold subcircuit select, from time to time, a random step and remem- ber its voltage level. The voltage level is buffered, delayed by an RC time con- stant and then fed back to the diode- transistor-pump as the control voltage uc. The command to take a sample is given by a second astable generator, consisting of a slow free-running multivibrator AMV 2 followed by a monoflop as pulse-shaper. normally offered by regular broad- cast transmitters. It offers the limit in meaningless programming that nonetheless will remain uniquely recognisable (!). It produces an endless succession of little squeaky melodies designed to drive anyone with normal mental processes straight up the wall. One might consider the circuit as a descendent of the 'donkey synthesizer' from the sixties. We can report that it has been quite successfully used to blackmail a thick-skinned neighbour into setting his fi less hi. . . . For those to whom nothing is too terrible — the output from the slow multivibrator AMV 2 can be used to frequency modulate AMV 1 . This prod- uces a ghastly vibrato effect . . . The staircase wave can be taken directly as output signal. A rather less squeaky and more flute-like, even neo-musical, result can however be obtained by first passing the output through a sine-shaper. Figure 2 gives a resume of the above description in the form of a set of vol- tage waveforms. The complete circuit Figure 3 gives the complete circuit diagram. The two astable multivibrators are built up using standard NAND gates. N1 and N2, together with their associ- ated components, form AMV 1 that is responsible for generating the master frequency fi . N3, N4, R3, P3 and C4 make up the slow multivibrator AMV 2. Potentiometer PI sets the degree of frequency modulation of fi (i.e. the vibrato). The diode-transistor-pump is built up around D1 and T2. Each rectangular pulse from the output of N2 causes a small charge to be delivered to C3, so that a ‘down-going’ staircase waveform will appear at T2 collector. This will continue until the drive through the NANDs N5 and N6 saturates T3. When that happens, C3 will discharge to the zener-voltage of D2 (2.7 V), starting a new staircase wave. The negative pulse that saturates T3 also momentarily cuts off N2, synchronising AMV 1 to the diode-transistor-pump. The number of steps is determined by the control voltage u c . The higher this voltage, the higher will be the gain of T1 — and therefore the greater will be the voltage jump between the steps. The greater this jump, the earlier the total ‘height’ of the staircase will be covered — the following staircase wave will therefore start after a smaller number of steps. Figure 4 shows what actually goes on. The control voltage u c comes from the sample-and-hold circuit built up around the FETs T4, T5 and T6. T4 is a source- 12-16 — elektor december 1977 djolly djingle djenerator n sync Figure 1. Block diagram of 'DJDJDJ'. At regular intervals, the sample-and-hold circuit stores the instantaneous value of the staircase voltage u s . The held voltage is then passed through a buffer, to control the number of steps in the staircase wave produced by the diode-transistor-pump. Figure 2. The relationships in time between the various voltages. After each sampling the control voltage u c is held to the sampled instantaneous value of u s . The new value of u c (in this illustration) reduces the number of steps from six to four, corresponding toa 1)4 fold increase in output frequency. Figure 3. The complete circuit diagram of 'DJDJDJ'. Figure 4. Illustrating how the greater voltage- jump between successive steps leads to fewer steps per completed staircase. djolly djingle djenerator elektor december 1977 — 12-17 Parts list Resistors R1.R7 = 1 k R2 = 15 k R3.R4.R10 = 22 k R5,R8,R1 2 = 4k7 R9 = 470 k R11 = 100 n R6, R15= 100 k R13 = 1 M R14 = 10 M P1.P2 = 100 k lin. P3 = 220 k lin. P4 = 22 k lin. Capacitors Cl ,C5,C8 = 3n3 C2 = 680 p C3 = 1 n C4 = 1p5/16 V C6 = 100 n C7 = 470 p/10 V C9 - 1 00 p CIO = 1 0p/16 V Semiconductors D1 = 1N4148 D2 = zener 2V7 T1 ,T2 = BC 547 T3 = BC 557 T4.T5.T6 = E 300 IC1 ,IC2 = 401 1 follower, to provide a low-impedance driving point. Each time T5 is driven into conduction by a short pulse, the ‘memory’ element C6 will charge or discharge to the instantaneous value of the staircase voltage u s . C6 will hold this value until the next sample- command pulse to switch T5 causes it to assume another instantaneous value. The command pulses to the gate of T5 are derived from the slow multivibrator AMV 2, with monoflop N7/R6/C5 en- suring that they are sufficiently narrow. P3 provides an adjustment of the ‘nervousness’ of the final sound, by controlling the rate at which the indi- vidual tones succeed one other. The voltage on C6 is buffered by another source-follower (T6) and taken to the control-voltage input of the diode-tran- sistor-pump. The setting of potentio- meter P4 determines the average jump in frequency from one tone to the next. The output signal can be taken directly from T4 source, with switch S in the upper position; or from the shaper circuit around N8 (used as analogue buffer), that operates as a simple band- pass filter. The output obtained in the lower position of S is more like a sine- wave - and certainly more pleasant to listen to. Practical aspects The individual constructor may decide whether the potentiometers should be presets or normal ‘knobs’. All of them affect the final sound, of course: P2 sets the range of frequencies covered by the ‘melody’. P3 and P4 both affect the rates at which the tones (if you must: ‘notes’) (appear to) suc- ceed one another. P3 also affects the frequency of the ‘vibrato’ effect and PI its depth. It is probably a good idea to use a preset for P3, adjusting the modu- lation frequency to 6 Hz. A gadget like this music-generator-to- end-all-music deserves a suitable ‘make- up’. One attractive possibility would be to mount the generator proper, together with a simple power amplifier and supply circuit, in an inspiring case — for example a junked transistor radio. One may wish to go back even further into the past, to make a miniature replica of the enormous radio sets from the days of conduction through vacuum. M 12-18 — elektor december 1977 electret microphone preamplifier Microphones frequently have to be connected to amplification and/or recording equipment via several metres of screened cable. Since the output of a microphone is very small (typically a few millivolts) there is often significant signal loss, and microphonic noise may also be generated by the cable. This article describes the construction of a good-quality microphone with built-in preamplifier, using a commercial electret or moving coil capsule. The built-in preamplifier boosts the output level to several hundred millivolts, which allows the signal to be fed direct to the ‘auxiliary’ or ‘line’ inputs of amplifiers or tape decks. If a mixer is being used the need for microphone preamps on each mixer input is dis- pensed with. Readers are probably familiar with the principle of the moving coil, dynamic microphone, which basically operates like a loudspeaker in reverse. A dia- phragm is coupled to a cylindrical coil, which is suspended in the field of a powerful permanent magnet. Sound pressure waves deflect the diaphragm, and hence the coil, which cuts the mag- netic flux lines and generates an output current and voltage that is an electrical analogue of the acoustic signal. The electret microphone, which has become very popular in recent years, operates in a similar manner to a capaci- tor microphone, but is cheaper and less bulky. The diaphragm of the micro- phone is made of the electret material. This is a thin insulating plastic film, which has been polarised with a per- manent electric chrage (this is usually done by heating the film and placing it in a strong electric field). The dia- phragm forms one plate of a capacitor, the other plate of which is a fixed metal backplate. Since the diaphragm is charged a potential difference exists between the diaphragm and the back- plate, which is related to the charge on the diaphragm and the capicitance of the microphone capsule by the equation where U is voltage, Q is charge, and C is capacitance. C is related to the distance between the plates of the This compact, low-noise, battery- powered preamplifier can be used to boost the signal from electret and low impedance dynamic microphones. capacitor by the equation where k is a constant. Therefore When sound pressure waves deflect the diaphragm, the distance d varies, and since the charge Q is fixed the output voltage varies in sympathy with the deflection of the diaphragm. Since the microphone capsule is effec- tively a very small capacitor (only a few pF), its impedance at audio frequencies is extremely high, and its output must be fed to a very high impedance buffer stage. This usually consists of a FET source-follower incorporated into the microphone capsule, which acts as an impedance transformer with an output impedance of a few hundred ohms. Preamplifier Circuit The complete circuit of the microphone preamplifier is given in figure 1. If an electret microphone capsule is used, the built-in FET buffer will require a DC power supply. This will usually be lower than the 9 volts required by the rest of the circuit, so the voltage is dropped by R8 and decoupled by C3. The value of R8 shown is for the Philips LBC 1055/00 microphone cap- sule, and other capsules may require a different value. Resistor R 1 is a load for the FET buffer. Here again, 2k2 is the recommended value for the Philips electret capsule, and different values may be required for other capsules. If a moving coil microphone capsule is used then Rl, R8 and C3 may be omitted. The preamplifier itself consists of a two stage amplifier T1 and T2. Its input impedance is approximately 8 k, and its gain is determined by the ratio R7:R3 — about 1 00 with the values shown. The current consumption of the preamp is extremely low, typically 1.5 mA. With some microphone capsules having a higher output voltage, it may be necessary to reduce the gain of the preamp to prevent overloading. This is done by decreasing the value of R7. To restore the correct DC bias con- electret microphone preamplifier elektor december 1977 — 12-19 ditions it will also be necessary to reduce the value of R6, and this will result in a slight increase in current consumption. However, reducing the value of R7 does lower the output impedance of the preamp, which means that longer cables can be driven without attenuation of high frequency signals. Performance The output voltage of the specified electret capsule is typically 6.3 mV/Pa (‘Pa’ is Pascal; 1 Pascal = 1 N/m 2 = 10jrbar).Toput this figure into context, the threshold of audibility (0 dB SPL) is taken as occurring at a sound pressure level of 0.0002 //bar, and the threshold of pain, 120 dB higher at 200 //bar. However, overloading of the electret capsule begins at around 104dB SPL, so the maximum output voltage that can be expected in normal use is around 20 mV, or 2 V at the preamp output. The frequency response of the specified capsule plus preamp combination is flat within 3 dB from 100 Hz to 17 kHz, which is quite good considering the modest cost of the unit. Construction A printed circuit board and component layout for the microphone preamplifier are given in figure 2. The circuit board is extremely compact, and the micro- phone capsule, board, and a small 9 V battery can easily be fitted into a length of plastic pipe or aluminium tubing. The grille that protects the microphone capsule can be made from half a ‘tea-egg’ infuser, as shown in the photograph, or from a wire mesh coffee strainer. To make a really professional job the output of the preamp can be taken via a Cannon XLR or locking DIN connector socket mounted in the base of the housing. It is then possible to dispense with the on-off switch by making a shorting link in the connector plug perform this function, as shown in figure 3. When the microphone is unplugged after use the preamp is automatically switched off. M n 1.5mA Parts list for figures 1 and 2 Resistors: R1 = 2k2 R2= 10 k R3 = 47 fl R4 = 6k8 R5,R6 = 39 k R7 = 4k7 R8 = 8k2 R9= 120 k Capacitors: C1,C2,C5 = 2p2/40 V C3,C4 = 47 p/25 V Semiconductors: T1 = BC549Cor equivalent T2 = BC 559C or equivalent Miscellaneous: Microphone capsule = Philips LBC 1055/00 or similar 9 V battery SI = SPST switch (see text) Plastic or aluminium tubing for microphone housing. Figure 1. Circuit of the microphone pre- amplifier. Figure 2. Printed circuit board and component layout for the preamplifier (EPS 9866). Figure 3. If the completed microphone is fitted with an output socket then a shorting link can be used to replace SI. Photo. Completed prototype of the electret microphone with built-in preamp, which is housed in a piece of clear acrylic tube for display purposes. 12-20 — elektor december 1977 uhf-tv-modulator We use the term ‘modulator’ as a con- veniently short way to describe a circuit comprising an r.f. oscillator and an amplitude modulator (figure 1). In many simple modulator circuits the oscillator and modulator are but a single transis- tor, the video signal being injected direct into the base of the oscillator transistor to vary the amplitude of oscillation. The disadvantage of this method is that the frequency stability of the oscillator suffers, and phase or frequency modulation can also be introduced, which is apparent as poor picture definition. Ideally, the oscillator output amplitude should remain con- stant, and modulation should be per- formed by feeding the signal through a separate modulator circuit. Many simple TV modulators have an oscillator frequency whose fundamental lies in the VHF band, since these are the highest frequencies that can be ob- tained using conventional construction techniques (wound coils). For reception in the UHF band on which modern TV’s operate, one has to rely on the large harmonic content of the oscillator, which is not an entirely satisfactory sol- ution. A modulator whose fundamental lies in the UHF band has significant advantages over a VHF modulator: • when used with equipment contain- ing logic circuits (pattern generators for example) a UHF modulator is much less prone to spurious interference. • the circuit can be simply constructed using striplines etched on a p.c. board instead of conventional wound induc- tors. • a large number of channels are avail- able in the UHF band, so that even with fairly generous component tolerances the oscillator frequency will still lie in the correct band. The spectrum of a normal amplitude modulated signal consists of the carrier signal and two sidebands, one above and one below the carrier frequency, each occupying a bandwidth equal to the bandwidth of the modulating signal. Thus a signal amplitude modulated with video information having a 5.5MHz Circuits which produce an amplitude modulated VHF or UHF signal from a video input signal have many applications. They allow direct connection to the TV aerial input of such devices as TV games, video biofeedback circuits and test pattern generators, to name but a few. Unfortunately, the performance of most simple modulators leaves much to be desired. However, the circuit described in this article, though extremely simple (one transistor!), offers extremely good performance. bandwidth (standard I), would occupy a channel width of 1 1MHz. However, each of the sidebands contains all the information present in the modu- lating signal, so one of the sidebands is redundant. To allow the maximum number of channels to be packed into the UHF band, the channel width is limited to 8 MHz, and in broadcast TV transmitters this is achieved by the use of a sideband filter, which partially sup- presses the lower sideband to produce the type of spectrum illustrated in figure 2. The lower sideband is not totally sup- pressed, nor is the carrier suppressed as in a true SSB transmission, since this would require a complex SSB demodu- lator in the TV receiver, whereas partial sideband suppression and retention of the carrier allows a simple envelope demodulator to be employed. However, since the modulator described in this article is not intended for broad- cast purposes, but merely as an interface between video signals and the TV set, suppression of the unwanted sideband is not necessary. Perfectly satisfactory results will be obtained by tuning the TV set to the ‘correct’ sideband. The circuit Figure 3 shows the complete circuit of the UHF modulator, which consists of two sections. The UHF oscillator sec- tion is constructed around T1 and strip- line inductors LI and L3. The oscillator frequency may be tuned over the range of approximately 430 MHz to 600 MHz by means of C6. Stripline L2 is inductively coupled to LI and thus picks up part of the UHF signal from the oscillator. Trimmer C7 allows L2 to be tuned to the same frequency as the oscillator. Diode D1 functions as a current con- trolled resistor; in the absence of a video input signal its dynamic forward resist- tance is high. If a positive voltage is applied to the video input then the current through the diode will increase and its dynamic resistance will fall, thus damping the resonant circuit L2/C7 and attenuating the signal developed across L2. With potentiometer PI set to maximum the modulator will saturate at an input voltage of approximately 2 uhf-tv modulator elaktor december 1977 — 12-21 1 when compared with the deviation of normal VHF FM transmissions, but compared to the TV channel width of 8MHz it is quite negligible, and is cer- tainly much less then the spurious FM produced by directly modulated oscil- lators. An A-B comprison will demon- strate this without any shadow of doubt. Construction To achieve good oscillator stability and suppression of harmonics, the stripline must have a high Q-factor, and for this reason the circuit is etched on special low-loss UHF copper laminate board. Home production of the p.c. board is therefore not recommended. A layout for the printed circuit board is given in figure 5, and it should be noted that the components are mounted on the same side of the board as the copper track pattern as shown in photo 2. It is absolutely essential that all component leads should be as short possible, since the inductance of even a few millimetres of wire can be significant at UHF. It should be noted that one important detail could not be made clear on the component layout. The right-hand end of stripline L2 must be connected to supply common, as shown in figure 3. This is achieved by inserting a piece of wire in the hole underneath the coaxial socket, and soldering it to both sides of the p.c. board (see figure 6). It is strongly recommended to do this before mounting the socket! A 75 n BNC or TV coaxial socket can be used as the output connector, and should be mounted directly on the board in the position shown. The com- pleted modulator board should then be mounted in a small metal box, and a ground connection between the circuit and the box must be made only at the output socket. Power Supply Almost any stable 1 5 V supply is suitable for the modulator, and a suggested circuit is given in figure 4. This is a modified version of the power supply for the ’local radio’ described in Elektor 22 (February 1977), and a printed circuit board EPS 9499-2 is available. volts, - and if the video input level is higher than this PI must be used to reduce it accordingly. If a sound-carrier is available (i.e. modu- lated 5.5MHz or 6MHz carrier), the correct modulation depth on the main carrier can be set by means of P2. The output signal is taken from a tap about three-quarters of way down L2. Since the capacitance of diode D1 is voltage dependent, and because the oscillator load varies due to modu- lation, a small amount of spurious frequency modulation will occur. How- ever, this amounts to a frequency deviation of no more than 40kHz/V. This may seem quite a large amount Figure 1. In a good modulator system the oscillator and modulator should be separate circuits. Circuits where the oscillator is modulated directly, produce unacceptable spurious frequency modulation. Figure 2. In a broadcast TV transmission a sideband filter partially suppresses the lower sideband to minimise channel width. How- ever, for normal applications, where the modulator output is being fed direct to a single TV set, this is not necessary. Figure 3. Complete circuit of the UHF modu- lator. LI, L2 and L3 are striplines etched on a printed circuit board. Alignment 1 . The TV set should first be tuned to an unoccupied channel at the low end of the UHF band (between channels 21 and 30). The television aerial is then unplugged and the modulator is con- nected. At this stage there should be no video input to the modulator. 2. Adjust C6 until the carrier wave is picked up, when the screen will darken. 3. Using C6 tune up and down the band to check that it is in fact the carrier that is being up and not some spurious response due to overload of TV tuner. The carrier signal should be much stronger than any spurious signals. Since 12-22 — elektor december 1977 uhf-tv-modulator wins 6V-/ Figure 4. Suggested power supply circuit for the modulator. This can be mounted on the p.c. board EPS 9499-2. Figure 5. Printed circuit board and com- ponent layout for the UHF TV modulator (EPS 9864). Figure 6. Note the (arrowed) connection between the ’cold’ end of L2 and supply common. Photo 1. This spectrum analyser trace illus- trates the purity of the UHF oscillator signal. Photo 2. The completed modulator board. Parts list to figure 3 Resistors: R1 =ioon R2, R3 = 3k9 PI = 1 0 k preset P2 = 1 k preset Capacitors: Cl = 3p3 C2 = 1 50 p C3 = 47 p/25 V C4 = 100 n C5 = 6p8 C6, C7 = trimmer 1 .5 - 5 p Semiconductors: T1 = FETE 310 D1 * 1N4148 Miscellaneous: LI , L2, L3 = striplines on p.c. board. the effect of C6 is quite coarse the final fine tuning to the carrier signal should be carried out with the TV tuning con- trols. As a rough guide C6 should be approximately in its mid-position (vanes half-closed) when the oscillator is tuned somewhere between channels 21 and 30. 4. Set the wiper of PI to its mid-pos- ition and feed in a video signal of a few volts peak-to-peak. Adjust the TV tuning controls until a sharply defined picture is obtained, although at this stage it may not sync properly. 5. Turn down PI until the picture is barely visible, or until it goes out of sync if originally in sync. 6. Adjust C7 for maximum contrast, and finally turn up PI until the desired contrast range is obtained in the picture. This completes the alignment. Performance Photo 1 shows a spectrum analyser trace of the unmodulated carrier signal. The negative marker pulse at the left of the screen is at 360 MHz, whilst just less than one division to the right (at about 500 MHz) the fundamental of the carrier signal can be seen. The horizon- tal scale is 180 MHz/division. The vertical scale is 10 dB/division, with the top of the screen being at —10 dBm with respect to 0 dBm =100 mV. The top of the screen thus represents an amplitude of 70 mV. The second and third harmonics are extremely attenu- ated, about 53 dB below 0 dBm in the case of the second harmonic and 56 dB down in the case of the third harmonic. These figures represent absolute signal levels of around 225 /iV for the second harmonic, and 160 ;uV for the third harmonic. The amplitude of the fundamental is certainly not small; as can be seen from the photograph it extends off the top of the trace beyond the —10 dBm (70 mV) level. Editorial note: FCC regulations prohibit the use of home-built TV modulators in the U.S.A. M jp-tun-dug-dus elektor december 1977 — 12-23 lUFrUUDUIGDUS type Uceo max •c max 1 TUN TUP NPN PNP 20 V 20 V 100 mA 100 mA 100 100 100 mW 100 mW 100 MHz 100 MHz Table la. Minimum specifications for TUP and TUN. Table 2. Various transistor types that meet the TUN specifications. TUN BC 107 BC 208 BC 384 BC 108 BC 209 BC 407 BC 109 BC 237 BC 408 BC 147 BC 238 BC 409 BC 148 BC 239 BC 413 BC 149 BC 317 BC 414 BC 171 BC 318 BC 547 BC 172 BC 319 BC 548 BC 173 BC 347 BC 549 BC 182 BC 348 BC 582 BC 183 BC 349 BC 583 BC 184 BC 382 BC 584 BC 207 BC 383 Table 3. Various transistor types that meet the TUP specifications. TUP BC 157 BC 253 BC 352 BC 158 BC 261 BC 415 BC 177 BC 262 BC 416 BC 178 BC 263 BC 417 BC 204 BC 307 BC 418 BC 205 BC 308 BC 419 BC 206 BC 309 BC 512 BC 212 BC 320 BC 513 BC 213 BC 321 BC 514 BC 214 BC 322 BC 557 BC 251 BC 350 BC 558 BC 252 BC 351 BC 559 The letters after the type number denote the current gain: A: a' 10, h fe ) = 125-260 B: a' * 240-500 C a' = 450-900. Table 1b. Minimum specifications for DUS and DUG. Table 4. Various diodes that meet the DUS or DUG specifications. DUS DUG BA 127 BA 318 OA 85 BA 217 BAX 13 OA 91 BA 218 BAY 61 OA 95 BA 221 1N914 AA 116 BA 222 1N4148 BA 317 Table 5. Minimum specifications for the BC107, -108, -109 and BC177, -178, -179 families (according to the Pro-Electron standard). Note that the BC179 does not necessarily meet the TUP specification 0c,max ■ 50 mA). NPN PNP BC 107 BC 108 ESM Ell lid mm ■hmhb in 100 mA 100 mA max 100 mA 100 mA 100 mA 50 mA 300 mW 300 mW 300 mW 300 mW 300 mW 300 mW F 10 dB 10 dB max 10 dB 10 dB 4 dB 4 dB Wherever possible in Elektor circuits, transis- tors and diodes are simply marked 'TUP* (Transistor, Universal PNP), 'TUN' (Transistor, Universal NPN), 'DUG' (Diode, Universal Ger- manium) or 'DUS' (Diode, Universal Silicon). This indicates that a large group of similar devices can be used, provided they meet the minimum specifications listed in tables la and 1b. Table 6. Various equivalents for the BC107, -108, . . . families. The data are those given by the Pro-Electron standard; individual manu- facturers will sometimes give better specifi- cations for their own products. NPN PNP Case Remarks BC 107 BC 108 BC 109 BC 177 BC 178 BC 179 ■Q t BC 147 BC 148 BC 149 BC 157 BC 158 BC 159 ‘Q Pmax = 250 mW BC 207 BC 208 BC 209 BC 204 BC 205 BC 206 ■© f BC 237 BC 238 BC 239 BC 307 BC 308 BC 309 ■<3 C BC 317 BC 318 BC 319 BC 320 BC 321 BC 322 Of tcmax = 150 mA BC 347 BC 348 BC 349 BC 350 BC 351 BC 352 (B BC 407 BC 408 BC 409 IBC 417 BC 418 IBC 419 Pmax = 250 mW BC 547 BC 548 BC 549 BC 557 BC 558 BC 559 ( 3 Pmax * 500 mW BC 167 BC 168 BC 169 BC 257 BC 258 BC 259 169/259 'cmax = 50 mA BC 171 BC 172 BC 173 BC 251 BC 252 BC 253 251 . . . 253 low noise BC 212 BC 213 BC 214 ■Q 'cmax = 200 mA BC 582 BC 583 BC 584 BC 512 BC 513 BC 514 ■Q ^crnax = 200 mA BC 414 BC 414 BC 414 BC 416 BC 416 BC 416 ’0 low noise BC 413 BC 413 BC 415 BC 415 •0 low noise BC 382 BC 383 BC 384 ■0 BC 437 BC 438 BC 439 ID; Pmax = 220 mW BC 467 BC 468 BC 469 01 Pmax “ 220 mW BC 261 BC 262 BC 263 ■Q low noise Ptot CD max max Si 1 /JA 250 mW 5 pF Ge 100 /LfA 250 mW 10 pF 12-24 — elektor december 1977 index 1977 Audio active loudspeaker crossover filters (1) ... 5-46 active loudspeaker crossover filters (2) . . . 6-37 audio wattmeter 1-28 clipping indicator 7-62 common-base virtual earth mixer 742 complementary twin-T selective filter . . . 7-56 ejektor; active filters for the 'filler-driver' principle 6-35 electret microphone preamp 12-18 from quadro to surround -sound 5-19 hi-fi dynamic range compressor 2-18 1C audio 1 -42 infra-red stereo transmitter 10-22 LED peak indicator 7-70 LED VU/PPM 4-32 loudspeaker delay circuit 7-61 microphone preamp 7-59 monitor switching for two tape decks . . . 9-32 music cleaner 5-43 noise cancelling preamp 7-58 noise generator 1-23 quadi-complimentary complemented .... 1-39 sawtooth generator 2-17 signal powered dynamic compressor 7-27 stereo audio mixer 1-14 stereo encoder 5-26 stereo noise filter 7-25 stereo pan pot 7-35 symmetrical constant-voltage crossover filter 7-42 ir-qualiser 749 4 W car radio amplifier 7-59 15 W bridge amplifier for car audio 7-60 Cars automatic car aerial 7-34 car burglar alarm 7-63 car headlight alarm 7-68 shoo dog! 7-49 4 W car radio amplifier 7-59 15 W bridge amplifier for car audio 7-60 Design ideas AC touchswitch 7-44 CMOS CCO 7-67 compensated light sensor 7-30 complementary emitter follower 7-45 emitter follower with current source .... 244 frequency divider using one TUN 7-33 frequency doubler using 4069 7-39 level shifter 747 non-inverting integrator 7-50 positive-triggered set-reset flip-flop using inverters 7-51 sawtooth CCO 6-31 self-shifting register 7-69 super zener 7-20 transistor solar cell 7-73 using LEDs as reference diodes 7-63 voltage controlled LED brightness 7-62 voltage controlled monostable 7-61 Domestic add-on timer for snooze-alarm-radio- clock 743 albar Mk II - a b.f.s 4-54, 5-52 CMOS alarm circuits 7-53 digibell envelope shaper 6-21 drill speed control 7-76 electronic scarecrow 7-17 electronic weathercock 7-43 fade asleep 7-66 FM mains intercom 9-18 heating control 12-34 ioniser 10-35 multi-purpose time switch 7-18 one-shot for immersion heater 7-37 room thermometer 7-58 telephone 'tell-tale' 746 temperature-voltage converter 7-18 thermostat 7-20 triac relay 7-21 Fun, games, model building levitator 6-30 marbles 1-20 mind-bender 2-47 model speed control 7-25 osculometer 7-67 reaction speed tester 746 run, rabbit, run 3-34 slotless model car track (1) 4-15 slotless model car track (2) 5-30 slotless model car track (3) 6-26 slotless model car track (4) 9-53 slotless model car track (5) 10-26 slotless model car track (6) 11-34 TV games 7-40 wheel of fortune 7-35 Informative articles bi-fet op-amps 1-40 ejektor, more negative feedback with positive 3-20 ejektor, relaxation generator 11-17 elektoracle 1-13 elektorscope in verocase 3-32 fields 11-13 from quadro to surround-sound 5-19 introducing microprocessors (1) 9-16 introducing microprocessors (2) 10-47 negative feedback — how thick to lay it on 3-38 op-amp frequency compensation, the how and the why 5-40 quadi-complimentary complemented .... 1-39 TBA 120T 2-50 the BF 494, a case in point 148 touch contacts 1 0-38 working perspex 9-26 index 1977 elektor december 1977 — 12-25 Microprocessors experimenting with the SC/MP (1 ) 11-02 experimenting with the SC/MP (2) 12-04 introducing microprocessors (1 ) 9-16 introducing microprocessors (2) 10-47 Miscellaneous H IN I L drive for light sequencer 4-45 keyboard decoder 7-68 running light 3-46 simple auto slide changer 4-42 speed controller for motors 7-32 thermal touch switch 7-26 threshold box 7-31 UAA 170 economiser 7-21 ultrasonic receiver 7-48 ultrasonic transmitter for remote control 7-48 16 channel TAPs 2-44 Music djolly djingle djenerator 12-15 formant, the elektor music synthesizer (1 ) 5-14 formant (2) 6-14 formant (3) 9-42 formant (4) 10-40 formant (5) 11-41 formant (6) 12-27 fuzz box 7-52 guitar preamp 7-64 mini-phase 2-31 music box 12-46 phaser 7-54 tremolo 7-26 Paranormal biorhythm calendar 10-32 biorhythm program 10-19 ejektor, relaxation generator 11-17 electrometer 11-14 fields 11-13 impedance variation detector 10-14 ioniser 10-35 kirlian photography 10-05 magnetiser 11-32 poltergeist 11-22 subliminal perception tester 10-16 video biofeedback 11-24 Power supplies automatic charger 7-55 automatic NiCad charger 7-23 high-power inverter using gate turn-off thyristors 3-29 1C power supply 2-26 inverter 7-28 minireg power supply 7-50 multiple voltage supply 7-73 negative supply from positive supply .... 7-57 TTL voltage doubler 7-24 two-TUN voltage doubler 7-23 0 V voltage reference 7-38 0 - 10 V supply 7-28 ± 15 V regulator 7-43 R.F. circuits CMOS PLL 7-66 high-level mixer 7-38 LED tuner 7-69 local radio 2-12 low-noise VHF aerial amplifier 7-24 morse callsign generator 5-41 morse decoder with DDLL (1 ) 3-48 morse decoder with DDLL (2) 4-20 MOSFETSSB adaptor 7-72 MW reflex receiver 1 2-44 RF amplifier with 100 dB dynamic range 7-36 short-wave converter 7-51 stereo encoder 5-26 tuning indicator 7-60 UHF TV modulator 12-20 variometer tuner (1 ) 3-22 variometer tuner (2) 4-46 Test and measuring equipment A/D converter 7-22 analogue frequency meter 12-02 audible logic probe 7-45 audio wattmeter 1 -28 auto trigger level control 7-52 capacitance-frequency converter 7-17 CCIR TV pattern generator (1) 9-33 CCIR TV pattern generator (2) 10-09 CCIR TV pattern generator (3) 11-18 complementary twin-T selective filter . . . 7-56 digisplay on board 4-29 digital capacitance meter with 555 timer 7-39 distortion meter 7-74 distortion suppressor 7-33 eight-channel multiplexer 7-57 elektorscope (2) 1-30 elektorscope (3) 2-32 frequency-voltage converter 7-41 LC resonance meter . 7-76 LED logic flasher 7-53 LED VU/PPM 4-32 noise generator 1-23 ohmmeter 7-70 phasemeter 744 precision timebase for frequency counter 6-22 precision v-f converter 5-29 sawtooth generator 2-17 scope calibrator 3-30 sensitive light meter 12-41 signal injector 4-41, 12-39 simple transistor tester 7-22 spot-frequency sinewave generator 7-30 stylus balance 12-38 temperature-voltage converter 7-18 tri-state voltage comparator 7-47 voltage-frequency converter 7-16 372 digit DVM 7-77 Time, timers, counters add-on timer for snooze-alarm-radio-clock 7-43 knotted handkerchief 7-34, 12-40 logarithmic darkroom timer 9-28 long interval timer 7-16 multi-purpose time switch 7-18 programmable frequency divider 7-37 timebase input circuit 7-27 12-26 — elektor december 1977 transistors V C EO (Volt) l c (ma 0 - <20 o 00 = 25-40 00 000 = 45-60 000 0000 = 65-80 0000 00000 = > 85 00001 . . ^max (mW) 'c(max) not cooled: h| 0 = < 50 ® ^ 300 00 - 56 100 00 - 305-1000 0 000 - 105-400 led 01 0000 - 405 2 A 99* “ 01 OOOOO = i ? A 00*6 = 10-35 W 00000 >2A 00*** = > 40 W W 0 = < 20 00 * 25-50 000 =55-120 0000 « > 1 25 case nr. comments TUN N 0 00 0 ooo TUP P 0 00 0 ooo AC 126 P 0 00 00 oooo 2 AF239 P 0 0 0 0 1 BC107 N 000 00 0 ooo 2 BC108 N 0 00 0 ooo 2 BC109 N 0 00 0 oooo 2 BC140 N 00 0000 00* 00 2 BC141 N 000 0000 00* 00 2 BC160 P 00 0000 00* 00 2 BC161 P 000 0000 00* 00 2 BC182 N 000 000 0 oooo 2 BC212 P 000 000 0 ooo 2 BC646 N 0000 00 00 oooo 2 BC556 P 0000 00 00 ooo 2 BD106 N 00 00000 00** 00 7 BD130 N 000 00000 oo*** 0 7 BD132 P 000 00000 00** 00 9 BD137 N 000 0000 00* 00 9 BD138 P 000 0000 00* 00 9 BD139 N 0000 0000 00* 00 9 BD140 P 0000 0000 00* 00 9 BDY20 N 000 OOOOO 00*** 0 7 BF 180 N 0 0 0 0 1 BF 185 N 0 0 0 00 12 BF 194 N 0 0 0 ooo 10 BF195 N 0 0 0 ooo 10 BF 199 N 00 0 00 ooo 11 BF200 N 0 0 0 00 1 BF254 N 00 0 0 ooo 11 BF267 P 00000 00 00 00 2 BF494 N 0 0 0 ooo 11 BFX34 N 000 OOOOO 00 00 2 BFX89 N 0 0 0 00 1 BFY90 N 0 0 0 00 1 BSX19 N 0 0000 0 ooo 2 BSX20 N 0 0000 0 ooo 2 BSX61 N 000 0000 00 ooo 2 HEP51 P 00 0000 00 ooo 1 HEP53 N 00 0000 00 ooo 1 HEP56 N 0 00 00 ooo 5 MJE171 P 000 00000 00** 00 9 MJE180 N 00 OOOOO 00** 00 9 MJE181 N 000 OOOOO 00** 00 9 MJE340 N 00000 0000 00** 00 9 MPS A05 N ooo 0000 00 00 13 MPS A 06 N 0000 0000 00 00 13 MPS A 09 N 0000 0 00 ooo 13 MPS A10 N 00 00 00 00 13 MPS A13 N 00 000 00 oooo 13 MPS A16 N 00 00 00 oooo 13 MPS A17 N 00 00 00 oooo 13 MPS A18 N 000 000 00 oooo 13 MPS A55 P 000 0000 0 00 13 MPS A 56 P 0000 0000 0 00 13 MPS U01 N 00 00000 00* 00 14 MPS U05 N 000 OOOOO 00* 00 14 MPS U56 P 0000 OOOOO 00* 00 14 MPS2926 N 0 00 00 00 13 MPS3394 N 00 00 00 ooo 13 MPS3702 P 00 000 00 ooo 13 MPS3706 N 0 0000 00 00 13 MPS6514 N 00 00 0 oooo 13 TIP29 N 00 0000 00** 0 3 TIP30 P 00 0000 00** 0 3 TIP31 N 00 OOOOO 00*** 0 3 TIP32 P 00 OOOOO 00*** 0 3 TIP 140 N 000 OOOOO 00*** oooo 7 TIP142 N 00000 OOOOO oo*** oooo 7 TIP2955 P 000 OOOOO 00*** 0 3 TIP3055 N 000 OOOOO 00*** 0 3 TIP5530 P 000 OOOOO 00*** 0 3 2N696 N 000 0000 00 0 2 2N706 N 0 0 0 0 2 2N914 N 0 0000 00 00 2 2N1613 N 000 oooo 00 00 2 2N1711 N 000 0000 00 ooo 2 2N1983 N 00 oooo 00 ooo 2 2N1984 N 00 0000 00 2 2N2219 N 00 oooo 00 00 2 2N2222 N 00 oooo 00 00 2 2N2925 N 00 00 0 oooo 13 2N2955 P 00 00 0 0 2 2N3054 N 000 OOOOO oo*** 00 7 2N30&5 N 000 OOOOO oo*** 0 7 2N3553 N 00 oooo oo* 0 2 2N3568 N 000 oooo 0 ooo 13 2N3638 P 00 oooo 0 ooo 13 2N3702 P 00 000 00 ooo 13 2N3866 N 00 ooo 00* 0 2 2N3904 N 00 000 0 00 13 2N3905 P 00 ooo 00 ooo 13 2N3906 P 00 ooo 00 ooo 13 2N3907 N 000 0 0 ooo 13 2N4123 N 00 ooo 0 00 13 2N4124 N 00 ooo 0 ooo 13 2N4126 P 00 ooo 0 ooo 13 2N4401 N 00 oooo 00 0 13 2N4410 N 0000 ooo 00 ooo 13 2N4427 N 0 ooo 00* 0 2 2N5183 N 0 oooo 00 ooo 2 grounded base f fy = 700 MHz grounded base: grounded base: grounded emitter: grounded emitter: grounded emitter: grounded base: grounded emitter, grounded emitter, grounded emitter: grounded emitter: grounded emitter: fy* 675 MHz fy= 220 MHz fy = 260 MHz fy= 200 MHz fy = 550 MHz ty- 240 MHz fy - 260 MHz fy • 90 MHz fy- 260MHz fy - 70 MHz fy = 1000 MHz fy = 1000 MHz fy- 150 MHz fy = 200 MHz fy = 750 MHz 0 , fy * 300 MHz fy • 100 MHz fy = 480 MHz Darlington Darlington * MJE2955, TIP2955! fy = 500 MHz fy = 700 MHz fy- 700 MHz formant elektor december 1977 — 12-27 Before looking at the VCF circuit in detail, it is worth examining the ways in which the VCF is used. Four filter functions are available. A lowpass filter with a rolloff of — 12dB per octave above the turnover point, a highpass filter with a rolloff of — 12dB per octave below the turnover point, a band- pass filter with variable Q and minimum slope of —60 dB per octave on either side of the centre frequency, and a notch filter. The turnover point — or centre frequency in the case of the band filters - is the same for all four filter functions, and can be varied by the application of a control voltage. Lowpass filter The simplest use of the VCF is what might be called static tailoring of a VCO output using the KOV output of the keyboard to control the VCF. Suppose (to give a simple example), it is required to filter out a large proportion of the harmonics of the squarewave signal to produce a flutelike tone. The lowpass function of the VCF would be used and the turnover point would be set so that when a particular key was depressed the desired tone colour was obtained. If a higher note is depressed then the VCO pitch will increase. However, since the KOV output is also applied to the VCF the turnover point of the VCF will increase with the VCO frequency, so that it always remains in the same octave relationship to the VCO fre- quency. The same harmonic structure of the output waveform is thus main- , tained, — i.e. the VCF is being used as a tracking filter. If the VCF is used simply as a tracking filter then the harmonic content of the ' output remains fixed for the duration of each note. However, dynamic vari- ation of harmonic content during a note is also possible by controlling the VCF from the envelope shaper. For example, to provide a good imi- tation of a trombone sound the note should initially start off with only a weak harmonic content. As the loudness of the note builds up the harmonic content also increases, i.e. the note becomes ‘brighter’. Similarly, at the end of the note it is the harmonics which die away first. The five waveshapes produced by the VCO, the description of which was concluded last month, can further be processed to produce a wide range of tone colours using the tone-shaping modules, which consist of the voltage- controlled filter (VCF), voltage- controlled amplifier (VCA) and the Attack, Decay, Sustain, Release (ADSR) envelope shaper. This month's article describes the VCF, which is the module that tailors the spectrum of the VCO signal. A somewhat unusual circuit is employed for the VCF, and four filter functions are available: lowpass, highpass, bandpass with variable Q, and notch. Despite this versatility the VCF circuit is simple to construct, easy to adjust and reliable. C. Chapman This is achieved by using the VCF in the lowpass mode as a tracking filter with ADSR control, i.e. with inputs from KOV and from the envelope shaper. When a key is depressed the turnover point is initially determined by the KOV input, and is set so that the harmonics are filtered out. As the envelope shaper output voltage rises (attack) the turnover frequency of the VCF is increased to pass more of the harmonic content. At the end of the note (decay) the envelope shaper output falls and the turnover frequency of the VCF is reduced to filter out the har- monics once more. These two simple examples relate to the imitative capability of the syn- thesiser, since most people will have a ‘feel’ for the sound of conventional musical instruments. However, it must once again be stressed that the syn- thesiser is not limited merely to an imitative role. It can also produce sounds that are unique to itself, that do not occur naturally and are totally ‘electronic’. Highpass filter So far only the use of the lowpass filter has been discussed. The highpass filter has the opposite effect to the lowpass filter, i.e. it can be used to attenuate the fundamentals of notes while retaining the harmonics. This is obviously useful for sounds which have only a weakly developed fundamental or a bright tonal character, such as harpsichord and spinet type sounds, and certain string and brass instruments. When controlled by the envelope shaper the highpass filter can also give an ‘ethereal’ charac- ter to a sound. Bandpass filter In addition to the fundamental and harmonic series produced when a particular note of the instrument is sounded, brass and many woodwind instruments exhibit a number of fixed bandpass resonances known as formant bands, which are determined by the particular mechanical construction of the instrument. Use of the VCF as a bandpass filter with fixed centre fre- quency (KOV input switched off), together with a second VCF as lowpass 12-28 — elektor december 1977 formant Figure 1. The two-integrator loop used in the Formant VCF provides 12dB/octave highpass, bandpass and with the addition of A4, a notch filter. Figure 2. Instead of normal op-amps, OTAs are used in the Formant VCF. The output current change is g m times the input voltage change, but g m can be varied by feeding in a control current IaBC- Figure 3. The OTA integrator used in the Formant VCF. The integrator time constant is controlled by the current lABC- A high im- pedance buffer ensures that all the output current of the OTA flows into the integrator capacitor. Figure 4. Complete circuit of the Formant VCF, which consists of a voltage-current exponential converter and a linear current- controlled filter. 3 15V tracking filter, allows these instruments to be more accurately imitated. Pedal controlled Wa-Wa Using the VCF in the bandpass mode with a fairly high Q-factor, A Wa-Wa effect can be obtained by controlling the VCF with a 0 to 5 V DC supply from a pedal-controlled potentiometer (such Wa-Wa pedals are available commercially or are easily home-made). Notch filter By sweeping the centre frequency of the notch filter up and down the spectrum, either manually using a potentiometer or automatically using a low-frequency oscillator, phaser-type sounds can be produced. If this is done using a white noise input instead of a VCO then interesting ‘jet-aircraft’ noises can be obtained. Design of the VCF As far back as 1965, R.A. Moog designed 24 dB/octave lowpass and highpass filters, and no satisfactory alternative to these was found for several years, although they were periodically ‘re- invented’ by others. It was not until the introduction of a specific type of integrated circuit, the operational trans- conductance amplifier (OTA), that a viable alternative became possible. The Formant VCF is developed from the two-integrator loop shown in figure 1. Although a complete math- ematical analysis of this circuit is beyond the scope of this article (those interrested are referred to the bibli- ography), the basic concept is fairly simple to grasp. The two-integrator loop can be con- sidered as an analogue computer for the solution of a second-order differential equation. If the input resistor R1 and potentiometer Pq are removed, it can be seen that the circuit bears a remark- able resemblance to a quadrature oscillator. In fact, if the loop gain of the circuit is sufficient then it will function as an oscillator — at the fre- quency for which the differential equation solution holds. Pq provides damping so that the circuit does not oscillate, but merely acts as a filter. Highpass, bandpass, and lowpass filter functions are available simul- taneously at outputs (1), (2) and (3) respectively. At the turnover or centre frequency of the filters there is 90° phase shift between the integrator inputs and outputs. Thus between point (1) and point (3) there is 180 phase shift in all. By combining outputs (1) and (3) using a voltage follower A 4 a notch function can be obtained. Since the two inputs are 180 out of phase at the centre frequency there is a null at the junction of the voltage follower’s two input resistors at this frequency. Of course the centre/turnover of this filter is not voltage-controlled, but is fixed by the integrator constants R and C, so to achieve voltage control one of these elements must itself be voltage- controlled. Voltage control of capaci- pi rh 100k ri , — r t r TM [)>> es 0>j_ VC02 [)( VC03 [) tance is impractical in this application. Voltage controlled resistors are possible in the form of LED/LDR combinations or FETs, but unfortunately both these methods suffer from disadvantages such as unpredictable performance due to wide tolerances, small control range, poor linearity, and breakthrough of the , control signal. An alternative solution can be found by re-thinking the basic integrator design. The classic op-amp integrator consists * of a differential-input voltage amplifier with the non-inverting input grounded. An input resistor connected to the inverting input (which is a virtual earth point) converts the input voltage into a proportional current. Since this current cannot flow into the inverting input it must flow into the feedback capacitor, and a voltage appears across the capacitor (and hence at the op-amp output). It is fairlv obvious that the op-amp is functioning simply as a voltage-to- current converter, and an equivalent Hardwired inputs: KOV Keyboard Output Voltage (from interface receiver). ENV Envelope shaper control voltage (from ADSR unit). VCO 1 , 2, 3 = From VCOs 1 , 2 and 3. Front-panel inputs: ECV External Control Voltage. TM Tone colour ('Timbre') Modulation input. ES External Signal, e.g. noise, input. Outputs: VCF/IOS Internal Output Signal from VCF, (will be hardwired to a VCA). EOS External Output Signal from VCF (front panel output). Front-panel controls: OCTAVES = PI , coarse frequency adjustment. ENV P2, sets envelope shaper control voltage. TM P3, sets tone colour modulation level. ES P4, sets external signal level. Q P5, Q-factor adjustment. OUT P6, sets VCF/IOS output level (not EOS!). ECV/KOV = SI, selects external or internal control voltage input. HP S2, selects high-pass output. BP S3, selects bandpass output. LP S4, selects low-pass output. N S2 + S4, selects notch (band-stop) output. 12-30 — elektor december 1977 formant circuit for an integrator would be an amplifier with a voltage-controlled cur- rent output, with a capacitor connected, not in a feedback loop, but between the output and ground. Varying the voltage-current transconductance of the amplifier would then effectively vary the ‘resistance’ constant of the inte- grator. A suitable device exists ready-made in the shape of the operational trans- condunctance amplifier or OTA. This is an amplifier that produces an output current which is proprotional to the input voltage, i.e. i = g m • uj, where i is the output current, uj is the input volt- age and gm is the transconductance. The feature of the OTA which makes it ideal for the VCF is that the trans- conductance g m is determined by a control current IaBC. thus g m = k • I ABC, where k is a constant. This is illustrated in figure 2. For the CA3080 OTA used in the Formant VCF the constant k is 19.2 V" 1 at an ambient temperature of 25° C, and so gm = 19.2 x IaBC m S (milliSiemens = milliamps/volt). This IC is particularly suitable because of the outstanding linearity of its transconduc- tance characteristic over three decades of control current, and because of its relatively small tolerance in the value of ‘k’ (2:1 for the 3080 and 1.6:1 for the 3080A). However good linearity is achieved only for small input signals, and the input voltage must be attenuated to about ± 10 mV when used in the VCF. Figure 3 shows the circuit of the integrator used in the Formant VCF. The input voltage is attenuated by the potential divider connected to the inverting input, and across the output is connected the 1 80 p integrating capacitor. To maintain correct operation of the integrator the total output current of the OTA must flow into the integrator capacitor, which means that a buffer stage with a very high input impedance is required on the OTA output to avoid ‘current-robbing’. A FET connected as a source-follower is used for this purpose. The control current I ABC is fed in through a 27 k resistor. The integrator time constant is inversely proprotional to the control current, so the VCF centre/turnover frequency is directly proportional to the control current. Complete circuit of the VCF Figure 4 shows the complete circuit of the VCF. The actual filter circuit has a linear frequency characteristic and is current controlled. It must therefore be preceded by an exponential converter that converts the input control voltage into an exponentially related control current, so that the VCF tracks with the same 1 octave/V characteristic as the VCOs. The exponential converter occupies the upper portion of the circuit, and is essentially similar to that of the VCOs. However, the control characteristic of the VCF does not need to be so accu- rate as that of the VCO, since a small error will only introduce minor, un- noticeable errors an amplitude response, whereas the same error in the VCO characteristic would cause unacceptable tuning errors. For this reason the VCF exponential converter is provided only with a passive input adder (cf. figure 2a of last month’s article), and temperature stabil- isation of the exponentiator is dispensed with, thus saving the cost of a not in- expensive /uA726 IC. However, tempera- ture compensation is retained in the Figure 5a. Two well-matched PNP transistors may be used in place of IC1 for greater econ- omy. The pin numbers shown correspond to the pinout of IC1. Figure 5b. The CA3080 is available in two packages. If the TO- package is used the leads must be bent to fit the DIP layout on the p.c.b. Figure 6. Printed circuit board and component layout for the VCF. (EPS 9724-1). form of a matched transistor pair. The circuit differs here from the VCO since the exponentiator must source current into the OTAs rather than sinking it as in the VCO, so PNP transistors are used. Since temperature stabilisation is not used, a number of options are open for the choice of the matched transistor pair. Those who have access to a good transistor tester or curve tracer can select a matched pair of any small signal medium gain (‘B’ spec) transistors such as the BC 179B, BC 159B, BC557B etc. These are then glued together with epoxy adhesive for good thermal tracking as shown in figure 5 a, taking care that there is no electrical contact between the cases if metal-can types are used. (Note that the pin numbers given in figure 5a correspond to the IC pinning in figure 4). The preferred solution is to use a CA 3084 transistor array, which is what was used in the prototype, but if this is difficult to obtain then almost any dual PNP transistor, such as the Analog Devices AD 820 . . . AD 822, Motorola 2N3808 . . . 2N381 1 or SGS-ATES BFXll.BFX 36, will do. Note that the value shown for R6 (lk8) is correct when using the CA 3084. If a dual transistor is used, it is advisable to reduce the value of R6 to lk5. The current-controlled filter consists of IC3, IC4 and IC5. It will be noted that the integrators IC4 and 1C5 are non- inverting. This does not affect the oper- ation of the circuit, since non-inversion has the same effect as the double inver- sion that takes place in figure 1. How- ever, it does ensure that the three out- puts of the filter are in the same sense, whereas in figure 1 the bandpass output is inverted with respect to the other two outputs. IC6 functions as an output buffer, and also as a summing amplifier for the high- pass outputs to provide the notch func- tion. By setting S2, S3 or S4 in position ‘a’, highpass, lowpass or bandpass func- tions respectively may be selected. By setting both S2 and S4 in position ‘a’ the notch function is obtained. Since 0600000 o oooo oo ooHho TI D OtT - o 15V O © + O 15V o VCD O Parts List Resistors: R1, R2, R28, R29. R30, R34 = 100 k R3 = 100 k (1% metal oxide) R4 = 33 k R5 = 47 k R6 = 1 k8 (see text) R7, R9 ” 330 k R8 = 2k2 RIO, R33 = 27 k R11, R12. R13, R14, R15, R1 6, R20, R24 = 39 k R1 7 = 8k2 R18 = 22 k R19 = 1 k R21 , R22, R25, R26 = 1 00 fl R23, R27 = 12 k (nominal value, see text) R31 = 33 k R32 = 470 U Potentiometers: PI, P5 = 100 k lin P2, P3 = 47 k (50 k) lin P4 = 47 k (50 k) log P6 = 4k7 (5 k) log Presets: P7 = 100 k P8 = 470 n (500 n) Capacitors: Cl, C3, C4, C5, CIO = 680 n C2 = 1 n C6, C7 = 33 p C8, C9 =1 80 p Semiconductors: I Cl = CA 3084 (DIL) see text. IC2, IC3, IC6 = mA 741 C (Mini DIP), MCI 741 CPI (Mini DIP). IC4, IC5 = CA 3080 (A) T1, T2 = BF 245a, b. Miscellaneous: 31-way plug (DIN 41617) SI — S4 = miniature SPDT toggle switch 12-32 — elektor december 1977 IC3 is connected as an inverting amplifier and IC6 also inverts, this double inver- sion means that the output signal is non-inverted with respect to the input signals. The overall gain of the VCF (in the passband) is x 1 (OdB). Inputs, controls and outputs The exponential converter section is equipped with a coarse octave tuning control PI (note the absence of a fine control as compared with the VCO) and two presets P7 and P8 to adjust the offset and octave/V characteristic. KOV and ECV control inputs are pro- vided, as for the VCO. The input for envelope shaper control (ENV) is ad- justable by means of P2. The tone colour modulation input controlled by P3/(TM) is analogous to the FM input of the VCO, i.e. it allows the centre/turnover frequency of the VCF to be modulated. There are four signal inputs, three inter- nally-wired VCO inputs and one external signal (ES) input, whose amplitude can be controlled by P4. The Q-factor of the filter is controlled by P5. Switches S2 to S4 select the desired filter type, as has already been described. Two outputs are provided, an uncon- trolled output EOS which is brought out to a front-panel socket, and an internal output IOS, which is controlled by P6. Construction A printed circuit board and component layout for the VCF are given in figure 6. The same considerations of component quality apply to the VCF that apply to all parts of the synthesiser. As mentioned earlier, two basic versions of the C A 3080 are available. The CA 3080A has better specifications as regards tolerance, and extended temperature range, but the basic C A 3080 is quite adequate (as- suming that the synthesiser is not to be used in Antarctic blizzards). The CA 3080 is available in two pack- ages, TO- can and mini-DIP, both of which are shown in figure 5b. The p.c. board is laid out for the mini-DIP ver- sion, but the TO- version can easily be accomodated by splaying out the leads to conform with the mini-DIP pinning (in fact some TO- package 3080s are supplied with this already done). The FETs T1 and T2 must be tested as detailed in part 3 (September 1977), and their source resistors R23 and R27 selected in accordance with Table 1 of that article. A front panel layout for the VCF is given in figure 7, and a wiring diagram for the front-panel mounted components is shown in figure 8. Testing and adjustment During assembly, it is convenient to use IC sockets so that the current-controlled fiter section of the circuit can be tested independently of the exponential con- verter. To test the CCF, IC1 is removed and a 1 00k log potentiometer is connec- ted ‘back-to-front’ between ground and formant elektor december 1977 — 12-33 formant -15 V (i.e. so that the end of the track approached by clockwise rotation of the wiper is connected to ground). A multimeter set to the 100 pA range is connected between the wiper of the potentiometer and the junction of RIO and R33, an input signal is provided to the VCF from a sinewave generator or from the VCO, and the Bandpass output is monitored on a oscilloscope. The test then proceeds as follows: 1. Set the Q-factor of the filter to maxi- mum (wiper of P5 turned towards R19). 2. By means of the 100k log potentio- meter set the control current to 50 pA on the meter. * 3. Slowly increase the generator fre- quency from about 300 Hz to 1500 Hz; somewhere in this range the VCF out- put should peak as its resonant frequency * is reached (i.e. there will be a sharp in- crease in output at a particular frequency with a fall-off on each side). Note the frequency at which resonance occurs. 4. Increase the control current to 100 p A and check that resonance now occurs at twice the previously noted frequency. Note. Tests 2 to 4 are intended to check the linearity of the filter frequency v. control current characteristic. The tolerance in the absolute value of filter frequency for a given control current is due to OTA tolerances and is unimport- ant provided linearity is maintained i.e. the filter frequency doubles for each doubling of control current. 5. Set the generator to about 50 Hz and check that it is possible to obtain resonance at this frequency by varying the control current with the 1 00 k potentiometer. Repeat this test at 1 5 kHz. The exponential converter can now be tested after inserting IC1 and removing IC4 and IC5. A multimeter set to the 100/iA range is connected from the bottom end of R10 to -15V and the wiper voltage of PI is monitored with a voltmeter. The test and adjustment now proceed as follows: 1. Set P8 to its mid-position, and turn PI fully anticlockwise so that its wiper voltage is zero. Adjust P7 until the mircroammeter reading is 50 pA. 2. Turn PI clockwise until its wiper , voltage is IV, then adjust P8 until the microammeter reads IOOjuA. 3. Repeat the procedure for 2V, 3V, 4V etc. on the wiper of PI, checking * that the exponentiator output current doubles for every IV increase. Offset adjustment Now that the two sections of the VCF have been checked, IC4 and IC5 can be re-inserted so that the entire VCF can be checked as a functional unit, as follows: 1. A squarewave with 50% duty-cycle at a frequency of about 500 Hz is fed to one of the filter inputs. PI is turned fully clockwise and P7 is turned anticlockwise. 2. The lowpass output of the VCF is monitored on an oscilloscope, and at this stage should appear at the output without degradation. 3. If the wiper of P7 is now turned slowly clockwise the leading edge of the squarewave will start to be rounded off as the turnover point of the filter is reduced. To carry out the offset adjust- ment with P7 its wiper is turned as far clockwise as is possible without signifi- cantly degrading the square waveform (just a slight rounding of the top corner is acceptable, but this adjustment does not have to be particularly precise). Octaves/Volt adjustment The octave/ V characteristic of the VCF can be adjusted by seeing how well it tracks against a previously calibrated VCO. To do this, the KOV input is connected to the VCO and the VCF, and the sine output of the VCO is connected to the VCF input. The ad- justment procedure is as follows: 1. Switch off the main tuning of the keyboard, depress top C of the keyboard and use the octaves control of the VCO to set its frequency to about 500 Hz. 2. Set the Q control, P5, of the VCF to maximum, monitor the bandpass output of the VCF and adjust PI until the VCF output peaks. As the filter is easily over- loaded at high Q-factors it may be necessary to reduce the VCO output voltage. 3. Depress the key two octaves lower and adjust P8 until the VCF output again peaks. 4. Depress top C again and if necessary readjust PI so that the output peaks. 5. Repeat 3 and 4 until no further read- justment is necessary for the output to peak when changing from one note to the other. 6. The offset adjustment may have been disturbed, so check this and if necessary readjust P7 as described in the offset adjustment procedure. 7. Repeat 3 onwards until no further improvement can be obtained. Bibliography S. Franco: ‘Use transconductance amplifiers to make programmable active filters. ’ - Electronic Design, September 13th, 1976. T. On: ‘Voltage /current-controlled filter. ’ — Circuit Ideas, Wireless World, November 1976. E. F. Good and F. E. J. Girling: ‘Active filters, 8. The two-integrator loop, continued’. — Wireless World, March 1970. D. P. Colin: ‘Electrical design and musical application of an uncon- ditionally stable combined voltage- controlled filter resonator’. - JAES, December 19 th 1971. G. B. Clayton: ‘Experiments with operational amplifiers. 4. Operational Integrators. ’ - Wireless World, August 1972. H. A. Wittlinger: ‘Anwendung der operations-transductance-verstiirker CA 3080 und CA 3080A. - RCA Applicationsschrift ICAN-6668, 1973. U. Tietze, Ch. Schenk: ‘Einstellbares universal-filter. ’ Halbleiter Schaltungs- technik, p. 350. Springer-Verlag, Berlin, Heidelberg, New York, 1976. H Twiddling the knob of a heating ther- mostat is not a job for an electronic slave — stepper motors and all that kind of thing so this circuit switches between two separate thermostats. One unit (Te2) is set to the ‘day’ tempera- ture and the other (Tel) to the ‘night’ temperature; the circuit determines which of the two has control of the system. Figure 1 shows the principle of the switchover. Since the ‘day’ tempera- ture will normally be set higher than the ‘night’ temperature, a single-pole-single- throw switch (SI) will enable the ‘day’ thermostat to take over. This arrange- ment is not only simple; it is also ‘fail safe’ — the system will always be set to at least the ‘night’ temperature in the event of an electronic failure. The switch SI is operated by a flip-flop that in turn is controlled by a 24-bit shift register. The clock input of this register receives one pulse per hour, so that the ‘1’ steps through the register at the rate of one bit per hour. Switches S2a and S2b interconnect the set- and reset-inputs of the flip-flop with shift register bit outputs. This means that the switching times, in hours, can be selected by means of S2a (set flip- flop) and S2b (reset flip-flop). The actual time of day at which the action occurs will of course depend on the time at which the shift register is reset, during setting up. Timer circuit Figure 2 gives the circuit diagram of the timer section. Input C is fed with a 50 Hz reference signal. The pulse shaper using N6 and N7 turns this reference into a neat clocking waveform that is fed to the divider. The circuit around 1C5 and IC6 divides by 180000, so that the output of N9 (point D) will deliver one impulse per hour. This hour-pulse is in turn fed to the 24-bit shift register IC7 . . . IC9. To make the process con- tinuous, the arrival of a ‘1’ at the last bit output is arranged to reset the regis- ter, by means of monostable N 1 7/N 1 8. Various outputs of the shift register can be fed, via the DIL-switches S4 and S5, to the set- and reset-inputs of flip-flop N15/N16. The ‘on’ and ‘off’ periods of the flip-flop can therefore be pro- grammed using S4 and S5. If, for It is generally accepted that — in the interests of reduced fuel bills and increased night sleep — it is advisable to reduce the temperature setting of one's heating system before retiring. Many systems are however provided with only a single thermostat, so that one has to turn the knob down a few degrees every evening and then back up again in the morning. The circuit about to be described will carry out both resetting functions at pre-programmed times. example, the shift register was reset at 18.00 hours (by means of SI in fig- ure 3), then the switches S4a . . . S4h will select a time between 20.00 and 02.30 hours and S5a . . . S5h will select a time between 03.00 and 09.30 hours. Note that the half-hour impulse is taken separately from the main divider. Other ranges of programming can obviously be obtained by resetting the shift register at a different time, or by selecting other shift-register outputs. The flip-flop N15/N16 is also provided with a ‘manual override’ in the form of S2 and S3. The information stored in the flip-flop is used to bring the second thermostat into circuit when the higher room tem- perature is required. Controller Figure 3 shows how the second (‘day’) thermostat Te2 is switched in and out of circuit by the triac Tril . To minimise the drive dissipation in the triac, this is driven via T2 from an oscillator (N1 . . N3) that produces a 4 kHz sig- nal with a 10% duty cycle. The oscil- lator is started and stopped by com- mands from the flip-flop N15/N16. A pair of anti-parallel diodes, D1 and D2, is connected in series with the ‘night’ thermostat. This derives the 50 Hz reference signal that has to be fed to point C of the timer section (fig- gure 3). Power supply The starting point for the design of this controller was that it had to be suitable for direct connection into a heating system, at the position of the existing single thermostat (points A and B). This causes some complication with regard to the power supply. When the system is not operating, the full 24 V AC is pre- sent between points A and B. This volt- age is used, see figure 3, to charge a nickel-cadmium accumulator. D3 and D4 operate as a half-wave rectifier and T1 and D5 provide voltage regulation. R1 sets the maximum charging current, depending on the ratings of the accumu- lator — and on the amount of current ‘thievery’ that the control box will (im)passively tolerate! heating controller elektor december 1977 — 12-35 24-bit shift register Ho H Reset T I flip-flop I 1 Figure 1. Block diagram of the heating con- troller. Two thermostats are used, one of which is connected permanently to the central heating control unit. The other is switched in and out of circuit at predeter- mined times. Figure 2. The timing and drive circuit, con- sisting of the clock generator, 24-bit shift register and flip-flop. The inclusion of the LED D3 gives an indication of the circuit operation; the LED lights when the boiler is out. Since the entire timer circuit is built up with MOS devices, the load on the power supply is only a few mA. It is none- theless possible, in a case of high duty- cycle of the system (high temperature desired, low outside temperature, boiler capacity marginally sufficient), that the shut-down periods of the system will be too short for the accumulator to charge sufficiently to maintain the supply during the ‘on’ periods. In this case the power supply will pack up after a while. There will then be nothing else for it but to install a separate supply. Pump starter Some heating systems practice the dubious economy of turning off the circulating pump when the boiler is shut down. This has the objection that floating particles can sink, leading in the long run to blocked pipes. The repair bill will then exceed several years of electricity supply for the pump. It is possible, in this case, to both have one’s cake and eat it. Figure 4 gives a circuit that will start and run the pump inter- mittently during boiler-off periods. 12-36 — elektor december 1977 heating controller The circuit is triggered by the hour- impulse from the timer. The impulse causes the discharge of C5 and there- fore the release of the relay. The pump connected to break-contacts of the relay will now start to run. C5 will start to charge through R9, so that the relay will pull in after a few minutes, turning off the pump. The power supply for this circuit is also obtained from the figure 3 supply sec- tion. This has the extra effect of starting the pump when the boiler turn-on causes the rectified AC to fail. The pump-relay must of course have a low pull-in current (about 10 mA) to pre- vent inadvertant operation of the boiler. Final notes It is conceivable that, if the original con- trol unit is sufficiently sensitive, the central heating may never turn off — the current consumption of the circuit being sufficient to simulate a closed thermostat. In this (unlikely) event, the circuit can be modified as shown in fig- ure 5 . The output from the control unit is only connected to the thermostats; power to the rest of the circuit is derived from the 24 V input to the con- trol unit. The disadvantage of this system is, of course, that a third wire must be run from the control box on the boiler to the room thermostats. A printed circuit board for the ‘heating controller’ is shown in figures 6 and 7. M Figure 3. Thermostat switching and power supply section. Figure 4. Extension circuit for switching the pump on periodically in order to prevent blocking of pipes and/or pump. Figure 5. This modified circuit can be used if the central heating control unit proves to be too sensitive, or if the shut-down periods of the boiler are too short to charge the accumu- lator sufficiently. Figures 6 and 7. Printed circuit board and component layout for the central heating con- troller (EPS 9877). heating controller elektor december 1977 — 12-37 ooooooo OUUUUOO O* a gang. ■OOOOOOO nnnn o oo a o ooooa o oo o omr 9877 R1 = 220 fi R2.R31 = 4k7 R3 = 2k2 R4,R6,R14 . . . R16, R24 . . . R26.R29 = 22 k R5 = 220 k R7 = 18 k R8= 15k R9,R13,R17 = 10 M RIO = 33 fl R11 = 10 k R12,R19,R20 . . . R23.R27, R28.R30 = 100 k R18 = 47 k PI =47 k Capacitors: Cl = 1 00 m/35 V C2 = 10 m/25 V C3 = 1 00 n C4.C7.C8 = 1 n C5= 100 m/ 6 V tant. C6 = 47 n C9.C1 0 = 10 n C11 = 2n2 Semiconductors: T1 .T3.T4 = BC547B T2 = BC 549C D1 .D2.D4.D6 = 1 N4001 D3= LED D5 =12 V/400 mW zener diode D7.D8.D10 . . . D20 = 1N4148 Tril = 100 V/1 A or 400 V/4 A IC1 = 4049 IC2 = 4001 IC3.IC4 = 4011 IC5 = 4020 IC6 = 4024 IC7 . . . IC9 = 401 7 Miscellaneous: SI ... S3 = pushbutton, SPST S4.S5 = 8 section Dl L switch Tel = existing room thermostat Te2 = new thermostat, same type Rel = 1 5 V relay, one break contact B = NiCd accumulator, 3.6 V/500 mAh (3 cells) 12-38 — eleklor december 1977 stylus balance Variometer tuner. April 1977, p. 4-46. 1. Problems may be experienced due to oscillation of NAND gates N1 to N4 (figure 3, page 4-47) if buffered versions of the 4011 are used, since these are unsuitable for operation in the linear mode. Only unbuffered versions of the 4011 should be used in this circuit. 2. The supply voltage to N1 - N4 may be between 3V and 6V due to toler- ances in the current drawn by these gates in the linear mode. Since the maximum output of the squelch control, PI, is about 7V, this may lead to for- ward biasing of the protection diodes in N4 at high settings of the squelch con- trol, which can cause reverse readings on the signal-strength meter. This was mentioned briefly on page 4-49, and it should be emphasised that it is not a fault condition. PI has sufficient range to allow for tolerances in N1 - N4, and will have a larger operating range with some 401 Is than with others. Once forward biasing of the protection circuits of N4 occurs, the squelch con- trol is outside its effective range, so to avoid meter reversal the solution is simply not to turn PI beyond this point. Phase meter There are two errors in the circuit of the phasemeter (‘Summer Circuits’ 1977, circuit No. 50). Pins 1 of IC1 and IC1 should be connected to ground, and a 2k2 pullup resistor should be connected from the output (pin 7) of each of these ICs to +9V. Is packing material always useless? No! See the inside of this month's mailing wrapper. This project, first published in the April 1976 issue, is amongst the choice of boards in our free printed circuit board offer. Provided the assembly instructions are followed correctly, this project is positively guaranteed to work first time! Figure 1. The printed stylus balance. — _ —1.25 — 1.5 — —1.75 — — 2.0 — 2.5 — 3.0 — — 4.0 — 5.0 A stylus balance is an invaluable aid for any Hi-Fi enthusiast, since the correct tracking force is essential for good disc reproduction. The Printed Stylus Balance (P.S.B.) is simply a lever balance made from a piece of copper laminate board, the weight of board on one side of the pivot being balanced by the stylus force on the other side. The smaller the tracking force, the further away from the pivot must the stylus be placed to achieve equilibrium, so the balance can be calibrated accordingly. The pivot is made from two dome- headed furniture tacks, which are pushed through the board from the plain side and the points cropped off. To use the P.S.B. , first check that the turntable is level and set the pickup bias compensation to zero. Place a flat sheet of material, the same thickness as an average record, on the turntable mat, place the P.S.B. on top of this and gently lower the stylus onto the P.S.B. Move the stylus along between the cali- brations on the P.S.B. until equilibrium is obtained, when the tracking force will be indicated by the P.S.B. A pocket mirror is an ideal platform for the P.S.B., since it is about the same thickness as a record, flat and smooth, and the equilibrium condition is easy to judge from the reflection in the mirror. It should be noted that the calibration accuracy of the P.S.B. depends on the mass per unit area of the board material, and is guaranteed only for boards sup- plied by the Elektor p.c. board service (EPS 9343). M ELEKTOR 9343 signal injector elektor december 1977 - 12-39 This useful faultfinding aid, first ' featured in the Elektor April 1977 issue, is another of the projects for which a free printed circuit board is being offered (see details in the advertising pages of this issue). For readers who missed the original article a brief description of the circuit is repeated here. A signal injector is a useful aid to fault tracing; by injecting a signal at various stages in a circuit, faults in the signal path are easily located. The circuit operates as follows: two CMOS NAND gates, N3 and N4, form an astable multivibrator that oscillates at about 1 kHz. Since the squarewave produced by this circuit contains har- monics extending up to several Mega- hertz, the signal is useful for r.f. as well as audio testing. The output is buffered by a Darlington pair T2/T3 and the out- put signal level is adjustable by means of PI. The signal is coupled to the cir- cuit under test via C6, which provides DC isolation of the injector output. Diodes D1 and D2 protect the signal injector by clamping any transients that may be coupled back through C6. To make the signal more noticeable it is switched on and off at about 0.2 Hz by a second astable consisting of N1 and N2. This 0.2 Hz signal also turns T1 on and off, which flashes LED D3 to indi- cate that the circuit is functioning. The working voltage of C6 should be chosen to withstand any voltage likely to be encountered when using the signal injector. For battery-powered equip- ment a 63 V component will be more than adequate, but if the injector is to be used with mains-powered circuits then C6 should be uprated accordingly. D1 and D2 should also be adequately rated. If the injector is to be used with ‘live-chassis’ equipment such as TVs it should be housed in an insulated box, and both the output probe and ground clip should be well insulated to avoid the danger of electric shock. K Figure 1. Circuit of the signal injector. Figure 2. Printed circuit board and com- ponent layout for the signal injector. (EPS 9765). Parts list for figures 1 and 2. Resistors: R1,R2,R5,R6= 10M R3 = 100 k R4 = 470 D R7 = 27 k PI = 1 k preset Capacitors: Cl = 100 p/6 V C2,C3 = 470 n C4.C5 = 100 p C6 = 100 n (see text) Semiconductors: IC1 =4011 T1 = TUP T2,T3 = TUN D1 ,D2 = DUS (see text) D3 = LED (e.g. TIL 209 or similar) Miscellaneous: SI = SPST switch 4 x 1 .4 V mercury batteries =-I=7mA 12-40 — elektor december 1977 knotted handkerchief /noted nomdterchfet Another project for which a free printed circuit board is being offered, this cir- cuit was first featured in the July / August 1977 issue, but for readers who missed that issue a short resume of the project is given here. The ‘knotted handkerchief’, as its name implies, is a circuit that reminds one to do something; in fact, it is an extremely compact timer and alarm that can be carried in a pocket. The heart of the cir- cuit is an oscillator and 14-stage binary counter, IC1. When the circuit is switched on the counter is reset by a pulse from the supply line via C2, after which it begins to count pulses from the oscillator. When the required time is reached the output (Q14) goes high, starting up a 3 kHz astable multi- vibrator, T1/T2, which drives a minia- ture loudspeaker to provide an alarm signal until the circuit is switched off. With the component values shown the time interval before the alarm sounds is approximately one hour, but R2 may be replaced by a 1 M potentiometer to provide variable timing intervals from about 5 minutes to 2 % hours. H Figure 1. Circuit of the 'knotted handker- chief'. Figure 2. Printed circuit board and com- ponent layout for the knotted handkerchief. (EPS 9830). "see text Parts list for figures 1 and 2. Resistors: R1 = 2M2 R2 = 470 k (see text) R3 = 1 M R4 = 4k7 R5 = 10 k R6 = 1 50 k R7 = 220 £2 Capacitors: Cl = 470 n C2= 1 n C3= 100 n C4 = 1 n Semiconductors: IC1 = CD 4060 T1,T2 = TUN Miscellaneous: SI = SPST switch LS = 8 Cl miniature loudspeaker or earpiece insert 9 V transistor power pack (e.g. PP3) sensitive lightmeter elektor december 1977 — 12-41 I Most commercially available lightmeters still use cadmium sulphide photoresistive cells, which suffer from such disadvan- tages as slow response time, especially at low light levels, and a spectral response that does not match that of the human eye. A lightmeter using a silicon photo- diode has considerable advantages over meters using photoresistive cells: the spectral response can be made much closer to that of the human eye (and of photographic film), the response time is sufficiently fast, and finally, the response to light is linear. Unfortunately, from the photographer’s point of view, silicon photodiode metering is available only in the most expensive cameras with built-in metering, so a design for a home-built, hand-held silicon photodiode lightmeter would seem to be a good idea. The cir- cuit given here will measure light levels from 10 lux to 10,000 lux in four ranges, which is adequate both for the measurement of illumination and for photographic purposes. The complete circuit of the lightmeter is given in figure 1 , and operates as fol- lows: light falling on photodiode D1 causes it to generate a negative voltage with respect to the 0 V rail. This causes the output of 1C1 to swing positive, driving current round the feedback loop into Dl. This current causes a voltage drop across the diode’s internal resist- ance, which is in opposition to the volt- age generated by Dl. The output of 1C1 takes up a positive voltage such that the two voltages cancel, i.e. the voltage at the inverting input of IC1 assumes the same potential as the non-inverting input — zero volts. The output voltage which IC1 assumes is proportional to the feedback loop current required to cancel the photo- diode voltage. This is proportional to the photodiode voltage, which in turn is proportional to the light falling on the photodiode. In other words, the output voltage of IC1 is proportional to the amount of light falling on Dl. Since the current through the photo- diode is fairly small, if the feedback resistors were connected direct to the output of IC1 they would have to be impossibly large to obtain a reasonable The lightmeter described in this article utilises a silicon photo- diode, the most up-to-date method of light measurement, and may be used either for photographic purposes or for the measurement of illumination. output voltage from IC1. To overcome this difficulty the output of IC1 is attenuated by a factor of 10 by R4 and R5. This also gives the possibility of an extra range, as will be explained later. Three basic ranges are provided, 10 lux, 100 lux and 1000 lux, selected by means of SI and calibrated by PI, P2 and P3. Pressing S2 shorts out the attenuator on the output of IC1, thus allowing a times ten multiplication of the ranges, or a maximum reading of 10,000 lux. If this highest range is not required then S2 can be omitted; R5 can be 1 k in this case. If, on the other hand, the lowest range is not required, S2 and R5 can be omitted and R4 replaced by a wire link. Construction A printed circuit board and component layout for the sensitive lightmeter are given in figure 2. The compact layout allows the lightmeter to be housed in a very small case, with ample room for a small 9 V battery such as a PP3. The current consumption of the lightmeter is only a few mA, so the battery should last for many months of normal use. S3 may be a non-latching pushbutton to avoid the possibility of the meter being left switched on. Calibration This is always a problem with any home- built measuring instrument, especially a lightmeter, which should be calibrated against a standard light source. Fortu- nately, a sufficiently accurate cali- bration for most purposes can be achieved using ordinary domestic lamps. A normal 240 V, pearl, incandescent lamp has a light output between 10 and 1 5 lumens per watt. If it is assumed that the lamp radiates uniformly in all direc- tions then the illumination at any dis- tance from the lamp is easily found. The point at which the illumination is to be measured is taken as being on the sur- face of a sphere, at the centre of which is the lamp. The illumination in lux (lumens per square metre) is found simply by dividing the light output of 12-42 — elektor december 1977 sensitive lightmeter Parts list for figures 1 and 2. Resistors: R1 = 3M9 R2 = 390 k R3 = 39 k R4= 10 k R5 = Ikl (see text) R6 = 4k7 PI = 1 M P2 = 220 k P3 = 22 k Capacitors: Cl = 56 p C2 = 10 m/ 10 V tantalum C3= 10 m/10 V Semiconductors: D1 = BPW21 (Siemens) IC1 = 3130 Miscellaneous: 51 = single-pole 3-way switch 52 = push -to -make switch 53 = push-to-make switch M = 1 mA meter :he lamp by the surface area of the sphere, i.e. where I is illumination in lux <6 is light output in lumens r is distance from lamp in metres. This equation is valid only if the lamp radiates uniformly, and for this reason only standard pearl lamps must be used for the calibration procedure. Spot- lamps, high output lamps or lamps with any other internal reflector or coating are not suitable. Table 1 gives a list of useful distances with corresponding illumination levels. Two lamps are required for the cali- bration procedure, a 60 W lamp and a 1 00 W lamp. The lamp must be mounted in a plain lampholder without reflector, and should be the only source of illumi- nation. The calibration procedure must be carried out away from reflecting sur- faces such as mirrors or light painted walls. The calibration procedure is as follows: 1. Set the lightmeter to the 10 lux range and place it at a distance of 240 cm from the 60 W lamp. Adjust PI for full-scale deflection of the meter. Now place a piece of thick card between the lamp and the light- meter, when the reading should drop to less than 10% full-scale. If it does not then something in the room is reflecting light onto the photodiode. 2. Change to the 100 W lamp and set the lightmeter to the 100 lux range. Place the lightmeter 1 00 cm away from the lamp and adjust P2 for full- scale deflection. 3. Set the lightmeter to the 1000 lux range and place it 30 cm from the lamp. Adjust P3 for full-scale deflec- tion. 4. Check that the calibration still holds when the xlO button is pressed, e.g. the same reading is obtained on the 1000 lux range as on the 100 lux range with the xlO button pressed. Figure 1. Complete circuit of the sensitive lightmeter. Figure 2. Printed circuit board and com- ponent layout for the sensitive lightmeter (EPS 9886). Figure 3. When used for photographic pur- poses the acceptance angle of the photo- diode is too great and must be reduced by a lens or tube. Table 1. lamp distance from lamp to photodiode illumination 60 W 240 cm 10 lux 60 W 105 cm 50 lux 100 W 100 cm 100 lux 100 W 45 cm 500 lux 100 W 30 cm 1000 lux (100 W 13 cm approx. 5000 lux) sensitive lightmeter elektor december 1977 — 12-43 Table 2. Recommended illumination values in lux for various tasks. class , of , j example visual task recommended illumination (lux) casual seeing hallway 100 ordinary tasks, making cabinets for electronic medium size detail projects; domestic living room 400 severe prolonged building a project on a tasks, small detail p.c. board; studying 800 very severe tasks, building a maximum-component- very small detail density prototype; 1500 detailed drafting exceptionally watchmaking 3000 severe tasks. minute detail Photographic use Calibration for photographic use pre- sents further problems since an absol- ute calibration procedure is almost impossible. The best method of cali- bration is to beg, borrow or steal an existing exposure meter to use as a reference. Another problem exists with acceptance angle, since the BPW 21 photodiode will accept light over an angle of about 100°. This is much wider than the acceptance angle of the average camera lens, and means that the lightmeter will ‘see’ a different scene from that seen by the camera, including large areas of bright sky. This can easily result in false readings. The acceptance angle of the lightmeter must therefore be reduced by putting a convex lens in front of the photodiode, or by putting it in a tube. This principle is illustrated in figure 3. To calibrate the lightmeter against a commercial exposure meter, the two are placed side by side and pointed at scenes of varying brightness. A table of lightmeter reading versus exposure meter reading is made, and this can later be used to calibrate the scale of the lightmeter. The lightmeter reading is then used in conjunction with the photographic film speed to find the correct exposure, which is basically the correct combination of shutter speed and aperture setting. Unfortunately it is not possible to give a detailed calibration procedure for this method, since the scales of commercial exposure meters vary greatly, some giving a light reading that must be trans- lated into an exposure value, and others giving a direct readout of shutter speed and aperture setting. However, the calibration should not pose too much of a problem for the experienced photographer. A second calibration procedure is poss- ible, based on the calibration as lux- meter given above. The ‘calibrated’ lux scale can be converted to a photo- graphic lightmeter scale on the basis of the following knowledge: • for a 2 1 DIN ( 1 00 ASA) film, 1 20 lux on the scale is equivalent to a lens aperture of f 16 at a 1 sec. exposure time; • an increase by a factor 2 of the illumi- nation reading in lux corresponds to a 1-stop increase in lens aperture, or a decrease by a factor 2 of the exposure time, or an increase of 3 points on the DIN scale, or doub- ling of the film sensitivity value on the ASA scale. To give an example: if a 24 DIN (200 ASA) film is used (an increase by a factor 2 in sensitivity) and the light- meter gives an indication of 240 lux (also an increase by a factor 2), correct exposure could be obtained at fl6/Viscc, or fl 1/i/s sec, etc. Regrettably, this calibration will prob- ably prove insufficiently accurate for photographic use: it may well be one or two stops out. For this reason, it will be necessary to make a few lest exposures for final calibration. H 12-44 — elektor december 1977 mw reflex receiver MW ir«(fex rec<2i\«ir== When transistors first made then- appearance on the electronics scene no self-respecting ‘wireless’ magazine was without designs for home-built radios of all shapes and sizes. Nowadays, however, one has to admit that it is not really an economic proposition to build a portable receiver, since perfectly serviceable sets of Eastern origin are available for only a few pounds. How- ever, the construction of a radio still presents a challenge to those who prefer to build rather than buy, and it is also a good introduction to electronics for the beginner, since the end product can not only visibly be seen (or rather, audibly heard) to work, but is also useful. With the beginner in mind, the circuit should not be too complicated or ex- This little medium-wave receiver makes an ideal project for the beginner, as it is simple, reliable, inexpensive to build and requires virtually no alignment. pensive, nor should it require any test equipment or great skill to align. These constraints immediately preclude the use of a superhet circuit, so the choice falls on one of the simpler types of receiver circuit, namely TRF (Tuned Radio Frequency), superregenerative and reflex circuits. In the TRF circuit, there are one or more stages of r.f. amplification, tuned to the frequency of the broadcast trans- mission, followed by a detector and audio frequency amplification. The superregenerative receiver achieves good sensitivity by positive feedback, but is unstable and difficult to use. The novelty of the reflex type of circuit is that a single transistor is used for two functions, r.f. amplification and a.f. amplification, thus saving the expense of seperate stages. A reflex design was therefore chosen because of its interesting features. Complete circuit Figure 1 shows the complete circuit of the MW reflex receiver. Selectivity is provided by tuning capacitor Cl and coil L 1 , which is wound on a ferrite rod and thus functions as a built-in aerial. 8 turns from the bottom of LI the r.f. signal is tapped off and fed to the base of Tl. At radio frequencies the im- pedance of C2 is extremely low, so the bottom end of LI is to all intents and purposes grounded at these frequencies. The amplified r.f. signal appears at the collector of Tl; since choke L2 possesses a high reactance at r.f. the signal cannot take the path through L2, but passes through C3 to the diode detector con- sisting of Dl, D2, R1 and C2, which demodulates the AM signal and removes the remaining r.f. component. The a.f. signal appearing across C2 passes through Lib, which has only a small reactance at audio frequencies, back to the base of Tl and the amplified signal now passes through the low reactance (at a.f.) of L2 to C5; D.C. bias and a.f. negative feedback for Tl are also taken from this point via R3. PI is the volume control, and the a.f. signal is taken from its wiper to the a.f. power amplifier, consisting of driver stage T2 and comp- lementary pair T3/T4, which feeds the loudspeaker. Construction A printed circuit board and component layout are given in figure 2. It is import- ant to stick to this layout, since modifi- cations could result in unwanted coup- ling between LI and L2, which could cause oscillation or lack of sensitivity, depending on the winding ‘sense’ of LI and L2. With the layout given, however, no problems should result. The aerial coil LI can be wound either on a 10 mm diameter cylindrical ferrite rod, or on a 12 mm x 4 mm ferrite slab. In either case the length of the rod should be between 50 mm and 75 mm. For the alignment procedure the coil must be slid along the rod, so a paper tube is made to fit over the rod and the coil is wound on this. To wind the coil, secure the start of the winding to the paper tube and wind on 8 turns of 0.2 mm diameter enamelled copper wire. Bring out a loop of wire for the tap, then wind on a further 87 turns in the same direction. Cl is a solid-dielectric tuning capacitor of Japanese origin. The component used in the prototype was actually a Sanesu type 721232, but there are many others that will do. These small tuning capaci- tors, which are available from many large component stores, have two sec- tions, one of about 140 pF to 150 pF and one of about 60 pF to 80 pF,but only the larger (150 pF) section is used. mw reflex receiver elektor december 1977 — 12-45 BC 557B BF 494 BC 549C 'see text BC 547B LI = 8 + 87 turns 0.2 mm wire (38 SWG) on ferrite core (see text) bottom view Figure 1. Circuit of the MW reflex receiver, which uses the simplest circuit consistent with reliable operation. Figure 2. Printed circuit board and component layout for the receiver. To ensure reliable operation this layout should not be altered. Small trimmer capacitors are also built in, connected in parallel with the main sections, and the trimmer in parallel with the 150 pF section is used in the align- ment. With regard to the other com- ponents, it should be noted that, since the circuit is an absolutely ‘minimum component’ design, values are quite critical and only those specified should be used. Alignment When the set has been completed and the construction checked, it can be switched on, when it should be possible to receive several stations by adjusting the tuning capacitor. The only align- ment required is to ensure that the tuning (from one extreme setting of Cl to the other) covers the 550 kHz to 1600 kHz medium-wave band. The alignment procedure is very simple: 1. Set Cl so that the vanes are fully open, and adjust the trimmer until a station is received whose frequency is R6 ne o P7 o Parts list for figures 1 and 2 Resistors: R1, R2 = 10 k R3 « 150 k R4, R6 = 4k7 R5 = 220 U R7 = 180 k R8 = 27 k R9 = 1 k8 Capacitors: Cl = 1 50 p solid dielectric miniature tuning capacitor C2, C6 = 47 n C3 = 2n2 C4, C5, C8 = 2p2/10 V C7 = 10 p/10 V C9, C10= IOOp/10 V Semiconductors: T1 = BF 494 T2 - BC 109C BC 549C, or equ. T3 = BC 107B.BC 547B, or equ. T4 = BC 177B.BC 557B, or equ. D1,D2 = AA119 D3 D4 = 1N4148 Miscellaneous: LI = ferrite aerial (see text) L2 = 3.3 mH miniature r.f. choke PI = 10 k log. potentiometer 8 n/200 mW miniature speaker, size to suit personal taste. o^lD— o K > u o ■ o_o o-fll— o o >0 • cio • S*( 12-46 — elektor december 1977 The complete circuit of the music box is shown in figure 1 . N1 to N3 comprise an oscillator consisting of an integrator (N 1) and a Schmitt trigger (N2 and N3). When the output of N3 is low the out- put of N1 ramps positive until the upper threshold of the Schmitt trigger is reached. The output of N3 then goes high and the output of N1 ramps nega- tive until the lower threshold of the Schmitt trigger is reached, and so on. An output buffer amplifier T1/T2 drives a loudspeaker. The rate at which the integrator capaci- tor Cl charges and discharges, and hence the oscillator frequency, is inversely proportional to the inte- grator time constant R x Cl, where R is the resistance between the output of N3 and the input of N1 (R 1 , R6 to R16). The frequency of oscillation is given by: This simple little circuit can be used to make an amusing musical toy in the form of a drum which, when rolled along the ground, will play a musical scale, nursery rhyme or other tune. Photo. Photograph of the completed prototype receiver. However, it is advisable to use the p.c. board layout shown in figure 2, since building it this small will almost certainly cause trouble! known to be around 1600 kHz. 2. Close the vanes of Cl and slide LI along the ferrite rod until a station is received whose frequency is known to be around 550 kHz. 3. Since the two above adjustments interact it will be necessary to repeat them until the best coverage of the MW band is obtained. 4. Fix the position of LI on the ferrite rod with wax. For frequencies of broadcast AM trans- mitters in their part of the world readers are advised to consult the broadcasting authorities. Cl is fixed, so each note which the music box plays is determined by switching in a different value of R, using reed switches which are activated by a magnet. The resistance values shown will make the music box play a tonic sol-fa scale of an octave and a half, but simple tunes may also be played if the resistance values are calculated accord- ingly using the following data: Conclusion Once the alignment has been carried out it should be possible to receive stations throughout the medium wave band. During the daytime the main broadcast transmitters and local radio station should be receivable, and at night many more stations, though interference between stations is a problem which this receiver, with its limited selectivity, is not able to resolve. Since the circuit is not equipped with any form of auto- matic gain control, the volume of the received signals will vary greatly depen- ding on the distance of the transmitter and the propagation conditions. How- ever, this is only to be expected with such a simple circuit design. Despite the very basic design of the audio amplifier, the audio output level is quite adequate for normal listening, and the quality is limited more by the miniature speaker used than by any deficiencies in the amplifier. The current consumption of the receiver at an average listening level is around 7 mA, so a small 9 V power pack such as a PP3 should last for several months of normal use. u where R is in kJ2 and fg is in Hz Note fo (Hz) R(k) Made up of Middle C 261.6 127 100+ 27 C # 277.2 120 120 D 293.6 113 100+ 13 D # 311.12 107 68 + 39 E 329.6 101 use 100 k F 349.2 95 68 + 27 F# 370.0 90 68+ 22 G 392.0 85 75 + 10 G # 415.3 80 47 + 33 A 440.0 76 56 + 20 A# 466.2 71 56 + 15 B 493.9 67 56+ 11 music box elektor december 1977 — 12-47 Figure 1. Circuit of the music box. Figure 2. The music box is housed in a cylin- drical drum. When this is rolled along the reed switches close as they move past the magnet. Resistance values for notes an octave above this range are found by simply ’ halving the resistance values given here. It should be noted that, due to toler- ance in the oscillator components and in the threshold levels of the NAND gates, the exact frequencies calculated may not be obtained. However, provided reasonably close tolerance resistors are used for ‘R’, the correct musical inter- vals of the scale will be achieved. Alternatively, a preset potentiometer may be included in series with every resistor to tune each note precisely. Construction The circuit is housed in an empty coffee tin or similar cylindrical container (figure 2). First, a piece of Veroboard is cut to the same diameter as the con- tainer, and the circuit is built up on this with the 1 2 reed switches (or how ever many are required for the desired tune) spaced around the periphery. A hole is drilled at the centre of the board which accepts a bolt to act as a pivot for the magnet, which is suspended at the end of a Meccano (or similar) strip. The base of the tin is pierced with holes, and the loudspeaker is mounted at the bottom of the tin, with the leadout wires taped to the side of the tin to avoid fouling the magnet. The circuit board is then mounted about one third of the way down the tin, and finally the battery, which can be a PP3 or other small 9 V battery. ' So that the drum will roll freely the bat- tery should be fixed with its centre of gravity coincident with the axis of the , drum. When the drum is rolled along the reed switches will rotate past the magnet and be activated sequentially, thus playing the tune. Of course, if the drum is rolled the wrong way the tune will be played backwards, so it is a good idea to paint an arrow on the drum to indicate the direction of rotation. One important point to note is that the magnet should not be too powerful, nor should the reed switches be too close together, otherwise more than one may be activated at once. H N1...N3=lC1 -CD4011 SI ... S 12 = Reed -Switch E20 — elektor december 1977 The advertisement lease don't pleas leave your issues of elektor hist about a professionally pro- duced magazine deser- ves to be well kept, so keep your elektors in a binder, order your 1978 binder now. available from elektor publishers ltd. These smart green binders will keep your copies of Elektor clean and tidy Each issue is easily removed for precision stick unit SKYLEADER RADIO CONTROL LTD H I I • Ideal for the Elektor slotless model car track. # As used on Britain's finest radio control equipment. # Super smooth stick action in all directions. # Self centering or ratchet action on either axis. • Fine trim adjustments on each axis. The Skyleader precision stick unit has been designed to give proportional control to any two axes. A specially formulated extra hard wearing material is used for the main body and most of the moveable parts. The out-door user will appreciate the noncorrosive stainless steel control stick which can be adjusted in height to suit individual requirements. Each of the two functions uses a 5K ohm wire-wound pot as standard but precision conductive film pots are available at extra cost. Coupled to each pot mechanism is a fine trim adjustment. Self centering or ratchet stick action can be selected for either axis; the ratchet action being ideal for motor speed control. The stick unit is supplied dismantled but assembly Is simple, requiring only a few minutes, and no adjustments should be needed once assembled. Detailed instructions are enclosed with each unit. PRICES INCLUDING VAT SET OF PARTS INCLUDING 5K WIRE- WOUND POTS £4.95 SET OF PARTS WITH 5K CONDUCTIVE FILM POTS £5.95 SET OF PARTS LESS POTS £3.76 POSTAGE & PACKING PE R UNIT 27 p FURTHER UNITS 54p Ask about our range of radio-control equipment, aircraft kits and accessories. Airport House. Purley Way, Croydon. Surrey CRO OXZ Telephone; 01-686 6688