Sunteți pe pagina 1din 30

SUMMER CIRCUITSCOLLECTION

001 Transmitter for Fibre-Optic IR Extender


T. Giesberts
This circuit restores the original modulation of the signal
received from the remote-control unit, which was demodulated
by the receiver unit at the other end of the extender (see
‘Receiver for fibre-optic IR extender’).
If no signal is received, the Toslink transmitter in the receiver
is active, so a High level is present at the output of the Toslink
receiver in this circuit. Buffer IC2a then indicates via LED D1
that the receiver unit is active. The received data are re-mod-
ulated using counter IC3, which is a 74HCT4040 since the
Toslink module has a TTL output. In the idle state, IC3 is held
continuously reset by IC1. The oscillator built around IC2c runs
free. When the output of the Toslink receiver goes Low, the
counter is allowed to count and a carrier frequency is gener-
ated. This frequency is determined by the oscillator frequency
and the selected division factor. Here, as with the receiver, we
assume the use of RC5 coding, so a combination has been cho-
sen that yields exactly 36 kHz. The oscillator frequency is
divided by 29 on pin 12 of the counter, and 18.432 MHz ÷ 29 =
36 kHz. The circuit board layout has a double row of contacts
to allow various division factors to be selected, in order to
make the circuit universal. You can thus select a suitable com-
bination for other standards, possibly along with using a dif-
ferent crystal frequency. The selected output is connected to
four inverters wired in parallel, which together deliver the

D3 D4 R3D2 C1 R1 5V
IC3 IC2b
H1

H2

R4 C2
1M
D1 9
36kHz: 5 - 6 3 4
CTR12 0 1
IC2 IC2c 7 D3
C6

1
5 6 10 6 J1
1 + 2
R2 X1 C3 5 15 16 IC2d
C3 3
X1 3 13 14 9 8 D4
R1

4 1
J1

