Electronics and Microcomputer Circuits: 146 Practical Projects 0070649847, 9780070649842

1,557 361 30MB

English Pages 200 [212] Year 1985

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Electronics and Microcomputer Circuits: 146 Practical Projects
 0070649847, 9780070649842

Citation preview

146 PRACTICAL PROJECTS

Roger L. Tokheim

McGraw-Hill Book Company New York St. Louis San Francisco Auckland BogotON/OFF

=~~d~~~~Tri~;>1:~~!1~~ ~6 ~-~ ~~~~~~p~~°laso). ~

~ > RESET

>

SWITCH

~12 VOLT POWER SWITCH

BUTTON

FIG. 1-3 Typical inst.allaLion ofcombinat.ion lock/ alarm control on home door. A whooper 1

Microprocessor's phase one clock: this line will drive 2 LSTTL loads*

39

USER 1

This line, when pulled low, disables all internal l!O address decoding

- 5-V power supply; maximum current is 200 mA for all peripheral boards

Using Several PPI Ports TABLE 3·1

31

(Continued) Description

Name

Pin

Microprocessor's phase zero clock; this line will drive 2 LST'rL loads*

40

41

This line becomes active (low) on each peripheral connector when the address bus is holding an address between $C0n.0 and $C0nF, where n is the slot number plus S8; this line will drive 10 LSTTL loads*

DEVICE SELECT

Buffered bidirectional da ta bus; the data on this line becomes valid 300nS into ,, on a write cycle and should be stable for no less than 100 nanoseconds before the encl of' 0 on a read cycle; each data line can drive one LSTIL load

42-49

+ 12

50

v

+ 12-V power supply; this ca n supply up to 250 mA total for all peripheral cards

• Lo3ding limits al'e fol' each pel'iphera l card.

IC 8255

+5

7404 Aople SIOl

connector

v

7.35

14

7

25

PA 0

GNO

26

-

2f;

----

Oo

Do

IC;

LED,

3.;

":'

0,

o,

33

o,

D1

o,

o,

32 31

D,

0,

30

D; D;

29

Do

Do

o,

D; 7404

RO WH

A~

2

,1,

3

28

27

s

8255

36

"" A,

PARTS LIST

cs 41

> - - -- ----'

FIG. :J.:J

Apple II/ lie peripheral connector (slot 7) /C1 7404 Hex inverter IC IC2 8255 programmable peripheral interface (PPI) IC (Intel Corporation) LED, Light-emitting diode R, 150-fl, 1/4-W resistor

Using the PP! chip as a simple output.

32

Apple II/Ile Pel'iphe1·al Slot Intel'fa ce Circuits

-

IC

+~

82!>5

?6

7404

14

Apple SIOl

25

connector

v

GNO

PA 0

7.35

PA,

26

IC1 Dr:

Dn

a.

D,

3

2

34

33 07

07

03

O;

o,

O, I>;

De D"

'0

32

39

3'

38 37

29 14

28

15

027 7404

11 11

PA 2

11

PA 3

11

PA,

JO

o.

II LED,

15 17

iio

I;

PA;

11

PA 6

I;

PA 1

PCo

Re,

I/

LED;

11

PC, PC2

11

PC 3 PC,

13 12

825 5

WR

11

36

11

PC; PC6

11

PC; 10

18 19

20 21 Ao

Ao

2

22

9

23

A,

A, J

24

8

25

PB0

R.,

ff

LE011

If

PB 1

11

PB?

11

PB, PB4

11

PB0 P86

l1

PB1

6

R1
< display.

row of LEDs. Light-emitting diode L 4o is forward-biased and lights. As the row drivers multiplex the rows, only the ls row is turned

SIMPLE BINARY COUNTER A simple 6-bit binary counter circuit is shown in Fig. 7-3. The output LEDs display the binary count equal to 0 through 63 in decimal. When switch S 1 is closed, it clears the 4024 complementary metal oxide semiconductor (CMOS) binary counter IC and also activates the oscillator circuitry JC 1 and associated parts. The oscillator pulses are fed into the 4024 binary counter IC, and the outputs drive the LED displays. Note that the least-significant bit (LSB) LED is connected to output pin 12, whereas the MSB (32s bit) is connected to pin 4 of the IC. When the counter has counted to binary 111111 (decimal 63), pin 3 of the counter goes high , turning off the oscillator. The frequency of the oscillator can be adjusted by changing the value of capacitor C2.

LCD DIGITAL CLOCK A simple-to-build LCD digital clock circuit is shown in Fig. 7-4. The unit can be powered for up to 1 year with a single 1.5-V battery. The circuit is based on the National Semiconductor Ml\1148143 CMOS clock IC, which drives a 0.5in li quid-crystal display (LCD). A 32.768-kHz quartz crysta l serves as the time base. The unit comes as the National Semiconductor MA1032 digital LCD clock module. Other features of the LCD clock include a backlighted display for night viewing, a PM indicator, and an a larm symbol on the display and alarm beeper. The MA1032 clock module is manufactured by use of a CMOS IC; therefore, care must be

64

Clock and Counter Circuits l ED I-L EO 6 lSB7 12 II

7 7

9

IC2

+

-

-

4024 81

6

7

9v

7 4

7

7 MSB

PARTS LIST

8,

c, C2

/C 1

IC2 LED 1 through LED6 R,,R4 Rz R3

s,

9-V battery 0.01-µF, 50-V disk capacitor 0.022-µ.F, 50-V disk capacitor 4011 CMOS quad two-input NANO gate IC 4024 CMOS binary counter IC Light-emitting diode 10-kf1, 112-w resistor 10-MH, 112.w resistor 4.7-Mn, 11z.w resistor Normally open push-button switch

F IG. 7.3 Simple 6-hit uinury counter. dfoprinlcd from l'opulur Eleclronics. Copyright IC April 1978. Ziff-Davis Publi,;hing Company.!

taken not to subject the edge connectors to static charges which may harm the integrated circuit. A summary of the LCD digital clock display modes and display indicators are shown in Fig. 7-5.

SIX-DIGIT LED DIGITAL CLOCK A six-digit clock circuit using seven-segment LED displays is detailed in Fig. 7-6. The digital clock operates on household 117 V ac and continuously displays hours, minutes, and a lso seconds. The unit is based on the Nationa l Semiconductor MOS/LSI MM5314 clock ch ip. A block diagram of the six-digit clock is sketched in F ig. 7-7. The power supply is not shown but produces the + 12 V de a nd the 60Hz input signal. The MM5314 clock chip then divides the input frequency into a 1-pulse-persecond (1-PPS J signal. The counts are accumu-

lated for all six displays and sent to the multiplexer. The segment and digit drives activate the six LED displays. To reduce wiring complexi ty, the displays are flashed on in sequence by the IC multiplex circuitry. The multiplexing action occurs at a fast r ate; therefore, the eye does not notice a flickering in the displays. Thi:! oscillator in the block diagram drives the multiplexer. The decoder and PROM convert from the internal coding to the seven-segment code needed to activate the segment drivers. The power supply of the digital clock is shown at the left in the schematic in Fig. 7-6. The transformer steps down the household 117 V ac to 12 V while the bridge rectifier D 1 through D4 changes ac to de. Capacitor C 1 acts as a power supply filter. The ac is fed into the 60-Hz input (pin 16) through R 3 . Parts C3 and R4 determine the multiplex oscillator frequency. Light-emitting diodes Dr, and D 7 with limiting resistors R 1 and R 2 form the flashing

MOD,

LCIJ

~

Seg.

c:

(j)

drive

Nole 2· ~

32.758 Hz

osc T

Trirn

CMOS / LS 1 MM48143

0. 1 µF

lOO k!l

0. 1 µF 1---

-

- - --1---1

2N4401

100 kl!

"' ::::: -0 "" "'c: "' 0 ~ ;::' ;;; ~

., "' "' u. "'

Alarm speaker

~

ao

!:

0

i7>

" NOif 2

81

1.5 V

s,

A. Unoridgeo ; r1asnin9 coion Bridged ; f1xeo colon

8 Unoridged = oeepu1g a1arm Bridged ;

ac output

PARTS LIST

B, MOD 1 S1,S2,S3,Ss.Ss S4 SPK1

1.5-V alkaline battery (AA, C, or 0 size) MA 1032 LCD digital clock module (National Semiconductor) Normally open push-button switch SPST switch (or push-on push-off switch) 8-fl speaker

FIG. 7-4

LCD dig ilal cloc k circuiL.

I l;;;cd

by pe rmi;;sion of Nati ona l S e mico ndut:tor Corpora t ion.I

65

66

Clock and Counter Cfrcuits Summary of MA1032 Clock IC Display Modes Display Identifier

Mode Time display

Flashing colon (un less fixed option) Bell fixed, if alarm enabled Normal four -digit time format

Alarm set

No colon Bell flashing independent of alarm enable Normal four-digit ti me format

T ime set

All four dig it s, colon, and PM flash (unless fixed option) Bell fixed, if alarm enabled Normal four-digi t time format

Time set (hold mode)

Same as time set except colon is fixed

Seconds display

Flashing colon (unless fixed option ) Bell fixed, if alarm enabled Hours digits blanked, seconds incrementi ng

Timer display

Flash ing colon (unless fixed option) Bell fixed, if alarm enabled Hours digits blanked, PM blanked, two-digit number represents minutes remaining on timer after 2 seconds of sleep control depression, 10-digit decrements

-

(a)

Display Indicators on LCD of MA 1032 Unit Function

Enunciator

D

Alarm time displayed Al arm enabled Sleep counter displayed Sleep mode on PM time in 12-hour mode

[).

Zzz Zzz PM

Description

-

Flashes On Flashes On On

(b)

FIG. 7-5

I.Cl> digital dock. •Csed by permission of Natiunal Semicondut·tur Curpurntion.1

colon between the hours and minutes displays. Three controls are shown a t the bottom of Fig. 7-6: fast set, slow set, and hold. The high-voltage wiring must be done carefully to make sure that it is completely isolated from the enclosure. The green ground wire on the three-pronged plug must be attached to the metal chassis. Use proper strain relief techniques where cords enter and exit the case. A

parts kit and a two-sided pc board for this s ix digit LED clock are current ly available from Electronic Kits International , Inc.

0-99 DIGITAL COU'.\ITER The digital counter sketched in Fig. 7-8 wil l display a decimal count frorn 00 to 99 and then

68

Clock and Counter Circuits MM5314 clock chip Seconds

Minutes .

Hours

,

~~~· 60 Hz

Multiplexer

+12V-Vss Power

Oscillator

GNO - V00

Multiplex decoder

Digit drivers ..,.__ _ _ _ _ _ _ _ _ __,

FIG. 7-7 Block diagram of six-digit clock using the MM531.4 IC. (Roger Tokhcim, Digital Electronic.~ . 2d ed., McGraw-Hill, New York, 1984, p. 195. Used by permission of McGraw-Hill Book Company.l

recirculate back to 00. It is an excellent counter demonstration circuit, using easy-tofind ICs. Switch 8 2 will clear the displays to 00 when connected to + 5 V. The 555 timer !Cr is wired as an astable multivibrator whose frequency can be adjusted using potentiometer R 2 • Decoders IC3 and /C5 translate the BCD output of the ls and 10s counters IC 2 and JC4 into a decimal output at the LED displays. The 150-!1 resistors R 3 through R 16 limit the current t hrough the LEDs to a safe level. The power supply on this unit is shown as a 6-V battery (or four 1.5-V cells) with series diode and resistor to produce the + 5 V needed to operate the displays and TTL !Cs.

DI GITAL AUTOMOBILE CLOCK WITH LED DISPLAY A digital car clock circuit using an LED display is shown in Fig. 7-9. The National Semi-

conductor MM5378 auto clock chip is the heart of this 12-hour clock. The clock should be connected to an uninterrupted 12-V supply (bottom two power supply connections in Fig. 7-9). The display enable power supply connection should be connected so that the display turns off with the ignition switch. The controls are the slow-set 8 1 and fast-set 8 2 switches. Variable capacitor C2 can be used to make slight adjustments in the accuracy of the clock. The clock consumes very little power with the ignition switch off and the displays not lit. However, the clock chip keeps accurate time even with the ignition switch in the OFF position. Diodes Di andD 2 protect the IC from reverse voltage, while zener diode D3 protects the IC from voltage spikes from the auto electrical system. The crystal X 1 along with capacitors C 2 and C3 and resistor R 1 are the external parts associated with the IC's 2.097152-MHz timebase oscillator. Transistors Q1 through Q4 and associated resistors are digit drivers to turn on

--.l

(j)

~

"

~ ~

..

.t / ..

4

"'

v.

IC, P, 01 through 06 0 1 through 013

DS 1 through DS6

C1 C2 ,C3 Di through D5 D6 ,D1

r,

s

18

12

-

a,

~

4/ 6 d1g•t se1ec1

NIC

11

V!>D

o,

22

:H,

-

a,

Slow :i~ l

set

I?



1

16 s, ~

F ast

I?

15

so.•1

16 s, ~

S lo w

-J

0) ~

IC1 IC2,/C4

DS,,DS2

D1

C2

c,

B,

r

B

R,,

v

C2

o.ss n

Power supply

6v

o,

+5

Clear

v

Ground

+5 v

.,.5

16

CLR

o,

-

fl

GNO

CJrry

(7419 2)

ICi

Counter

I\

Vu

·5 v

6 i

c

-

GNO

1744 7)