15p
2 11 12
5 R4
C5 CT 4 9 10
ROTKELE )C(

C1 C2
6 391
IC3 13 7 8 IC2e
7
C7

33p 18.432MHz 33p


12 5 6 11 10
IC1 8 1
L1 11 14 3 4
004021-1
1-120400

CT=0 9
15 1 2
C8 C4 IC4

5V 10
1 IC2f
11
R5 13 12
D5 1
L1
+ 74HCT4040
H3

H4

0 D6
5V
1k

R3
IC1
IC2 = 74HCU04
TORX173
3 D1 D2
47μH
IC2a
R2
1 1 2 RECEIVER TRANSMITTING
1 1k5 ON
004021-1 (C) ELEKTOR

C4
2 4 5 6
100n

IC4
> 9V D6 7805 5V
R5
1N4002
1k

C8 C7 14 C6 16 C5
D5
IC2 IC3
220μ 4μ7 7 8
25V 63V 100n 100n

POWER

004021 - 11
SUMMER CIRCUITSCOLLECTION
drive current for the IR LEDs D3 and D4 (around 50 mA). A sig- COMPONENTS LIST Semiconductors:
nal from the counter is also indicate that data are being trans- D1 = high-efficiency LED, green
mitted, via LED D2. This has essentially the opposite function Resistors: D2 = high-efficiency LED, red
of LED D1, which goes out when D2 is blinking. R1 = 1MΩ D3,D4 = LD271
In the oscillator, capacitor C3 is used instead of the usual resis- R2 = 1kΩ5 D5 = high-efficiency LED, yellow
R3,R5 = 1kΩ D6 = 1N4002
tor to compensate for the delay in IC2c. As a rule, this capac- R4 = 39 Ω IC1 = TORX173 (Toshiba)
itor is needed above 6 MHz. It should have the same value as IC2 = 74HCU04
Cload of the crystal, or in other words 0.5C1 (where C1 = C2). Capacitors: IC3 = 74HCT4040
At lower frequencies, a 1kΩ to 2kΩ2 resistor can be used in C1,C2 = 33pF IC4 = 7805
place of C3. C3 = 15pF
A yellow LED is used for the power-on indicator D5. The cur- C4,C5,C6 = 100nF ceramic Miscellaneous:
rent through this LED is somewhat higher than that of the C7 = 4μF7 63V radial J1 = 16-way double contact row,
C8 = 220μF 25V radial plus jumper
other LEDs. If you use a red high-efficiency LED instead, R5
X1 = 18.432MHz quartz crystal
can be increased to around 3kΩ3. Inductors:
The circuit draws approximately 41 mA in the idle state when L1 = 47μH
the receiver is on. If the receiver is switched off, the transmit-
ter emits light continuously, and the current consumption rises
to around 67 mA.
The PCB shown here is unfortunately not available ready-
made through the Publishers’ Readers Services.
(004021-1)
002 ESR Measurements
T1 = BUZ10,
1...2V BUZ100, D
BUK455
R1

1k
R2

11
G S
5W D
D C
G T1
Capacitor
Under Test
S

004069 - 11

K. Walraven mula, but as you can see from the oscillogram, the voltage first
In a switch-mode power supply, the quality of the output volt- drops quickly, after which the expected exponential curve
age depends strongly on the quality of the electrolytic capac- appears. This fast initial drop is due to the ESR of the capaci-
itors that are used. Here the effective series resistance (ESR), tor, which produces a voltage drop equal to the product of the
which is the internal ‘ohmic’ impedance of the capacitor, is one resistance and the discharge current. The greater the voltage
of the most important factors, since large currents are drop, the poorer the capacitor.
involved. It is rather difficult to exactly measure the ESR, but if If the initial voltage drop is approximately equal to half of the
you only want a quick idea, or you want to compare different charge voltage, as in this case, then we can deduce that the
families of capacitors, the illustrated simple measurement ESR is approximately equal to the discharge resistance of 1 Ω.
setup is very suitable. This is actually a relatively good value for a small, inexpensive
The capacitor under test is charged via the 1-kΩ resistor (R1) 10-μF electrolytic capacitor. As a general rule, you can assume
until its voltage is the same as the applied supply voltage. You that the ESR decreases proportionally as the capacitance
can then calculate the ESR using the formula (U1/U2) – 1 (see increases, and that it also decreases slightly as the voltage on
trace 1 of the oscillogram). This formula is very simple, since the capacitor increases.
we have chosen a value of 1 Ω for R2. The values of the sup- You can drive the FET directly from a pulse waveform genera-
ply voltage and R1 are not critical, since the measurement is tor, if it can deliver a short positive pulse to the gate with an
relative (as shown by the formula). The capacitor is discharged amplitude of at least 6 V (see trace 2). The repetition interval
via a 1-Ω resistor and a power FET. You would expect the dis- must be 100 to 1000 times as long as the width of the positive
charge to occur according to the well-known exponential for- pulse, since the capacitor will otherwise not have enough time

7-8/2000 Elektor Electronics 19


SUMMER CIRCUITSCOLLECTION
to recharge. In most cases, you will only be able to obtain a charge resistance (the sum of R2 and Rds of the FET) is as
stable image on the oscilloscope if it has a storage function. close as possible to 1 Ω.
Almost any type of FET can be used, as long as the total dis- (004069-1)
003 Electronic Stethoscope
B. Kainka
In order to listen to your heartbeat you would normally use a lis-
tening tube or stethoscope. This circuit uses a piezo sounder R1
from a musical greetings card or melody generator, as a micro-
470k
phone. This transducer has an output signal in the order of T1
100 mV and its low frequency response is governed by the
input impedance of the amplifier. For this reason we have cho- BC548 BT1

sen to use an emitter follower transistor amplifier. This has a C1

high input impedance and ensures that the transducer will


100μ 4V5
have a very low frequency response. At the output you just Bz1 R2 R3
need to connect a set of low impedance headphones to be able
1k

470k

to listen to your heartbeat. 2x 321


Replacing the emitter follower with a Darlington transistor
configuration will further increase the input impedance of the
amplifier. 004038- 11

(004038)
004 Heatsink Calculations
K. Walraven
Making heatsink calculations has always been a bit of a nui-
sance. This sample spreadsheet makes life easier. Its main
advantage is that you can see at a glance which heatsink you
need and how hot it will become.
First you have to enter a certain amount of data. Reasonable
default values are already present, so you can simply keep
what is already present for anything that you don’t know.
Let’s have a look at the various fields. You start with the power
that the transistor must handle, in watts. You can calculate
this by multiplying the voltage across the transistor by the cur-
rent through the transistor. Next comes the thermal resistance.
This differs for each type of transistor and package, so you will
have to look it up on the manufacturer’s data sheet under Rthjc
(junction to case). A 7805 in a TO220 package, for example,
has a value of 4, while a 2N3055 in a T03 package has a value
of 1.5. A modern component, such as the Siemens BUZ100 in
a TO220 package, has the unbelievably low value of only 0.6!
After this, you need to know the thermal resistance value for
the insulator (if one is used). If no insulator is used, enter a degrees is usually the maximum allowed value (175 is only for
zero. A few typical values are: flexible plastic: 0.4; aluminium the most recent components), and 125 is a safer value that is
oxide (hard, white, 1 to 2 mm thick): 0.3; mica: 0.4. In addition, always acceptable.
it makes a difference whether or not heat-conducting paste is However, you may want to avoid having the heatsink become
used. Here you can only select between yes (1) and no (0). The too hot. According to safety regulations, any heatsink that is
spreadsheet will then automatically fill in either 0.1 or 0.5, exposed to touch must not be hotter than 60 degrees. A
respectively. heatsink that becomes hotter than this must be protected
Next, enter the desired maximum temperature. For example, against being touched. If you don’t care about this, you can
the internal temperature of the transistor may not be allowed enter a higher value here.
to be higher than 125, 150 or 175 degrees. You can find this The program now displays a result consisting of four values.
value on the data sheet of the component in question (maxi- The first is the required heatsink specification in degrees per
mum junction temperature). If you don’t know the value, 150 watt. This represents the larger of the two heatsinks required

20 Elektor Electronics 7-8/2000


SUMMER CIRCUITSCOLLECTION
to maintain the maximum transistor temperature and to you insight into the relationship between the heatsink and the
remain below the maximum heatsink temperature. In addition, temperature of the transistor.
you will see the internal temperature of the transistor, the tem- The spreadsheet is available from the Download section of the
perature of the heatsink and a suggestion for a suitable Elektor Electronics website at
heatsink (type and length), such as ‘SK85, 75 mm’. Several dif- http://www.elektor-electronics.co.uk
ferent suggestions may be displayed in a row, as in the illus- If you want to modify the program, you will first have to dis-
tration. This is only a very limited suggestion, but it does give able the protection and make the invisible columns visible. We
you a quick impression. Furthermore, you are always depend- (and other readers) would enjoy hearing about any improve-
ent on what your dealer has in stock, and he can work with ments you make.
the calculated value of degrees per watt. You will see that it’s (004084-1)
fun to play around with various input values, and this will give
005 Precision Electroscope
P. Lay U+
This circuit can precisely measure electrostatic charge. The * see text

charge to be measured is stored on C1 (a high quality MKT zie tekst


*
capacitor with a value of 1-2 μF). The voltage (U) across the 2
7
S2: open 0 - 2000V
capacitor (C1) is related to its charge (Q) by the equation U = IC2
6 3 7
closed 0 - 4000V
Q/C1. Operational amplifier IC2 buffers this very high imped- 3
IC3
6
2 R1 R3 R7
ance source. An input lead is connected to one side of capac- 4

100k

100k
MAX4322 4
itor C1 and terminated with a test probe. The other side is con-
MAX4322
nected to an earth lead and to a convenient earth point. IC3
amplifies the low voltage level at the output of IC2 and drives S2

the moving coil meter M1 (±100 μA to ±1 mA centre zero).


M1
Switch S2 allows selection between two measurement ranges. R2 - 100μA 100μA
C1 C2
With S2 closed the amplification factor is 5 and when open the

10k
amplification factor is 10. The internal impedance of P1 is * 1μ
GND 16V
2.2 kΩ. Alternatively a digital multimeter can be used in place
of P1, in this case resistor R7 (2-20 KΩ) can be omitted. Low
Current LED D2 indicates that the electroscope is on. U–
The operational amplifiers used here are MAX4322 from
Maxim. The common mode input voltage for these devices can
U+
go to the supply rails; likewise the outputs will drive from rail C3
R4 R6 R8

5601
100k

5k6
to rail. The maximum supply voltage is 6.2 V, hence the need for
zener diode D1 to limit the supply voltage. A full data sheet 1μ
16V 3...5mA
can be obtained from www.maxim-ic.com. 7 3
The operational amplifier IC1 produces a symmetrical sup- 6 C6
D1 S1
IC1
ply with a centre rail (earth) from the 9-V battery. The supply 2
BT1
current for the electroscope is in the order of 5 mA, most of 4 4μ7 6V2
16V
which is used by the zener diode D1. Alternatively, the oper- MAX4322
ational amplifiers can be replaced by a type that can operate at 9V
a higher supply voltage. For example IC2 and IC3 can be R5 D2
replaced by a single (dual op-amp) TLC272 (see the DIL out- C4 C5
100k

line for this device to assign the new pins). IC1 can be 1μ 1μ
red
16V 16V rood
replaced by a TLC271 (pin 8 should in this case be connected U–
to earth and pins 1 & 5 left unconnected). The maximum sup- 004011 - 11

ply voltage for these IC’s is 16 V so zener diode D1 can be


omitted which will bring the supply current down to 3 mA.

Operation of the precision electroscope is simple:

1. Switch on S1, LED D2 lights.


2. The test probe is touched to the earth lead to discharge TLC271 TLC272
capacitor C1 before a measurement is made. Alternatively
a small push button switch can be wired in parallel to C1 OFFSET BIAS V DD
N1 1 8 SELECT OUT1 1 8
to discharge it.
– IN 2 7 V DD – IN1 2 7 – IN2
3. The test probe is now touched onto the charged part.
4. The meter will show any charge, its polarity and its value. + IN 3 6 OUT + IN1 3 6 + IN2
5. After use, turn off to save the batteries. GND OFFSET GND OUT2
4 5 N2
4 5

(004011)

7-8/2000 Elektor Electronics 21


SUMMER CIRCUITSCOLLECTION

006 Adapter for SB Live! Player 1024


T. Giesberts
In the December 1999 issue, we published a design for a dig-
ital extension for the Sound Blaster Live! Value Player (circuit
board #990079-1). This sound card has a 12-pin Audio Exten-
sion connector. The successor to this card is the Live! Player
1024, which has a 40-pin connector that includes the same
inputs and outputs (plus others), but in different positions. To
allow the extension to be used with the new sound card as
well, we have developed an adapter card that makes the con-
nections easy. The necessary signals from the 40-pin connec-
tor are passed through to a 14-pin connector whose pin
assignments match those of the extension card. The accom-
panying table describes the available inputs and outputs on

Table 1. 004085-1
AUD_EXT connector pin assignments for the SB Live! Player 1024.

H1
H2

K1

Pin Name Description K2


IN2
1 VCC Supply+5 V
2 VCC Supply+5 V
3 GND Earth
IN1
4 AC97CLK Clock output 4.5 MHz
5 GND Earth JP1
6 GP_SPDIFIN#2 S/PDIF input 2
H5

7 GND Earth
8 GND Earth K3
9 SPDIFO#3 S/PDIF output 3 JP2
10 GPO1 Output 1 (general purpose)
11 GPO2 Output 2 (general purpose)
12 GND Earth
SBLive! 1024

13 GPO0 Output 0 (general purpose)


I2S

14 GND Earth
H3

H4

1-580400 004085-1
15 GP_SPDIFIN#1 S/PDIF input 1 ROTKELE )C( (C) ELEKTOR

16 GND Earth
17 SPDIFO#0 S/PDIF output 0
18 GND Earth SPDIFO#2
SPDIF_IN GP_SPDIFIN#2
19 SPDIFO#1 S/PDIF output 1
20 GND Earth K2 K1

21 GND Earth 2 1 SPDIFO#0 1 2


4 3 3 4
22 SPDIFO#2 SPDIF output 2
6 5 JP1 5 6
23 GPI0 Digital general-purpose input 0 (reserved) 8 7 7 8
24 GPI1 Digital general-purpose input 1 (reserved) 10 9 IN2 9 10

25 OUTMIDI MIDI output 12 11 IN1 11 12


14 13 13 14
26 GND Earth
GP_SPDIFIN#1 15 16
27 INMIDI MIDI input 17 18
to 990079/K4
28 GND Earth SPDIFO#1 19 20
29 KEY 21 22
SPDIFO#3 23 24
30 KEY
25 26
31 ADCSDO2 I2S input 2 for audio data 27 28
32 GND Earth JP2 29 30
33 ADCSDO1 I2S input 1 for audio data 5 6 ADCSDO2 31 32
K3
34 GND Earth 3 4 ADCSDO1 33 34
2 1 1 2 ADCSDO0 35 36
35 ADCSDO0 I2S input 0 for audio data
4 3 37 38
36 GND Earth 6 5 I2SCLK 39 40
37 I2SCLK Serial bit clock for I2S 8 7 I2SFS

38 GND Earth 10 9 SBLive Player


1024
39 I2SFS Frame sync
I2S
40 GND Earth 004085 - 11
SUMMER CIRCUITSCOLLECTION
COMPONENTS LIST JP2 = 2x3- way SIL header with With regard to the four outputs, output 0 provides the S/PDIF
jumper signal for normal two-channel information. The other outputs
Miscellaneous: K1 = 40-pin boxheader also provide signals when (for example) AC3-encoded DVDs
JP1 = 3-way SIL header with K2 = 14- pin boxheader (5.1-channel Dolby Digital) are played back, if this is supported
jumper K3 = 10- pin boxheader by the hardware/software player. In this case, output 1 pro-
vides a non-decoded data stream. As an extra feature, the I2S
inputs can also be connected through to the ten-pin connec-
tor K3, but it appears that this is not supported by Live!Ware 3.0
the 40 pins (see also the help menu of the software for the new for the 1024 card. JP2 can be used to select which of the three
sound card). The 40-pin connector has two inputs, one of data inputs is connected to K3, but we have not been able to
which can be selected using JP1. Apparently, only the first of determine what if any benefit this may provide.
these inputs is supported in the SB Live!Ware 3.0 software. (004085-1)
007 3-volts Car Adapter
A. Grace
This circuit is based on a standard LT1074CT switching regu- 2 1
VC FB
lator IC. For sure, Application Note AN35 published by Linear D2 L1
5 IC1 4
Technology describes the design far more elegantly than the VIN VSW
270μH
author could in this short article. Interested readers are there- 1N4001 LT1074CT
fore strongly advised to get a copy of AN35. R2 GND R1
J2 D1 J1
3
1k

The schematic shows the LT1074CT used as a positive

2k0
C3 C1
step-down or ‘buck’ converter. The ‘switcher’ is used to con- 1N5818
vert a +12-volt car battery voltage down to +3 volts for use 470μ R3 470μ
2k7

with the personal hi-fi’s and handheld games for the author’s
two boisterous children on long car journeys. Note at under
ten years of age, children will rarely be hi-fi aficionado’s and
are generally not concerned with any noise generated by the
‘switcher ‘circuit. 000014 - 11

The circuit is connected to the car +12-V system via the


cigarette lighter socket — is advisable to use a fused version
of the cigarette lighter plug. The +12-V arrives on the board effect of the switcher. Components R2 and C2 provide fre-
via screw- terminal block J2. Diode D2 provides a reverse volt- quency stabilisation for the feedback loop. Inductor L1 along
age protection, while C3 decouples the input to the switcher IC. with the LT1074CT form the main switching components,
The LT1074CT briskly switches the supply voltage on and off while C1 provides decoupling for the output load. The 3-V out-
in response to the signal applied to its F/B input, to the extent put voltage is taken from screw terminal J1.
that the average output voltage is at the required level. The With this circuit built, boxed up and installed in your car,
values of potential divider resistors R1-R3 have been chosen you can look forward to possibly your first ‘quiet’ long car
to attenuate the output voltage so that there is 2.5 V at the F/B journey.
pin. The difference between the attenuated output voltage and (000014-1)
the internal 2.5-V reference is used to control the modulation
008 Noise-Driven Sound Generator
G. Kleine output signal from this gate passes via C1 to a second 4011
The sound generator shown here uses its built-in loudspeaker gate, which triggers a monostable formed by the two gates
as a microphone when it is in the standby state. As soon as it located before and after C5 and R5. The DC threshold level is
detects a noise that exceeds an adjustable threshold level, it applied to pin 2 of IC1 via R2. This DC voltage is superim-
becomes active. This small, clever circuit can be used as an posed on the signal from C1. Retriggering of the monostable
alarm generator that reacts to noises. You can also use it to is prevented by the combination of R4, C4 and the first gate,
help you locate an object in response to a loud sound, such as in addition to which the sound generator (IC2) prevents the
clapping your hands or whistling loudly. loudspeaker from acting as a microphone once it has been
The gate at the bottom of the schematic diagram acts as a lin- activated.
ear low-frequency amplifier, due to the negative feedback A High output signal from pin 4 of the monostable enables a
resistor R3. It receives its input signal from loudspeaker LS1, pair of astable multivibrators in IC2. The first of these is a low-
which acts as a microphone when T1 is cut off. The amplified frequency generator, which modulates the audio-frequency

7-8/2000 Elektor Electronics 23


SUMMER CIRCUITSCOLLECTION
tone produced by the second 5 - 9V

multivibrator. The result is a


14 C3 14
‘siren’ sound. Finally, T1 is C8
C5 IC1 IC2 IC1; IC2 = 4011B
IC1c
8 10μ 7 100n 7
driven via R8 to push the loud- 10 100μ LS1
& 9 16V
speaker quite hard. The loud-
R1
speaker current is limited a lit- R5

1M

68k
R7
tle bit by R9. C7 8 - 161
220k

The duration of the alarm sig- R4 4n7


IC1b IC2c IC2d T1
nal is determined by the 6 IC2a IC2b 8 12 R8
4 1 5 10 11

1M
5 & 3 4 9 & 13 & 4k7
monostable time constant of 2 & 6 &
R5 and C5. A Low level on pin IC1a
1 R6 BC548
3 C6
4 of IC1 blocks the sound gen- 2 &
R9
220k

R2 2μ2
erator. After the time delay
417

C4
determined by R4 and C4 has

expired, the loudspeaker once 47k

again acts as a microphone.


IC1d
The circuit can be powered by C1 12 C2
11
a 5 V to 9 V battery. & 13
100n 100n
R3 004040 - 11
(004040-1)
1M
009 DIY Front Panel Foils
Using an inkjet printer and self- adhesive foil
W. Foede

It is fairly easy to produce professionally looking, permanent


front panel foils (‘decals’) for use on electronic equipment if
you have a PC available along with an inkjet printer (Hewlett-
Packard DeskJet or similar). Plus, of course, matt transparent
sheet of the self-adhesive type as used, for instance, to pro-
tect book covers. This type of foil may be found in stationery
shops or even the odd building market. One foil brand the
author has used successfully goes by the name of Foglia Trans-
parent. The production sequence is basically as follows:

1. The decal is designed at


true size (1:1 or 100%) with a
graphics program or a word
processor, and then printed in
black and white on a sheet of
white paper (do not use the top of the decal. The foil is lightly pressed and then slowly
colour ink cartridge). Allow pulled off the paper again (see photograph). Because the adhe-
the ink to dry. Cut the foil as sive absorbs the ink to a certain extent, the mirror image of
required, then pull the adhe- the decal artwork is transferred to the adhesive side of the foil.
sive sheet from the paper car-
rier sheet. Keep the carrier 3. For further processing, first secure the foil on the carrier
paper handy, it will be used in paper again. Next, cut the decal to the exact size as required by
the next phase. the equipment front panel. Finally, pull off the carrier sheet
again and apply the transparent foil on to the metal or plastic
2. Once the ink has dried, the surface.
transparent foil is placed on (005090-1)
SUMMER CIRCUITSCOLLECTION

010 Receiver for Fibre-Optic IR Extender

5V

R1 R2 R3
471

4k7

417
IC2
C1 TOTX173
3
R4
220μ 25V IC1 2
2 8k2
4
3
C2 1

1
SFH506 100n
-36

IC3
D2
> 9V 1N4002 78L05 5V
R5
3k3

C4 C3

D1
220μ 4μ7
25V 63V

POWER

004020 - 11

T. Giesberts
There are various types of remote-control extenders. Many of 0 +
D2
H1

H2

them use an electrical or electromagnetic link to carry the sig- R5 D1


C1

nal from one room to the next. Here we use a fibre-optic cable. R1
IC3

C3
The advantage of this is that the thin fibre-optic cable is eas- C4
ier to hide than a 75-Ω coaxial cable, for example. An optical
ROTKELE )C(

(C) ELEKTOR

link also does not generate any additional radiation or broad-


IC2
IC1

R4
R3
R2

cast interference signals to the surroundings. We use Toslink


modules for connecting the receiver to the transmitter. This is
C2
H4

not the cheapest solution, but it does keep everything com-


H3

004020-1
pact. You can use a few metres of inexpensive plastic fibre- 1-020400 004020-1

optic cable, instead of standard optical cable for intercon-


necting digital audio equipment. The circuit has been tested
using ten metres of inexpensive plastic fibre-optic cable
between the receiver and the transmitter (which is described
elsewhere in this issue). COMPONENTS LIST
The circuit is simplicity itself. A standard IR receiver/demod-
ulator (IC1, an SFH506) directly drives the Toslink transmitter Resistors:
IC2. We have used the RC5 frequency of 36 kHz, but other R1 = 47Ω
standards and frequencies could also be used. Both ICs are R2 = 4kΩ7
R3 = 4Ω7
well decoupled, in order to keep the interference to the R4 = 8kΩ2
receiver as low as possible. Since the Toslink transmitter R5 = 3kΩ3
draws a fairly large current (around 20 mA), a small mains
adapter should be used as the power source. Capacitors:
There is a small printed circuit board layout for this circuit, C1,C4 = 220μF 25V radial
which includes a standard 5-V supply with reverse polarity C2 = 100nF ceramic
protection (D2). LED D1 is the power-on indicator. The supply C3 = 4μF7 63V radial
voltage may lie between 9 and 30 V. In the absence of an IR
Semiconductors:
signal, the output of IC1 is always High, and the LED in IC2 is D1 = high-efficiency LED
always on. This makes it easy for the transmitter unit to detect D2 = 1N4002
whether the receiver unit is switched on. IC1 = SFH506-36 (Siemens)
The PCB shown here is unfortunately not available ready- IC2 = TOTX173 (Toshiba)
made through the Publishers’ Readers Services. IC3 = 78L05
(004020-1)
SUMMER CIRCUITSCOLLECTION

011 Noise Injector


T. Giesberts 12V L K1
R7 R8
This circuit is primarily 10k 10k
R5
intended to be used by per- R1
R3 33k

100k
sons who want to experiment 33k 2 K3 L
R6 R9
with audio. For example, you C1
6
10k IC2a
1
1001
7
can determine whether your 10V
2
IC1b
3
1 5
own audible threshold for 220n IC1a C2
3
noise is different with and
2μ2
without music, or whether a T1 CW R2 R4 CW
IC1, IC2 = NE5532
particular CD sounds better

10k

10k
P1 P2
with a little bit of noise. How- 10k
ever, since this circuit pro- BC557B 100k
R10 R12
duces white noise, it can also
10k 10k
be used for test measure- IC3
ments, such as comparing the 15V 78L12 12V
R K2 6 K4 R
R11 R13
sounds of different loudspeak- 7
10k IC2b 1001
ers, measuring filter charac- C8 C4 8 C6 8 5
C3
teristics and so on. IC1 IC2
470μ 4 4
The measured characteristics, 25V 100n 100n 10n

as shown in Figure 2, show a


nearly flat amplitude distribu- C9 C5 C7
tion (averaged over 64 meas-
470μ
urements). The effective value 25V 100n 100n
004089 - 11
of the noise signal at the out-
put is around 100 mV maxi- 15V
mum (with both potentiome-
ters set to maximum), meas-
ured over the frequency range of 22 Hz to 22 kHz. amplifier (IC2). We have used a stereo arrangement, in which
The noise is generated by reverse-biasing the base-emitter both channels receive the same noise signal. If you want to
junction of a PNP transistor (BC557B) so that it zeners. In our expand on the design, you can provide each channel with its
prototype, the voltage across T1 was approximately 10 V. P1 own noise generator. In this case, you will have to use a dual
is used to set the level of the generated noise so that it is just potentiometer for P2.
audible, following which the output level can be adjusted The well-known NE5532 is used for the amplifiers, but any
using the logarithmic potentiometer P2. For making measure- other good dual opamp would also be satisfactory. The
ments, P1 can also be simply set to its maximum position. The opamps are fed from a standard, symmetrical ±15-V supply.
noise is amplified by two opamp stages. Depending on the In order to suppress possible positive feedback via the power
transistor manufacturer, or the type of transistor if you use a supply, and to reduce the effects of power supply noise (since
different type, the level of the generated noise can vary sig- the opamps are non-inverting), the supply for the noise diode
nificantly. Using two amplification stages in series provides circuit (R1 and T1) is separately stabilised by IC3 (7812) and
more options and considerably more bandwidth, and you can extra filtering for the ±15-V supply is provided by C8 and C9.
implement various filter characteristics around IC1a and IC1b IC3 must be located as close as possible to R1, T1 and IC1. The
according to your own taste. The gain of the two stages has coupling capacitors C1 and C2 are necessary to prevent the
been kept equal to ensure the maximum possible bandwidth. DC component of the noise signal from appearing at the out-
The amplified signal is then passed to a simple summing puts.
The table lists some measured characteristics of the circuit,
for a bandwidth B of 22 Hz to 22 kHz and a reference level of
+0
2 Veff.
-5
(004089-1)
-10

-15

-20

-25

-30

-35

-40

-45
d
B
r
-50
THD + N (1 kHz, P2 min.) < 0.0005 %
-55

-60 Noise level (P2 min.) – 107 dB


-65

-70
Noise level (P1 min. / P2 max.) – 88 dB
-75

-80
Noise level (P1 max. / P2 max.) – 25 dB (112 mVeff)
-85
Noise level (P1 max. / P2 max. / B > 500 kHz) – 10.5 dB
-90

-95 Gain (K1/K3, K2/K4) –1x


-100
20 50 100 200 500 1k

Hz
2k 5k 10k 20k 50k 90k

004089 - 12
Current consumption 21 mA
SUMMER CIRCUITSCOLLECTION

012 Bipolar Stepper Motor Control


IC2 = 4001 IC2a 5V
1
IC3 = 4030 3
2 *1
IC2 = 4049
T1 T2
R1 2x R3
IC3a a BC517 b
10 2 IC3d 4k7 4k7
U/D 3 12
15 1 =1 11 1d L1
CLK 13 =1
4 IC1 6
A1 Q0 IC4a T3 L1 T4
12 11 R2 <0A5 R4
A2 Q1 3 2 1a d c
13 14 1 4k7
2x 4k7
A3 Q2
3
4516 Q3
2 BC517
A4
5 IC2b
CI 6
1 7 4 2c
PE CO 5 *1
RST 5V
9 2d
IC3b
6 IC2c T1 T2
4 8 2x
5 =1 10 2a R1 R3
9 *1 a BC516 b
5V 10k 10k

L2
2b
16 14 14 1 T3 L1 T4
IC2d R2 <0A5 R4
IC1 IC2 IC3 IC4 IC3c 13 d c
9 11 1c 10k 10k
8 7 7 8 10 12 *1 2x
8 =1 BC517

1b
004086 - 11

K. Walraven (text) and must be reversed. We thus need an inverted signal in place of
R.T.J.M. van der Heijden (design) 1a. Fortunately, this is available in the form of 1d. The same
situation applies to 1b (1c), 2a (2d) and 2b (2c). In this case,
The subject of stepper motors is clearly very popular, with IC4 is not necessary.
many reader responses to every published article. A design Stepper motors are often made to work with 12 V. The logic
for a unipolar controller appeared in the May 1999 issue, and ICs can handle voltages up to 15 to 18 V, so that using a sup-
now we present a bipolar version. First, we want to explain ply voltage of 12 V or a bit higher will not cause any problems.
how such a controller works and what’s involved. A bipolar With a supply voltage at this level, the losses in the bridge cir-
motor has two windings, and thus four leads. Each winding cuits are also not as significant. However, you should increase
can carry a positive current, a negative current or no current. the resistor values (to 22 kΩ, for example). You should prefer-
This is indicated in Table 1 by a ‘+’, a ‘–‘ or a blank. ably use the same power supply for the motor and the con-
A binary counter (IC1) receives clock pulses, in response to troller logic. This is because all branches of the bridge circuit
which it counts up or down (corresponding to the motor turn- will conduct at the same time in the absence of control sig-
ing to the left or the right). The counter increments on the pos- nals, which yields short-circuits.
itive edge of the pulse applied to the clock input if the up/dwn (004086-1)
input is at the supply level, and it decrements if the up/dwn
input is at earth level. The state of the counter is decoded to
produce the conditions listed in Table 2. Table 1. Driving the windings.
Since it must be possible to reverse the direction of the cur- Phase 2 1 2 3 4 5 6 7 8
rent in the winding, each winding must be wired into a bridge Winding 1 + + – – – +
circuit. This means that four transistors must be driven for Winding 2 + + + – – –
each winding. Only diagonally opposed transistors may be
switched on at any given time, since otherwise short circuits
would occur.
At first glance, Table 2 appears incorrect, since there seem to
always be four active intervals. However, you should consider Table 2. Decoded counter states.
that a current flows only when a and c are both active. Phase 1 2 3 4 5 6 7 8
The proper signals are generated by the logic circuitry, and 1a + + + +
each winding can be driven by a bridge circuit consisting of 1b + + + +
four BC517 transistors. Two bridge circuits are needed, one for 1c + + + +
each winding. The disadvantage of this arrangement is that 1d + + + +
there is a large voltage drop across the upper transistors in 2a + + + +
particular (which are Darlingtons in this case). This means 2b + + + +
that there is not much voltage left for the winding, especially 2c + + + +
with a 5-V supply. It is thus better to use a different type of 2d + + + +
bridge circuit, with PNP transistors in the upper arms. This of
course means that the drive signals for the upper transistors
SUMMER CIRCUITSCOLLECTION

013 Compact Switching Step-Down Converter


H. Steeman 4V0...11V6
Switch-mode power supplies are used in electronic circuits to
increase (step up) or reduce (step down) voltage levels in the 6 1
most efficient manner possible. Compared to linear voltage V+ VOUT
L1
regulators, switch-mode supplies convert relatively little IC1 5
LX
energy into heat. Their efficiency is thus high. This is a major MAXIM 100μH R3
8
SHDN
advantage with compact power supplies in particular, since MAX639
it sometimes makes forced-air cooling unnecessary. MAX640 7
VFB
Building a switch-mode supply is considerably easier if you MAX653
use components that have been specially developed for this GND LBI
D1 R4
application. One example of such an integrated step-down C1 4 3 C2

converter is the Maxim MAX639. This is designed for a fixed


100μ 100μ
output voltage of +5 V, with an input voltage ranging between 1N5817
16V 16V
+5.5 and +11.5 V. Although this IC is primarily designed for a
fixed output voltage, the output voltage can be tailored using 004061 - 11

a simple feedback network. With the given component values,


resistors R3 and R4 determine the output voltage, with
output current is 100 mA. If desired, a different type of Schot-
R3 = R4 [(Vout / 1.28) – 1] tky diode with similar specifications can be used in place of
D1 (a 1N5817). Inductor L1 must be suitable for a maximum
The value of R4 may lie between 10 kΩ and 10 MΩ, but a value current of 500 mA.
of 100 kΩ is a good choice for most applications. The maximum (004061-1)
014 White LED Lamp
D1
5...12V L1 PBYR745

200μH
D12

D2 D6 D13
LM2585T-ADJ 10V
D11
IC1 D7 D14
5 4 D3
VIN SWITCH
10V
LM2585T- D10
ADJ 2 D8 D15
D4
FBACK
10V
COMP GND D9

1 3 D5
10V

R1

1k2
123 45

C1 C2 C3
R2

681
100μ 680n 100μ
16V 63V

004024 - 11

K. Walraven this converter supplies a constant current instead of a constant


Nowadays you can buy white LEDs, which emit quite a bit of voltage. A resistor in series with the LEDs produces a voltage
light. They are so bright that you shouldn’t look directly at drop that depends on the current through the LEDs. This volt-
them. They are still expensive, but that is bound to change. age is compared inside the IC to a 1.25-V reference value, and
You can make a very good solid-state pocket torch using a few the current is held constant at 18.4 mA (1.25 V ÷ 68 Ω).
of these white LEDs. The simplest approach is naturally to use The IC used here is one of a series of National Semiconductor
a separate series resistor for each LED, which has an operating ‘simple switchers’. The value of the inductor is not critical; it
voltage of around 3.5 V at 20 mA. Depending on the value of the can vary by plus or minus 50 percent. The black Newport coil,
supply voltage, quite a bit of power will be lost in the resistors. 220 μH at 3.5 A (1422435), is a good choice. Almost any type
The converter shown here generates a voltage that is high of Schottky diode can also be used, as long as it can handle at
enough to allow ten LEDs to be connected in series. In addition, least 1 A at 50 V. The zener diodes are not actually necessary,

44 Elektor Electronics 7-8/2000


SUMMER CIRCUITSCOLLECTION
but they are added to protect the IC. If the LED chain is COMPONENTS LIST Inductors:
opened during experiments, the voltage can rise to a value L1 = 200μH 1A
that the IC will not appreciate. Resistors:
The PCB shown here is unfortunately not available ready- R1 = 1kΩ2 Semiconductors:
made through the Publishers’ Readers Services. R2 = 68Ω D1 = Schottky diode type
PBYR745 or equivalent
(004024-1)
Capacitors: D2-D5 = zener diode 10V, 0.4W
C1 = 100μF 16V radial D6-D15 = white LED
C2 = 680nF IC1 = LM2585T-ADJ
C3 = 100μF 63V radial (National Semiconductor)

IC1 D6...D15
D1 H3

H4
C1

D2
D4
C2

R1
D3
C3

D5
004024-1
H1

H2
1-420400 004024-1
ROTKELE )C( L1 R2 (C) ELEKTOR
015 Low-Noise Microphone Amplifier
H. Steeman
15V
D1 R1
The signal from a microphone is two weak for a standard line C2 C3
input. This low-noise DC-coupled microphone amplifier pro-

2501
10n 10μ
vides a solution for anyone who wants to connect a micro- T2
phone to his or her hi-fi installation. As can be seen from the
schematic diagram, a good circuit does not have to be com-
plex. A differential amplifier is built around T1 (MAT-03E), 2N2907A
which is a low-noise dual transistor. The combination of T2 3 T1 5
U in R6
and LED D1 forms a constant-current source for the input 2 6
MAT-03E 1001
stage. A low-noise opamp (OP-270E) amplifies the difference R5
C1
1 7 OP-270E
10k

signal that appears at the collectors of the dual transistor. The


2 8 50p
result is an analogue signal at line level. The bandwidth of the U out
amplifier ranges from 1 Hz to 20 kHz. Within the audio range 1
IC1
3
(20 Hz to 20 kHz), the distortion is less than 0.005 percent.
4
Since only half of the OP-270E is used, the remaining opamp
could be used in the output stage of a stereo version.
R3 R3 R4
The amplifier can be powered from a stabilised, symmetrical C4 C5
5k
5k

27k

supply with a voltage between ±12 V and ±15 V. Such sup-


10n 10μ
ply voltages are already present in many amplifiers.
15V
(004057-1) 004057 - 11
016 Power-On Sequencer
A. Grace 1-2-3-4, at which point the count is suspended. Pressing
This circuit was developed to turn on power supplies in switch S1 allows the counting to continue. Counter outputs
sequence, and then turn them off again in the reverse Q5 to Q8 are used to reset the latches in the reverse order, i.e.,
sequence. This can be helpful for experimenting with equip- 4-3-2-1. The last output, Q9, is used to halt the counter.
ment and circuits whose power has to be applied and removed When power is applied, C2 and R2 initially keep the counter
in a particular order (like the PC/EPROM-Programmer combi- reset. When the power supply voltage is stable, the reset sig-
nation used by Elektor’s Software Service Department; Ed.) nal will go low and the 4017 will begin to count the 1-Hz clock
The heart of the circuit is the venerable 4017 CMOS decade signal supplied by an oscillator consisting of IC1d, R3 and C3.
counter. Outputs Q1 to Q4 are used to set latches in the order The outputs of the 4017 are actuated in sequence with each

7-8/2000 Elektor Electronics 45


SUMMER CIRCUITSCOLLECTION
rising edge of the clock pulse
— but as the next clock pulse
5...15V 5...15V
comes along the previous out-
put is de-activated. The R1
latches in the quad RS-latch

4k7
type 4043 enable the outputs IC1 = 4093B 14 C1 16 C4 16

to stay active. IC2 stops count- IC1 IC2 IC3


IC1b S1
5 C5 7 8 8
ing at Q4 due to IC1b which 4 100n 100n
IC1a & 6
removes the clock enable sig- 2 100n
3
nal on pin 13 via IC1a. To & 1
COUNT DOWN
enable the 4017 to continue 5...15V
IC1c 10 0mA1
counting and hence turn off
the outputs, S1 has to be & R4 R5 R6 R7
IC3
closed, thus restoring the
1M
1M
1M
1M

8 9 5
R3 EN
clock enable on pin 13.
4M7
CTRDIV10/ 0 3
Counter outputs Q5 to Q8 are DEC 2
1
connected to the reset inputs IC1d IC2 4 4
12 2 1S 2
of the latches, so as IC2 incre- 11 14 7 3 1Q
13 & 3 1R
& +
10 6 J1
ments, the latches are reset in 4 2S 9
C3 13 1 7 2Q
the opposite sequence. 5...15V 5 2R
5 12
The count is finally halted 4017B 6 3S 10
1μ 16V 6 11 3Q
C2 7 3R
at Q9 by IC1c, which again 15 9 14
CT=0 8 4S 1
removes the clock enable sig- 11 15 4Q
22μ 16V 9 4R
nal. Weak pull-up resistors 12
R2 CT*5 4043B
(R4-R7) are used on the latch 1M
‘reset’ inputs to prevent unde-
004018 - 11
fined start conditions.
(004018-1)
017 ±5-V Voltage Converter
G. Kleine C1 C3

A symmetrical ±5 V power supply is often needed for small, 2μ2 2μ2


battery-operated operational amplifier projects and analogue 13 14 12
circuits. An IC that can easily be used for this purpose is the C1P C1N VDBL LM2685 +5V
National Semiconductor LM 2685. It contains a switched- 1 VIN Voltage V05 10 C4 50mA max
+5V LDO
capacitor voltage doubler followed by a 5-V regulator. A voltage Doubler
4μ7
inverter integrated into the same IC, which also uses the
switched-capacitor technique, runs from this output voltage. 11 +5V
BT1 Oscillator VPSW switched
The external circuitry is limited to two pump capacitors and 130kHz VNSW 4
- 5V
three electrolytic storage capacitors. Voltage switched
Inverter 3
The IC can work with an input voltage between +2.85 V and 2 GND
Thermal VNEG - 5V
+6.5 V, which makes it well suited for battery-operated equip- Shutdown 15mA max
C5
ment. The input voltage is first applied to a voltage doubler CE SDP SDN C2P C2N
operating at 130 kHz. The external capacitor for this is con- 2V85...6V5 5 6 7 9 8 4μ7
C2
nected to pins 13 and 14. The output voltage of this doubler is
filtered by capacitor C3, which is connected to pin 12. If the 2μ2
H = Normal
input voltage lies between +5.4 and +6.5 V, the voltage dou- L = Shutdown H = VPSW /VNSW off
004045 - 11
L = Normal
bler switches off and passes the input voltage directly through
to the following +5-V low-dropout regulator, which can deliver
up to 50 mA. C4 is used as the output filter capacitor. connected circuit on or off, without having to disconnect the
All that is necessary to generate the –5-V output voltage is to battery.
invert the +5-V voltage. This is done by a clocked power-MOS The SDP and SDN inputs can be used to switch the VPSW and
circuit that first charges capacitor C2, which is connected VNSW outputs, respectively. These two pins are connected to
between pins 8 and 9, and then reverses its polarity. This the voltage outputs via two low-resistance CMOS switches.
chopped voltage must be filtered by C5 at the output. The This allows the negative output to be separately switched off,
unregulated –5 V output can supply up to 15 mA. whereby the voltage inverter is also switched off. Switching
The LM 2865 voltage converter IC also has a chip-enable input off with SDP not only opens the output switch but also stops the
(CE) and two control inputs, SDP (shut down positive) and oscillator. There is thus no longer any input voltage for the
SDN (shut down negative). If CE is set Low, the entire IC is –5 V inverter, so the –5 V output also drops out. The SDP and
switched off (shut down), and its current consumption drops to SDN inputs are set Low (< 0.8 V) for normal operation and
typically 6 μA. The CE input can thus be used to switch the High (>2.4 V) for switching off the associated voltage(s).

46 Elektor Electronics 7-8/2000


SUMMER CIRCUITSCOLLECTION
The positive output of the LM 2865 is short-circuit proof. How- The full type number of the IC is LM 2685MTC. It comes in a
ever, a short circuit between the positive and negative out- TSSOP14 SMD package. National Semiconductor can be found
puts must always be avoided. The IC is protected against ther- on the Internet under www.national.com.
mal destruction by an overtemperature monitor. It switches (004045-1)
off automatically at a chip temperature of around 150 oC.
018 JAL for the PIC84
W. van Ooijen
JAL stands for ‘Just Another Language’, and it is a program-
ming language similar to Pascal for the PIC 16C84, PIC 16F84,
Scenix SX18 and Scenix SX28. The author is not a fan of C. He
found it easier to write his own programming language, which
meets his needs and preferences, and which in addition bet-
ter matches the features (or lack thereof) of the microproces-
sors in question. You can read more about this language in the
summary and examples in the on-line manual. There is also a
FAQ section. Anyone who does not have experience working
with a compiler for the PIC family will find good advice under
‘16x84 assignments’. You can find all of this, as well as com-
pilers for DOS, Windows and Linux (all gratis), at the Internet
site www.xs4all.nl/~wf/wouter/pic/jal/.
A small sample program that causes a LED to blink gives an
impression of the language:

[1] — flash a LED on pin A0


[2] include 16f84_10
[3] include jlib
[4] pin_a0_direction = output
[5] forever loop
[6] pin_a0 = on
[7] delay_1s
[8] pin_a0 = off
[9] delay_1s
[10] end loop

The line numbers are not necessary; they have only been
added for reference. In addition, there are a number of libraries
available with routines such as pic I/O, delays, i2c, asych, ran-
dom, hd44780 (LC display), I/O extensions, math and so on.
(004096-1)
019 Simple Touch Pad Dimmer
B. Kainka
La1
Using a Power-FET it is possible to build a very simple touch
dimmer for low voltage lamps. Two drawing pins are used
S1 BT1
here as the touch contacts. The electrical resistance of your
C1
skin is in the order of 100 kΩ to 1 MΩ. The circuit operates as
an integrator with a capacitor in its negative feedback path. 100n 6V
This configuration gives a relatively linear control character-
T1
istic. Once you have selected a brightness level, it will be S2
maintained for hours if you use a low leakage (foil) capacitor.
Another feature of this circuit is that the harder you press on BUZ10
the contacts, the quicker the lamp brightness changes.
(004037)
004037 - 11

7-8/2000 Elektor Electronics 47


SUMMER CIRCUITSCOLLECTION

020 8 Channel D/I Card for RS232


G. Vastianos

The author is a student at the Electronics Department, Tech-


nological Educational Institute of Piraeus, Greece.
This project is a card with eight optically isolated TTL-com-
patible inputs for external connection to the serial port, which
communicates through the RS-232 protocol. On this card you
will look in vain for a UART or microcontroller chip because the
design is based on a 27C256 EPROM.
Each digital input is connected to an optocoupler (IC7-IC14)
through a resistor (R2-R9), and drives it with a current of 5 mA
when the input voltage is 5 Vdc. A diode (D1-D8) is connected
in parallel with each optocoupler input to protect against the ill
effects of reversed signal polarity. The collectors of the internal
optocoupler transistors drive EPROM address lines A6 to A13.
The logic states of A6 to A13 are inverted (because the opto-
couplers work as inverters) and for this reason a second inver-
sion is performed in software (EPROM) to cancel the total inver-

IC2
IC1
S1 9 AD0
CTR14 0
CTR12
7 8 9 7 AD1
3 1
C1 5 7 10 10 6 AD2
100p 4 + 2
4 6 11 5 AD3
5 3
11 !G 6 5 12 5V 3 AD4
R2 P1 R10 RCX 6 4
K1 10 14 4 13 R12 2 AD5
1k IC7 10k RX + 7 5
CT CT
10k

1 6 5 9 13 3 14 4 AD6
25k R11 CX 8 6
D1 CW 15 2 15 13 AD7
4k7 9 7
1 1 16 MODE 12 AD8
11 8
1N4148 2 11 14
2 4 12 12 CT=0 9
4N28 CT=0 3 15
13 10
R3 1
11
K2 1k IC8
1 6 5
4060 5V
D2 4040

1N4148 C8 C5
2 4 5V
4N28 C9
5V 10μ 63V 100n
R4
K3 1k IC9 1 28 10μ
1 6 5 2
D3 R1 1 8x 10k VPP AD0 11 MUX K9
AD3 10 0 1 V+ 16
A0 AD1 10 0 C6 C1+
AD4 9 G 1
A1 AD2 9 7
1N4148 AD5 8 2 3
IC5 6
2 4 A2 10μ C1–
11 4
4N28 AD6 7 D0 0 11 14 2
2 3 4 5 6 7 8 9 A3 12 3 5 T1IN RS1OUT
R5 AD7 6 IC3 D1 1 10 7 7
K4 A4 13 2 IC4 T2IN RS2OUT
1k IC10 AD8 5 D2 2 9 8 3
1 6 5 A5 15 1 3 74HC151 R2OUT RS2IN
4 D3 12 13 8
D4 A6 EPROM R1OUT RS1IN
16 15 6
3 D4 4 4 4
A7 17 14 C7 C2+
25 D5 5 9
1N4148 A8 27C256 18 13 MAX232
2 4 24 D6 6 5 15 5
4N28 A9 10μ C2–
19 12
21 D7 7 V-
R6 A10 7
K5 23 EN 6
1k IC11 A11 C10
1 6 5 2
A12
D5
26
A13 10μ
MODE 27
A14
1N4148
2 4 OE CE
4N28
22 14 20
R7
K6 1k IC12
1 6 5
D6

1N4148
2 4
4N28
R8
K7 1k IC13
1 6 5 IC6
D7 12mA D9 7805 5V

1N4148 1N4001
2 4
4N28
BT1
R9
16 C11 16 16
K8 1k IC14 C12 C2 C3 C3 C4
1 6 5 9...12V IC1 IC2 IC4
D8 330n 100n 8 8 8
100n 100n 100n 100n

1N4148
2 4
4N28
SUMMER CIRCUITSCOLLECTION
ROTKELE )C( 1-620400 K9 Table 1. ASCII Codes & bit values
R1

IC7
CHAR ASCII D7 D6 D5 D4 D3 D2 D1 D0

C11
K1

R2 D1 CR 13 0 0 0 0 1 1 0 1

IC2
LF 10 0 0 0 0 1 0 1 0

IC8
‘C’ 67 0 1 0 0 0 0 1 1
K2

IC3
R3 D2
‘H’ 72 0 1 0 0 1 0 0 0
‘0’ 48 0 0 1 1 0 0 0 0
IC9
K3

R4 D3 ‘1’ 49 0 0 1 1 0 0 0 1
C5 ‘2’ 50 0 0 1 1 0 0 1 0

IC4
IC10

‘3’ 51 0 0 1 1 0 0 1 1
K4

C6 C9
R5 D4 ‘4’ 52 0 0 1 1 0 1 0 0
C8
‘5’ 53 0 0 1 1 0 1 0 1
IC11

R12 C7
K5

‘6’ 54 0 0 1 1 0 1 1 0

IC5
R6 D5 C3
S1
C4 ‘7’ 55 0 0 1 1 0 1 1 1
IC12

‘:’ 58 0 0 1 1 1 0 1 0
K6

R7 D6 SP 32 0 0 1 0 0 0 0 0
IC1

C10
SYNC 255 1 1 1 1 1 1 1 1
C1

P1
IC13

C12
K7

R11

R8 D7
D9 IC6
IC14

R10
K8

004026-1 C2 0 +
R9 D8
COMPONENTS LIST

Resistors:
R1 = 10kΩ 8-way SIL array
R2-R9 = 1kΩ
R10,R12 = 10kΩ
R11 = 4kΩ7
P1 = 25kΩ preset H

Capacitors:
C1 = 100pF
C2-C5,C11 = 100nF
C6-C10 = 10 μF radial
C12 = 330nF

Semiconductors:
D1-D8 = 1N4148
D9 = 1N4001
IC1 = 4060
IC2 = 4040
IC3 = 27C256 (see text for programming)
IC4 = 74HC151
IC5 = MAX232
IC6 = 7805
IC7-IC14 = 4N28 of CNY17-2

Miscellaneous:
K1-K8 = 2-way PCB terminal block, raster 5mm
K9 = 9-way sub-D socket (female), PCB mount
004026-1 (C) ELEKTOR
S1 = 8-way DIP switch

sion effect. In this way the 8 inputs become TTL compatible. The number of 512-bit blocks (packets) equals the number
IC1, a CD4060, with the help of C1, P1, R11 and R10, forms of different combinations of CH0 to CH7 and MODE, and can
a bitrate generator for 150, 300, 600, 1200, 2400, 4800 or be calculated from the following formula :
9600 bps. Preset P1 needs to be adjusted to the desired bau-
drate — an accuracy of 1-2% is required! The bitrate is selected Memorysize = 512 packets*512 bits/packet
using DIP switch S1. The CD4040 works as a 9-bit binary = 256 Kbits = 32 Kbytes
counter. The three LS bits of the counter outputs (AD0, AD1,
AD2) drive the selection inputs of multiplexer IC4 (74HC151). The data encoding unit consisting of IC1- IC4 transmits 512-
The other counter bits (AD3-AD8) drive the LS address bits of bits packets (coming from the multiplexer output). The data in
the EPROM (A0-A5). The highest EPROM address line, A14, is the transmitted packet depends directly on the logic states of
connected to one of the DIP switches in S1 which defines the lines CH0 to CH7 and MODE.
data transmission mode (TTY or BIN). The power supply includes a 7805 regulator so that the card
With the above connections counter IC2 sweeps a range of will not need a separate regulated power supply. Circuit IC5
512 bits (64 bytes) of the total of 256 kBits (32 Kbytes) con- (a MAX232) works as an RS232 Driver/Receiver, converting the
tained in the EPROM. multiplexer’ s output data from TTL to RS232 compatible.
SUMMER CIRCUITSCOLLECTION
With the EPROM programmed with the right data, the circuit representing CH7, and LS Bit, CH0).
will produce messages (packets), through the RS-232 protocol,
that will inform us for the logic states of the card’s inputs. The These two modes are used in different cases. In cases where
transmission used by this card is 8 data bits, 1 stop bit and we want just to see the logic states of the input we just set
no parity. Assuming an ‘A’ is to be sent, and that your PC runs the card in TTY mode and we use a terminal program as Telix,
a terminal simulation program receiving (via the RXD pin of its Procomm Plus, Hyper Terminal etc. In cases where we want
serial port) the following 10 bits ‘0100000101’, then it will print to do some data logging or to compose a data acquisition &
on its screen the character ‘A’. control system with other DAQ & control cards then we just
This card transmits the logic states of its inputs in one of set the card in BIN mode (because the decoding of the data is
two modes, TTY (teletype) or BIN (binary). easier done by dedicated software).
In TTY Mode, the card transmits the following message to The characters, their ASCII codes and their bit values, as used
the computer: in the two modes are shown in Table 1. The bitstreams that
must be transmitted for each character appear in Table 2.
<SYNC>,<SYNC>,<CR>,<LF>,’CH0:X’,<SP>,’CH1:X’, The contents of the EPROM are created by a program
<SP>,’CH2:X’,<SP>,’CH3:X’,<SP>, (EPROMFMP.BAS) developed in Quick Basic, which is avail-
‘CH4:X’,<SP>,’CH5:X’,<SP>,’CH6:X’,<SP>,’CH7:X’ able from the author’s website. The program first makes a tem-
porary file that contains all data to be written in the EPROM
Where <SYNC> is the character with ASCII code 255, used in bit format (08DICARD.TMP). Next, it converts this file into
to synchronize the computer. Reception of this character (from byte format (08DICARD.BIN) and deletes the temporary file.
the computer) causes a space to appear on the screen. <CR> Finally, it runs an external program (BIN2HEX.EXE) and
and <LF> are ‘carriage return’ and ‘line feed’ with ASCII adapts the file from Binary to IntelHex format
codes 13 and 10 respectively, and <SP> is the ‘space’ char- (08DICARD.HEX). To program your own EPROM, you may use
acter with ASCII code 32. Reception of this character (from the 08DICARD.BIN or 08DICARD.HEX file.
computer) causes a space to appear on the screen. Finally, X Finally, the mode and bit rate selection on S1 is shown in
is the logic state of each input, which will cause a ‘1’ or a ‘0’ Table 3. The PCB designed for this project is unfortunately not
to appear on the screen. available ready-made through the Publishers’ Readers Ser-
In BIN Mode, the card transmits the following message to the vices.
computer: All software you will need to complete this project may be
downloaded free of charge from the author’s website at
<SYNC>,<SYNC>,<DATA BYTE> http://members.xoom.com/robofreak/download/08dicard.htm
Also, for other projects developed by Mr. Vastianos, visit this
Where <SYNC> is as above and <DATA BYTE> is the char- address:
acter with an ASCII code equal to the numerical value of the http://members.xoom.com/robofreak/
byte built from the logic states of the inputs (with the MS Bit (004026-1)

Table 2. Character composition Table 3. DIP switch settings


CHAR START BIT D0 D1 D2 D3 D4 D5 D6 D7 STOP BIT SW 1 USAGE
CR 0 1 0 1 1 0 0 0 0 1 #1 #2 #3 #4 #5 #6 #7 #8 MODE
LF 0 0 1 0 1 0 0 0 0 1 OFF ON OFF OFF OFF OFF OFF OFF “150, 8, 1, N : BIN”
‘C’ 0 1 1 0 0 0 0 1 0 1 OFF OFF ON OFF OFF OFF OFF OFF “300, 8, 1, N : BIN”
‘H’ 0 0 0 0 1 0 0 1 0 1 OFF OFF OFF ON OFF OFF OFF OFF “600, 8, 1, N : BIN”
‘0’ 0 0 0 0 0 1 1 0 0 1 OFF OFF OFF OFF ON OFF OFF OFF “1200, 8, 1, N : BIN”
‘1’ 0 1 0 0 0 1 1 0 0 1 OFF OFF OFF OFF OFF ON OFF OFF “2400, 8, 1, N : BIN”
‘2’ 0 0 1 0 0 1 1 0 0 1 OFF OFF OFF OFF OFF OFF ON OFF “4800, 8, 1, N : BIN”
‘3’ 0 1 1 0 0 1 1 0 0 1 OFF OFF OFF OFF OFF OFF OFF ON “9600, 8, 1, N : BIN”
‘4’ 0 0 0 1 0 1 1 0 0 1 ON ON OFF OFF OFF OFF OFF OFF “150, 8, 1, N : TTY”
‘5’ 0 1 0 1 0 1 1 0 0 1 ON OFF ON OFF OFF OFF OFF OFF “300, 8, 1, N : TTY”
‘6’ 0 0 1 1 0 1 1 0 0 1 ON OFF OFF ON OFF OFF OFF OFF “600, 8, 1, N : TTY”
‘7’ 0 1 1 1 0 1 1 0 0 1 ON OFF OFF OFF ON OFF OFF OFF “1200, 8, 1, N : TTY”
‘:’ 0 0 1 0 1 1 1 0 0 1 ON OFF OFF OFF OFF ON OFF OFF “2400, 8, 1, N : TTY”
SP 0 0 0 0 0 0 1 0 0 1 ON OFF OFF OFF OFF OFF ON OFF “4800, 8, 1, N : TTY”
SYNC 0 1 1 1 1 1 1 1 1 1 ON OFF OFF OFF OFF OFF OFF ON “9600, 8, 1, N : TTY”

S-ar putea să vă placă și