I Cs

I (\

Decoder

v,,

s,

S2

i·!)

v

01g11al readout

pany.)

h

u

7447 decoder-drive r IC 1-kn, 1/4-W re sistor 10-kfl linear-taper potentiometer 150-n, 1/4-W resistor 0.56-!1, 11z.w resistor SPST switch SPOT switch

10s

- I- 1

-, L L-,

DS2

l I

R3 through R, 6 R11

R2

R,

/C3,/Cs

a

R 3 -R9

FIG. 7-8 0-99 digital counter. !Roger L. Tokhcirn, Activities Manual fol' Digital Electronics, 2d ed., McGraw-Hill, New York, 1984, pp. 72, 163. Used by permission of McGraw-Hill Book Com-

6-V battery (or four 1.5-V batteries) 100-µ.F, 25-V electrolytic capacitor 10-µF, 25-V electrolytic capacitor 1N4001 silicon diode, 1 A, 50 PIV FND507 common-anode seven-segment display (TIL321) (vertical mounting- Radio Shack 276-053) 555 Timer IC 74192 universal counter IC

=-

~s,

J

PARTS LIST

ON / OFF switch

Ri

Frequency control

.,. 5 v

70

Clock and Countei· Circuits Dl

+

R5

R4

(DISPLAY ENABLE)

D3

02

r:::;

+ 10

v

7

Segment Anodes

5

/

14

3

A

I

B

t2

2

c

18

D

17

E

3 6 2

16

F

tO

15

G

8

C3

-!1-- ---1 U• R2

I I I ( 4

I I I I

/_! I I

3

/_/ I I

2

7 A 13 6

9

12

11

RS R7

RB R9

R14

R15

R 17

PARTS LIST

c, c, C3 D1,D2 D3 DIS 1 0 1 through 04

R1 Ri R3 ,R4 Rs R6 through R9 R, 0 through R 13 R 14 through R 17 S1.S2

U1

x, FIG. 7-9

4.7-µF, 50-V electrolytic capacitor 5- to 45-pF variable capacitor (Part 63051, Graymark International) 22-pF m ica capacitor l N4002 silicon diode, 1 A, 100 PIV 1N5250 zener diode, 20 V, 112 W Five-digit LED Display (Part 63048, Graymark International) 2N3904 NPN transistor (or similar) 15-M!!, 114-W resistor 15-n. 1/ 4-W resistor l 00-kll, 1/ 4-W resistor 1-M!l, t/4-W resistor 10-k!l, 1;4.w resistor l 00-l!, 1/ 4-W resistor 3.9-kn. 1;4.w resistor Normal ly open push-button switch MM5378 auto clock IC (National Semiconductor) 2.097 152-MHz crystal Dil{i ta l ca r clock with I.ED display.

the multiplexed LED displays. Resistors R 4 and R. 5 form a voltage divider to set the brightness (pin 7 on IC).

( Us ed by p~~rrni;;sion of Graymark In ternational, lnc.:. l

A parts kit and a pc board are currently a vailable for the digital car clock from Graymark International, Inc.

8 Electronic Ganie Circuits

BINARY HI-LO GAME A binary hi-lo game using easy-to-find parts is diagrammed in Fig. 8- 1. To play the game turn on switch 8:1 and press switch S 1 for severnl seconds. This loads a ra ndom number into the 74 193 counter J C~ . The player tries to guess the 4 -bit binw~y number by setting the fo ur switches in S 2 . If the nu mber is correct , green LED2 will light a nd the game is won. ff you guess too high. the red LED1 lights; if you guess too low, th e yell ow LED:i will light. The object of the game is to g uess the random binary number in the fewest guesses. The 555 timer is wired a s a free-ru nning multivibrator and serves to clock the 74193 counter when switch $ 1 is pressed. When S 1 is released, the counter holds the "random count" at the B input of the 7485 magnit ude comparator I C'.I. The player selects wh ich 7485 input A pins are to be grounded through switch s~. If the A and B inputs to / C:1 a re of the same bi-

nary magnitude, pin 6 goes high, lighting LED 2 . If the magnitude of A is greater than B , pin 5 goes high and LED 1 lights, indicating that the guess was too high. If the magnitude of A is less than B , then pin 7 goes high and LED3 lights, indicating tha t the guess was too low. Diode D 1 drops the battery voltage to about + 5 V for the I Cs.

DECISION MAKER The simple decision maker circuit shown in Fig. 8-2 will indicate true-false or heads-tails when activated. When powered with 117 V ac. neon lamps Y1 and Y2 will a lternately flash . If switch S 1 is closed, one of the lamps will be left on . Opening the switch will again cause the neon lamps to flash. The household 117 V ac is converted into de by D 1 and fi ltered by C 1 . Wit h switch 8 1 open, de voltage will be applied to both neon lamps. As a result of variations in the lamps, one will

71

72

Electronic Gam e Circ uits

.

$.,

-

~

.:R,

:~ 47 k!1

a

4

~

~D,

-

16

1()

7

s. '• R;

'• I kf!

6

'2

-- C, ,

/C.

-

___L_

- ~

~55

I

0.l µF

I

J ~

c

Up

1c1

I

7

0

Down

, , 193

e

8 A

1

E

1~

~

Ii

3

9

}

s

ri.;,(j 11 Too r:gh

r

LED.

~

'"

TC> 7485

S1

Pre ss S, 101 sc·1era1 secona s 10 load 1and om numoer 1n 74 193

-

-l-

6

Gr:,_e~//

Corre(\

r

uo, B. ~ 61/

i$

c=i c:::J

"l 12

c::J

10

c=i

8

~

.4

7

ie~;' ll

Too •ow

~

L£03

.

R-, 210

n

8

PARTS LIST 81

C1 D1 IC1 IC2 /C3

LED1 LED2

6-V battery (or four 1.5-V cells) 0.1-µ.F, 50-V disk capacitor 1N4001 sil icon diode, 1 A, 50 PIV 555 timer IC 74193 counter IC 7485 4-bit magnitude comparator IC Red light-emitting diode Green light-emitting diode

LED3 Ri R2 R3 S1 S2 S3

Yellow light-emitting diode 47-kfl, 112-W resistor 1-kn, 112-W resistor 270-f!, 1h-W resistor Normally open push-button switch SPST 4-position DIP switch SPST switch

FIG. 8-1 Bina ry hi -lo g-amc. O•'ol'n:;;L Mi 111,.;, T/11• l'orn•s/ Mims Cirrnil Scro.pbo1Jli, McGrawHill. Nt•w York . l!JH:'!, p. 12 1. U;;cd hy pcrmi ,.;;; ion or Forrest M. Mim::;, 111. J

reach its firing voltage !about 65 to 70 V l first. When the first neon lamp fires, the voltage at the top of the lamp goes positive, charging the capacitor C 2 . When the capacitor has charged for a short time, it fi res the other neon lamp and turns off the first la mp. The lamps alternately flash. When switch S 1 is closed, the lamp that was lit. last will continue to glow while the other will not light . When the switch is closed, capacitor c'/. is short-circuited. The high-voltage wiring must be done carefully to make sure t hat it is completely isolated from the enclosure. The green ground wire on the three-pronged plug must be attached to the metal chassis. Use proper strain relief techniques where cords enter and exi t the case.

DIGITAL DICE The ci rcuit for a digital dice game is shown in Fig. 8-3. As the "roll" button is pressed, a random number between 1 and . 6 will appear on the seven-segment LED display simulating the roll of a single die. The circuit may be doubled to get a pair of digital dice. The circuit may be divided into four sections: free-running multivibrator, counter, decoder/driver, and display. Gates la and lb along with capacitor C 1 and resistor R 1 form a free-runn ing m ult ivibra tor or clock which generates a 1-kHz square wave. When S\vitch S 2 is closed. the clock drives t he counter UC2 and gates le and ld l. The clock counts from 1

Digital Dice

73

'1 .

P.

R

PARTS LIST

s. _L_

c.

c.

D,

c,.c} D, P,

R,,R7 ,R3

s,

V,, V2

v,

l"H;. 8-2

Dl,

>

L,

:c

iQ

3

(>

>

R\ ~

'> ~

I

T-

l·I

~

l

r:.

_L

+5

2 lC~,

7

l l 8 •

..

·~

'I; >

,>

('

~

l

6

=

••

~

-"-

-:::!::-

.

f8 f



. ,>~

~,, >

>

~.; ~

>

c,

-~

T

1:

i6

l IC;

:r: ·

6

>

!CJ

t

I

;

;

R

" >>

c,

_ ._

l

c:

=

ic,

t fD. '

c..-

·= LED-: , _ l EV.

....

v ••

.. R,o ..... R,q A

9

I~

0

,...,. LEDq

-

-

,..... LED8

+5 v

.....L c..

::c __!_

I

c.

16

1S

i

=

iJ ~

~

-d:-

13

~



~ D,

9

- .'" AA

.... .

q).

,..... LED1 ~

R,.

·-,....

l fD.•.

R3

·- LED. 0

....

,.... LED,1

. - ,.... ... Ria .......... LED, • • Ri ·· .... LE0 ,A

...

A•A

Rn

I

..... n,6

·,....

_L

-

+ 1 11 ~ 6V

Ii

10

7 8

BI

+5 V fVccl •

,.....

... _ ··... 11,, ......

'Ca 12

1

-

""" t EO ., ...,. LEO. ;

i3

:»'I

2

T=

.... LEO,

Vee

3 6

-... 11,, ... R,1 R;,

-b

~

1

il

.: LED1

A

10

3

__l_

""" LED~

1.t

II

7 8

,q/~.

- v -

I?

=

l l

>

...

15

T .I~

-

,..,. LED,

__l_

?

-:::!::-

- LED,

·-""" ··-

::c c,...

c

__l_

i

.

v

+5

H

- J •.'

.l

>A A

9

....

LED-' ·_.. - LED ·

Vee

2

T=

R,o

...L

3

.,..,..

>

:r

lC

a

.,.,.

.A

11

7

c,

_l._

12

v

.... ..

R. ,

.. .... .. R," .. R,,, ... . 11,,11., ...

13

6

T ·1, .> >

= q. , .....220 !!

15

1

!'

IC.

1"

c..

I

7 R (>

'.

• -, v

__l_ '

;

0

! ~\I

I' C:.

T

_

PARTS LIST 6-V battery (or four 1.5-V ni-cad o r alkaline cells) C1 through Ca CGthrough C13 D,

IC , JC, JC3 J C4 ICs J C6JCa IC,

2.2-µF, 16-V electrolytic capacitor 0.1-µF, 50-V disk ca pacitor 1N4001 si licon diode. 1 A 50 PIV 555 timer IC 7447 decoder driver IC 7400 quad 2-input NANO gate IC Fl(;.

88

!) .. (

LED1 through LEDw Ri ,R4 ,R7,R 10

R2 RJ, R0 ,R6 R 8 , R 11

R9 R 12

Frit• ndl~·

t hroug h R3z flnsht'r.

Lig ht-emitting diode 10-k!l, 1/4-W resistor 220-kit 1/4- W resistor 470-k!l, 1/ 4-W resistor 1-Mn, l/ 4-W resistor 100-ki !, l/4 -W resistor 220-!!, l/4 -W resi stor

5

11

Neon Lamp R andom Flasher

B

6

5 +

IC.

l,

LM 3909

1

2

cI J +

-

"1' =

PARTS LIST

-

81 C, IC, L,

-

6-V battery 470-µ.F, 16-V electrolytic capacitor LM3909 LED flasher/oscillator IC Nu mber 47 lamp (6 VJ

89

V). The red light-emitting diode (LED 2 ) will serve as a pilot light. The red LED is the power on indicator. The green LED is the in tolerance indicator. This circuit can be added to a 5-V de power supply to indicate correct output voltage when operating TIL !Cs. Assume that the voltage to be monitored in Fig. 9-6 is 5 V. The transistor level detector Z 1 , R 1 , and Rz will turn on Q2 and light the green LED. If the input voltage drops below 4.5 V, neither Q, nor Q2 conduct andLED 1 is not lit. If the input voltage rises a bove 5.5 V, Z2 conducts, turning on Q 1 • This causes the base of Qi to be grounded, turning off Q2 and the green LED. If a different voltage range must be monitored, change to appropriate voltage zener diodes.

F IG. 9-5 I nca ndescent bulh nashcr. rUsed by per mi1K,

BUZZ BOX CONTINUITY AND COIL CHECKER The buzz box tester in Fig. 10-1 is a simple continuity and coil tester. When the probes are touched to a low resistance, the speaker wil l buzz to indicate continuity. However , if the resistance is over 100 .n, no sound will come from the speaker. The simple battery-operated unit is especially useful for checking continuity and relative resistance of coils, motor windings, and test leads. The buzz box continuity checker circuit shown in Fig. 10-1 is based on the LM3909 LED flasher/oscillator IC by National Semi cond uctor. The circuit emits less sound from the speaker as the resistance across the probes increases. The circuit is useful for resistances up to only about 100 n. The difference of a few ohms in the resistance of a coil will cause the buzz box to emit a different tone.

I

Tes1

probes

R.

c,

1 kn

IO µF

+

IC, LM3909

+

B, 1.5

v

PARTS LIST

81 C1 C2 /C 1

1.5-V battery 10-µ F, 6-V electrolytic capacitor 0.1-µF, 50-V disk capacitor LM3909 LED flasher/oscillator IC (National Semiconductor) 1-kn. 1/4-W resistor 12- to 16-n speaker

CAPACITANCE SUBSTITUTION BOX

R1 SPK 1

A capacitance substitution box ci rcuit is shown in Fig. 10-2. With a turn of the knob, the rota ry

hy permission of Nationa l 8emiconductor C.:orpon1t ion.)

FIG. 10-1

Buzz box cc>ntinuity and rni l dwcke r.

!Used

97

98

Meters and Test Inst1·uments

switch will select one of nine possible highvoltage capacitors. Substitution boxes are used during experimenting and circuit design work. A pa rts kit and a pc board for t he capacita nce substitution box a re currently a vailable from Graymark International, Inc.

CONTINUITY TESTER The continuity tester circuit in Fig. 10-3 combines a continuity tester with a low-voltage checker. With the mode switch in the continuity test position (down on t h e s chematic dia-

S1

1

c

Ill

TI I I I I I I I

cg

PARTS LIST

C1 C2 C3 C4 C5 C6

0.0001-µ F, 400-V capacitor 0.001-µ.F, 400-V capacitor 0.0022-µ. F, 400-V capacitor 0.0047-µF, 400-V ca pacitor 0.01-µ.F, 400-V capacitor 0.022-µF, 400-V capacitor

0.047-µF, 400-V capacitor 0.1-µ.F, 400-V capacitor 0.22-µ.F, 400-V capacitor SPl 2P rotary switch (similar to Radio Shack 275-1385)

C7 C8 C9 Si

FIG. 10-2 Capacitance substitution box. 1Used by permission of Graymitrk International. Inc. 1

Mode: Up = voltage test Oown = continuity test

Red +

-4 -------1

R,

S' u--~~56v0v------~D~,---e>-------.

(/ I I

B,

....__- - - i +11 11---~

I

LED,

I

\\

I

I I I

Black -

- - - -- -+--a. t /

v

s,

PARTS LIST

9-V battery 1N4001 silicon diode, 1 A, 50 PIV Light-emitting diode

560-H, 1/2-W resistor 330-n. 112.w resistor OPOT switch

f.8

''• "-.._14

I''·

11f

9 IC1 0

C1 470

ICJ

340T· 12

I

100 kfl

~R,;

120 i .......

0.1 11F

C2



~

I

47 kn

R, 5

IC.

) 03 2N3567

560

~ 16

I

((

v

l·"

+ 12

D.o

~

I· I

2N2222

o,

R•

R3 4.7 k!l

y

oo.-vu•

02 2N2222

C3

v

load d

..........

E

~

0. 1 µF

e

o.

FIG. 11-2 Computer-controlled triac di mmer. See parts list on faci ng page. (Merrill Lessley, ''Easy-to-Build ComputerControlle of the monitor strikes the cadmium sulfide photoresistor, its resistance drops. This causes the voltage at the noninverting input to the comparator (pin 3) to go less positive. When the voltage at pin 3 on /C1 becomes less than the reference voltage at pin 2, the output (pin 1) goes low. Potentiometer R 1 adjusts the reference voltage on the comparator so that the circuit responds properly to light and no-light conditions on the monitor. The low-going signal from the voltage comparator (in the form of pulses due to the flicker of most CRTs) triggers the 555 timer /C 2 wired as a one-shot multivibrator. The output (pin 3l of /C 2 goes high, turning on Q 1 and causing the relay K 1 to snap closed. If less light strikes photoresistor R 2 , the opposite happens. The voltage at pin 3 of IC 1 goes more positive than the reference voltage and the output of the comparator goes high , turning off the one-shot IC 2 . The output of /C 2 goes low, turning off Q1 and a llowing the relay contacts to spring back into their normal positions.

The optical computer interface circuit can be operated on any power supply with a voltage between 5 and 12 V. The relay may have to be changed with a change in power supply voltage. The voltage used to power the motor, lamps, and other components would typically be 117 V ac. Care must be used when wiring 117-V ac circuits so that they are well insulated from the case. Any computer program that will light a small section of the CRT screen can be used to turn on the computer interface. Of course, the same area on the CRT must be darkened to turn off the circuit.

JOYSTICK INTERFACE-LOW RESOLUTION The joystick interface circuit in Fig. 11-4 has very low resolution as it converts the position of the joystick potentiometers into digital format. This interface may be adequate for an application, such as a game, where front, back, left, right, and stop might be involved. When the j oystick interface is connected to a parallel input port, the joystick value can be read with a single input instruction or routine. Each of the joystick potentiometers IR1 and R 1 ~ ) in Fig. 11-4 is connected as a voltage divider across 3.9 V. The output from each potentiometer is fed into an analog-to-digital (AID) converter. The AID converter consists of four voltage comparators set to turn on at 25, 50, 75, and 100 percent of full-scale voltage. If the voltage from the potentiometer is less than 25 percept of 3.9 V (0.975 V), all the comparator outputs will be zero. At about 1 V, the leastsignificant bit (LSB) of the converter will go to a logical 1. Full voltage applied to the AID converter will cause all outputs to go high. The binary outputs of each 4-bit AID converter will cause all outputs to go high. Five bit patterns are available from each AI D converter (0000, 0001, 0011, 0111, or 1111). The value of resistor Rx may have to be adjusted slightly to enable the MSB comparator to flip to high output near the end of the joystick's travel. This circuit will produce 25 (5 x 5) unique 8-bit codes that can be used by the programmer.

Joystick Interface-High Resolution

115

v. V+

C2

0,

Sen s11ivi1y con1101

V+

"--..

R, 8

-= V+

7 6 IC2

C3

5

555

V+

2

T

3

VOptical sensor - place against CRT

-=

c,

r

To device{s) being controlled

u=}

C,

K,

R2

-=

-=

LED1

=

PARTS LIST

C1,C3, C4,C5 C2

D1 Di IC1 IC2

K1

0.1-µF, 25-V disk capacitor 10-µ F, 50-V electrolytic capacitor 1N914 silicon diode (or similar) PTC205 diode (or 1N4007) LF353N op-amp IC (Radio Shack 276-1715) 555 timer IC 12-V de coil, 5-A contacts SPDT relay (sim ilar to Radio Shack 275-218)

LED,

a,

R1 Ri R3

R4 Rs Rs

Light-emitting diode 2N2222 NPN transistor (or similar) 100-kO potentiometer Cadmium su lfi de photoresistor 250-fl, 1/4-W resistor 1-kfl, 1/4-W resistor 4.7-kD, 1/4-W resistor 1-MD. 1/4-W resistor

FIG. 11-3 Optical compuler inlerfocl'. CDavc l.c ith11U~l'r, "Computer interface- Build This Practical and inexpensive Opt ical Interface," C:1111111111t-rs nnd Programming, Ju ly/ August 1981, pp. 55-56, 76. Used by permi;;;;ion of David Leilhuuser.)

JOYSTICK INTERFACE-HIGH RESOLUTION The joyst ick interface circuit in Fig. 11-5 is a h igh-resolution A ID converter using easy-tofind TTL l Cs. The position of each joysti ck po-

tentiometer is converted into an 8-bit binary number . The outputs are then fed into two para llel ports of the computer and may be read with simple input statements or routines. Consider t he top A I D convert.er and clock in F ig. 11-5. The 555 t imer (!C 15 l is wired as a

2 JOYSTICK POTENT IO ME TERS

I

~---

- - - - - - ----------- - --- --- -r I

IOM

I

Z1 tN4728 3 9V

I I

•R x

I I

Rio 13

R6

IOK

83

IOM

I

C1

11,...F

Rz7

I I

'Rx

I

R14

R2

47 0

,I

IOK R1 50K

•5v

I

I I

R23

IOK

I

~OK

13

R15

IOM

R19

IOK

87

IOM

IOK

R3

82

R1

1011

86

TO 4 LEAST S IGN IFICANT B I TS OF INPUT PORT I

IOM

R20

I OK

IO M

TO 4 MOST SIGN IFICANT BITS OF INPUT PORT I

IO K

R4

St

R9

IOK

85

tO M

IOK

IOM

IOK

eoJ

A5

Rg

84

IO K

R2z

Number

Type

ICI

LM339

3

12

IC2

LM339

3

12

1011

IC 2 L Mn9

+ 5 V GND 'Rx • APPROXtMATlLY

tOO OHMS

PARTS LIST

C1 /C1 JC2 R 1 ,R 14 R2 through R9 R 10 through R, 3 R, 5 through Rn R 23 through Ris

1-µ.F, 16-V electrolytic capacitor LM339 quad vol tage comparator IC 50-k!l joystick (with two potentiometers) 10-k!l, 5 percent, 1/4 -W resistor 10-M!l, 1/4-W resistor 10-k!l, 5 percent, 1/4-W resistor 10-M.0, 1/4-W resistor

z,

470-n, l/4 -W resistor 100-!1, l/4-W resistor (these values may have to be changed for the MSB voltage comparator to produce a high output) 1N4728 zener diode (3.9 V)

F IG. 11 -4 Low-resol ution joystick inte rface . !S teve Ciarcia, Ciarcia's Circuit Cellar, Volume II. BYTE-McGra w-Hill. New Hamps hire, 198 L. pp. 103-104. Used by permission of McGraw-Hi ll Book Company.)

free-running multivibrator producing a clock frequency of about 7 .5 kHz. The joystick potentiometer R 1 controls the pulse width of a oneshot multi vibrator IC 1 • The 74121 one-shot has a pulse width of 35 milliseconds when the potentiometer is at full resistance while the pulse width is a very narrow 100 microseconds or less with no resistance. When the output of the one-shot goes high, a short clear pulse 1generated by IC38 ) resets the 7493's /C 7 and IC8 wired as an 8-bit counter. The counter starts counting the pulses from t he clock that pass through NAND gate !Cr.a· Finally, the output of the one-shot drops low. This disables the 116

NAND gatelC53 , which stops clock pulses from reaching the 7493 counters . A short load pulse is generated by IC:3u and IC4 a , which loads the count from the 8-bit counter into the 8-bit storage register (!C9 and IC 10 J. The 8-bit count at Bo through B 7 represents the relative position of joystick potentiometer R 1 • The clear, count, stop count, and load sequence continues to update the 8-bit output lines. The longer the pulse width generated by the 74121 one-shot, the higher the 8-bit binary count at the output of t he storage register. The bottom AI D converter in Fig. 11-5 operates the same as the top unit and shares the same clock (/C 15 ).

.,

f

Ill OU(NCY

.i.. 01u~l tol (N \ R (~rt

V(C

01S,r1 1UtGl u1 ~ l't~1 C LOCI(,

OUT Put

OvlllVl

fHA{ S .. Ol)

! At GG(lt

.,

.,

•0

~l

GQOuNO

Cor IC I

e • e •t

7412 1

~

1 POS• '•OIf

)~"' ' - - -1>--

--

PARTS LIST

14

1
--

·~

-·t---~--r;·+----~----~--t-·~H

'1:l

~

::i

·~

c:

I

-

I

-1-~1

I

•.

0

~ ~

I

'

I

I

~

:.:)

'

......~L -;;i •

'
8

~7

!>9

{). 61

c.

o.

•,

G, 50

fl

52

:1, 53

,. "'

B,

""

48

41

44

39

F..\ '0

:.;.(ll(HI



•2

4~

46

3li

3?

33

J4

31

Normally open push-button swi tch SPST switch 8-f! speaker Power transformer (Digi-Key #MA 1026M)

~UI

(Used by permission of National Semiconductor Corporation.>

T1

SPK

S15

S 1 through S8

S 9 through

I 1 \ ,

1 M,.

u ,

MM440l:I

sor.sc.r

~.air;icemp osc

/Q ll.tl HI

e

'/:··,··

'· ~ '"' "

4

1et'1Pef.Hv•e

: S1a:1dt1y OSC 2g

28

50-60 hl 1r·1 01_.~

Bn~ntness

L

Sno.;zc rnput

" 30

'

38

3

!l:i • ,

Ci

s.,

A,

a,

i,

' n, v4

9,

A,

PM

cED u1sp1a1·

I ro.:; ~~o ~- -,

Spe.1k«i - " ------ . . . ~--.j 2~ 23 ?4----- -. _______ 2'1 ...:J>----~ :>-.--.>24·1'our s1eep ~a .~ 3 !m.A.

_l

1

,q, 1(}0 kt!

1N4001 161I l S1a•oo-,· osc 9 V-~ G ~'.·:4· l

m~

CR ....;

s•rnsor

~l J v,.,,

7

(j11ll

; 1 efl11'J('.:fdl•JfC

31 ; HOIC

8 1 Vs~

"'

~-'- u l snoo1c

s1e~p

l J Q.soi.a1 1cmperatu1e

'1isp1,y

~ect'f'IOS

20 j 01si;1Jy 1cmperaiu•e

-

:6. C"SOl;rt

JllC""

~

5 ov c·

~

l ..

c,q,

~ ll1

Set

~•

olf

1•1

w~i V I at • Balt~I•/( < IJ. ?

2

·n)

fas:

T·me

~iarm

Ill SIC•• set

·9

11

12

:5 Oi:s:at1·1 ai.arm

l Slaw SCI

h i $•;tec1

l'J 12 · 2;t'Conds: howev.,r. whl'n both :ohorm und "lo~·p arl' :oppliPd. all outputs an· ON. prov1d111i: a lamp 1..-st. This di1'J'llly mode ha~ priorily abov(j rt·em 1 mn~

•. ED >

a.ooe

_@_ -@

.,

l;t

11 Anode

®

Cathooe

Name of device

Circuit symbol

D-

--v-Log•c ga1es

D-

Name of device

Circuit symbol

c

ANDgale

Mono fopen circuit)

1nverte1 M::mo

Phone 1acks

(close

D-

NOR9a1e

ORga1e Pho1c1es1s1or 1pt101oce111 (cadmium sulhde)

-8--0--@//

\\eter m0'1emen1 !panel me1eri

Stereo

11

11

~ P1ezo ouzzer

Mo1or. de

Neon lamp

¢ $

~

Po1en11ometer

+ +5

Op1ocoupler (SCR output)

(,

Powe1 conneclions

~· r ~) (

(lypicalJ

v

I

Vee

r

193

,Name of device

Circuit symbol

Name ol device

er

RCA phone 1ack

-=-

Relay ($PDT.

c

Speaker

Circuit symbol

B

Jd J I

C(j

I

~llC

V--0

~

ifo -10

Resis1or

Swttches

~

0

SPST

Normally open push bullon

.a...1..0.

Normally closed push button

/o

Rotary

0 0

Anode SCA (silicon controlled rect1hen

~

Gate

Seven·segmenl LED 01sp1a1·

LI ,-, -

194

0

Thermistor

¢

Name of device

Circuit symbol

Name of device

Circuit symbol

Collector

B

~

NPN tran sistor

Emitter

Trigger tube

Collector

8

PNP transistor Emitter

~.. e

Unijunction transistor (UJT)

Unilateral switch

Cathode Translslors

Collector

e

Oartington transis10r

¢

EmiHer

Collector

varistor (voltage-dependent resistor)

Darhngton transistor

ollector Pholodarlington transistor

B

Anode Xenon flashtube

Emitter

Trigger



Cathode

Triac

Anode Zener diode

~ '

Calhooe

~ Caihode

195

Circuit Sources

Apple Computer, Inc. 20525 Mariani Cupertino, CA 95014 C & E Hobby Handbooks, Inc. 300 West 43rd Street New York, NY 10036 Steve Ciarcia Byte Magazine P .O. Box 372 Hancock, NH 03449

Rober t Delp Electronics Box 1026 F remont, CA 94538 Electronic Kits International, Inc. 23210 Del Lago Drive Laguna Hills, CA 92653

E lectronics Week 1221 Avenue of the Americas New York, NY 10020 General Electric Company Semiconductor Products Di vision West Genesee Street Auburn, NY 13021

General Instrument Corporation Optoelectronics Di vision 3400 Hillview Avenue Palo Alto, CA 94304 Gernsback Publications, Inc. 200 Park Avenue South New York, NY 10003 Graymark International, Inc. 3404 West Castor SanLa Ana, CA 92704 Heath Company Benton Harbor, Ml 49022 Intel Corporations 2565 Walsh Avenue Santa Clara, CA 95001 David Leithauser 4649 Van Klceck Drive New Smyrna Beach, FL 32069 McGraw-Hill Book Company 1221 Avenue of the Americas New York , NY 10020

Microcomputing 80 Pine Street Peterborough, NH 03458 197

198

Circuit Sources

Forrest M. Mims, III Compute rs & Electronics 309 Laurel Hill San Marcos, TX 78666 Mode Electronics 500 Norfinch Drive Downsview, Ontario, Canada M3N 1Y4

Parker Publishing Company, Inc. Route 59 at Brook Hill Drive West Nyack, NY 10995 Prentice-Hall, Inc. Englewood Cliffs, NJ 07632 Howard W. Sams and Company, Inc. 4300 West 62nd Street Indianapolis, IN 46206

National Semiconductor Corporation 2900 Semiconductor Drive Santa Clara, CA 95051

TAB Books, Inc. Blue Ridge Summit, PA 17214

OKI Semiconductor 650 North Mary Avenue Sunnyvale, CA 94086

Ziff-Davis Publishing Company One Park Avenue New York, NY 10016

Adjustable beeper (Apple llfllcl, 22 AM radio: six-transistor, 169-173 two-IC, 169-170 Amplifier: 1-watt audio, 179-180 stereo, 180 Annunciator outputs, 15- 17 Apple II/lie game l/O connector, 15-17 Apple Il!lle peripheral s lots, 27- 31 Audible light meter, 159 Audio power meter, 173-174 Automatic headlight reminder, 39- 40 Automobile backup sounder, 39- 41 Automotive battery charger, 49-50 Automotive tuneup meter, 40, 42-43 Bar display with alarm, 85- 86 Bar graph meter (0. to 5-V.>. 85. 87 Battery backup for microprocessor memory, 111- 112 Battery-operated fluorescent light. 58 Battery-powered supply for 1'1'L ICs (5-Vl. 155 Beeper (2-minuteJ. 146 Binary clock, 61-63 Binary counter (6-bitl. 63- 64 Binary hi-lo game, 71-72 Bomb-burst synthesizer, 135-136 Break-beam alarm. 1- 2 Bug shoo, 55 Buzz box continuity tester and coil checker. 97 Capacitance substitution box, 97-98 CB power supply, 151 Celsius thermometer, 187 Clipping indicator for stereo amplifi1:r, 174-175 Code practice oscillator. 82-83

Combination-lock!ularm control, 1-5 Complex sound generator, 138-139, 141-142 Computer-controlled triac dimmer, 11 1- 113 Computer music box peripheral, 118-120 Continuity tester, 98-99 Controlling a motor (Apple Illlle), 24-25 Controlling a motor with light (Apple llillel, 25 Current-limited 6-V battery charger, 49-50 DC motor speed control using an SCR, 128-129 DC power supplies from recycled ac adapters, 156 Decision maker, 71-73 Digital alarm clock/thermometer, 188- 190 Digital automotive clock, 68. 70 Digital automotive tuneup meter, 40, 42 - 43 Digital color organ, 93-95 Digital counter