YAGI

Developer(s): Bob Howard (WA6DLI)
Date: 1984
Type: Program
Platform(s): TS 2068
Tags: Ham Radio

This program calculates element lengths and boom dimensions for Yagi-Uda directional antennas, supporting configurations from 2 to 6 elements across a wide frequency range. The user inputs a center frequency in MHz and the number of elements; the program then computes reflector, driven element, and up to four director lengths using wavelength-based formulas, outputting results in either feet or inches depending on whether the frequency is above or below 70 MHz. Element diameter recommendations are provided based on the optimum computed diameter, which itself varies by frequency band using three conditional ranges. The program concludes with a text-mode diagram of the antenna, boom length and spacing data, feedpoint impedance guidance, and performance figures (gain, beamwidth, front-to-back ratio) that are fixed lookup values per element count rather than dynamically computed. A suite of short subroutines at lines 3100–3210 handle rounding of element dimensions to two decimal places.


Program Structure

The program is organized into a linear front-end (lines 10–780) that collects inputs and computes shared parameters, followed by six element-count branches (lines 820–2540) dispatched by a computed GO TO at lines 730–780. A common tail section (lines 2550–3090) handles element diameter recommendations, boom advice, and feedpoint guidance. Lines 3100–3210 are a set of short rounding subroutines. Lines 3220–3610 draw a text-mode antenna diagram and handle the repeat/exit dialogue.

Input and Frequency Branching

After collecting frequency F and element count N, the program computes wavelength W = 300/F and derived values. Within each element-count section, a single threshold test at F > 70 selects between feet (multiplier A = 3.281) and inches (multiplier B = 39.37) for all printed dimensions. This 70 MHz crossover separates HF/low-VHF (feet output) from VHF/UHF (inches output).

Element Length Formulas

All element half-lengths are computed as fixed fractions of the wavelength W:

VariableFormulaDescription
REW * 0.482Reflector
DEW * 0.4579Driven element
DD1W * 0.435Director 1
DD2W * 0.4132Director 2
DD3W * 0.3926Director 3
DD4W * 0.37297Director 4

Directors progressively shorten, following standard Yagi design practice. These are full-element lengths scaled from wavelength, not half-element values.

Element Diameter Calculation

Optimum element diameter D is derived from X = 11803/F (the half-wavelength in inches) multiplied by a band-dependent factor:

  • F < 10 MHz: factor 0.0012
  • 10 ≤ F ≤ 23 MHz: factor 0.002
  • F > 23 MHz: factor 0.0029

Boom diameter BD is then set as a multiple of D based on three further frequency ranges (≤100, ≤200, >200 MHz), giving larger booms at higher frequencies. The material recommendation section (lines 2600–2810) maps computed D to standard tubing sizes using a cascade of IF D <= threshold tests with paired GO SUB 2820 calls.

Rounding Subroutines

Six nearly identical subroutines at lines 3100–3210 round each element variable to two decimal places using the idiom INT(X * 100) / 100. While this could have been a single parameterized subroutine, splitting them avoids the need for a temporary variable and keeps the call sites simple. The boom diameter rounding at line 490 uses a half-adjust trick: INT(BD * 10 + 0.5) / 10 for proper rounding rather than truncation.

Performance Figures

Gain, beamwidth, and front-to-back ratio are fixed string constants per element count, not computed from the antenna geometry. These are tabulated values embedded directly in PRINT statements, making them frequency-independent approximations suitable for a general design guide but not precise for any specific case. Notably, the 6-element front-to-back ratio (10 dB) is lower than the 5-element figure (19 dB), which appears anomalous but may reflect the source article’s published data.

Text Diagram

Lines 3240–3360 draw a side-view ASCII diagram of the antenna using \\ : block graphic characters to represent the boom. Director lines are conditionally printed based on EN >= N tests, so the diagram scales with the number of elements. The forward direction indicator and boom/spacing summary complete the display.

Control Flow Anomalies and Notable Idioms

  • Lines 360–410 use consecutive paired IF tests (one to assign, one to GO TO) instead of IF...THEN...ELSE, a common Sinclair BASIC idiom.
  • Lines 790–810 define a FOR/NEXT blank-line loop that is never reached, as execution jumps over it via the GO TO dispatch at line 780.
  • The variable Z is assigned twice: first as 6.562 * W (minimum mounting height in feet, two wavelengths) at line 320, then overwritten at line 3060 after the main output sections. This reuse is intentional but could cause confusion if the display sections were reordered.
  • The DIM P$(1) at line 90 pre-dimensions the input string to one character, ensuring only Y or N is accepted cleanly from INPUT at lines 3530 and 3560.
  • The repeat loop at line 3540 uses IF P$ <> "N" THEN RUN, restarting the entire program for a new design rather than branching back to the input section, which resets all variables cleanly.
  • Lines 3620–3640 provide two SAVE commands outside the normal execution path, allowing the program to be saved with or without an auto-run line.

Image Gallery

Source Code

   10 REM   YAGI ANTENNA DESIGN
   20 REM HUGH WELLS 7/81 W6WTU
   30 POKE 23658,8
   40 PAPER 1:BORDER 1:INK 7:CLS 
   50 PRINT AT 10,6;"YAGI ANTENNA DESIGN"
   60 PRINT ,,,,"TRANSLATED BY WA6DLI","FROM 73 MAGAZINE 5/84"
   70 PAUSE 200
   80 CLS 
   90 DIM P$(1)
  100 PRINT ,,,,,,,,,,
  110 PRINT "CUSTOM DESIGNED  YAGI ANTENNA:"
  120 LET F=0
  130 LET N=F
  140 LET EN=F
  150 PRINT ,,"ENTER THE CENTER FREQUENCY TO   THE NEAREST O.1 MHZ."
  160 PRINT 
  170 PRINT "THE FREQUENCY IS ";
  180 INPUT F
  190 PRINT F;" MHZ."
  200 PRINT 
  210 PRINT "HOW MANY ELEMENTS (2 TO 6)?";
  220 INPUT N
  230 PRINT N
  240 PAUSE 60
  250 CLS 
  260 PRINT ,,"CENTER FREQUENCY: ";F;" MHZ.","THE YAGI TO HAVE ";N;" ELEMENTS."
  270 PRINT 
  280 LET BWL= INT ((.97*F)*100)/100
  290 LET BWH= INT ((1.03*F)*100)/100
  300 LET W=300/F
  310 LET S=W*.2
  320 LET Z=6.562*W
  330 LET S1= INT ((S*3.281)*100)/100
  340 LET S2= INT ((S*39.37)*100)/100
  350 LET X=11803/F
  360 IF F<10 THEN LET D=X*1.2E-03
  370 IF F<10 THEN GO TO 420
  380 IF F <=23 THEN LET D=X*2.0E-03
  390 IF F <=23 THEN GO TO 420
  400 IF F>23 THEN LET D=X*2.9E-03
  410 IF F>23 THEN GO TO 420
  420 LET D= INT (D*1000)/1000
  430 IF F <=100 THEN LET BD=D*1.5
  440 IF F <=100 THEN GO TO 490
  450 IF F <=200 THEN LET BD=D*2
  460 IF F <=200 THEN GO TO 490
  470 IF F>200 THEN LET BD=D*3.5
  480 IF F>200 THEN GO TO 490
  490 LET BD= INT (BD*10+0.5)
  500 LET RE=W*.482
  510 LET A=3.281
  520 LET DE=W*.4579
  530 LET DD1=W*.435
  540 LET BD=BD/10
  550 LET DD4=W*.37297
  560 LET B=39.37
  570 LET DD3=W*.3926
  580 LET DD2=W*.4132
  590 PRINT "THE YAGI DIMENSIONS FOLLOW:"
  600 LET A$="REFLECTOR ELEMENT:  "
  610 LET B$=" FEET        "
  620 LET C$=" INCHES"
  630 LET D$="DRIVEN ELEMENT IS  "
  640 LET E$="FIRST DIRECTOR IS  "
  650 LET F$="SECOND DIRECTOR IS  "
  660 LET G$="THIRD DIRECTOR IS   "
  670 LET H$="FORWARD GAIN VS DIPOLE IS "
  680 LET J$="FOR FREQ.: "
  690 LET K$="FORWARD BEAM WIDTH IS "
  700 LET L$=" DEG."
  710 LET M$="FRONT-TO-BACK RATIO IS "
  720 LET N$="FOURTH DIRECTOR IS  "
  730 IF N=2 THEN GO TO 820
  740 IF N=3 THEN GO TO 1020
  750 IF N=4 THEN GO TO 1300
  760 IF N=5 THEN GO TO 1660
  770 IF N=6 THEN GO TO 2080
  780 GO TO 120
  790 FOR I=1 TO 5
  800 PRINT 
  810 NEXT I
  820 REM 2 ELEMENTS
  830 IF F>70 THEN GO TO 910
  840 LET REF=RE*A
  850 GO SUB 3100
  860 LET DEL=DE*A
  870 GO SUB 3120
  880 PRINT A$;REF;B$
  890 PRINT D$;DEL;B$
  900 GO TO 970
  910 LET REF=RE*B
  920 GO SUB 3100
  930 LET DEL=DE*B
  940 GO SUB 3120
  950 PRINT A$;REF;C$
  960 PRINT D$;DEL;C$
  970 PRINT H$;" 5 DB"
  980 PRINT J$;BWL;" TO ";BWH;" MHZ."
  990 PRINT K$;" 70 ";L$
 1000 PRINT M$;" 8 DB."
 1010 GO TO 2550
 1020 REM 3 ELEMENTS
 1030 IF F>70 THEN GO TO 1150
 1040 LET REF=RE*A
 1050 GO SUB 3100
 1060 LET DEL=DE*A
 1070 GO SUB 3120
 1080 LET D1=DD1*A
 1090 GO SUB 3140
 1100 PRINT A$;REF;B$
 1110 PRINT D$;DEL;B$
 1120 PRINT E$;D1;B$
 1130 LET EN=3
 1140 GO TO 1240
 1150 LET REF=RE*B
 1160 GO SUB 3100
 1170 LET DEL=DE*B
 1180 GO SUB 3120
 1190 LET D1=DD1*B
 1200 GO SUB 3140
 1210 PRINT A$;REF;C$
 1220 PRINT D$;DEL;C$
 1230 PRINT E$;D1;C$
 1240 PRINT H$;" 7 DB."
 1250 PRINT J$;BWL;" TO ";BWH;" MHZ."
 1260 PRINT K$;" 50 ";L$
 1270 PRINT M$;" 10 DB."
 1280 LET EN=3
 1290 GO TO 2550
 1300 REM 4 ELEMENTS
 1310 IF F>70 THEN GO TO 1460
 1320 LET REF=RE*A
 1330 GO SUB 3100
 1340 LET DEL=DE*A
 1350 GO SUB 3120
 1360 LET D1=DD1*A
 1370 GO SUB 3140
 1380 LET D2=DD2*A
 1390 GO SUB 3160
 1400 PRINT A$;REF;B$
 1410 PRINT D$;DEL;B$
 1420 PRINT E$;D1;B$
 1430 PRINT F$;D2;B$
 1440 LET EN=4
 1450 GO TO 1580
 1460 LET REF=RE*B
 1470 GO SUB 3100
 1480 LET DEL=DE*B
 1490 GO SUB 3120
 1500 LET D1=DD1*B
 1510 GO SUB 3140
 1520 LET D2=DD2*B
 1530 GO SUB 3160
 1540 PRINT A$;REF;C$
 1550 PRINT D$;DEL;C$
 1560 PRINT E$;D1;C$
 1570 PRINT F$;D2;C$
 1580 PRINT H$;" 8 DB."
 1590 PRINT J$;BWL;" TO ";BWH;" MHZ"
 1600 PRINT K$;" 45 ";L$
 1610 PRINT M$;" 12 DB."
 1620 LET EN=4
 1630 IF EN>3 THEN PAUSE 600
 1640 IF EN>3 THEN CLS 
 1650 GO TO 2550
 1660 REM 5 ELEMENTS
 1670 IF F>70 THEN GO TO 1850
 1680 LET REF=RE*A
 1690 GO SUB 3100
 1700 LET DEL=DE*A
 1710 GO SUB 3120
 1720 LET D1=DD1*A
 1730 GO SUB 3140
 1740 LET D2=DD2*A
 1750 GO SUB 3160
 1760 LET D3=DD3*A
 1770 GO SUB 3180
 1780 PRINT A$;REF;B$
 1790 PRINT D$;DEL;B$
 1800 PRINT E$;D1;B$
 1810 PRINT F$;D2;B$
 1820 PRINT G$;D3;B$
 1830 LET EN=5
 1840 GO TO 2000
 1850 LET REF=RE*B
 1860 GO SUB 3100
 1870 LET DEL=DE*B
 1880 GO SUB 3120
 1890 LET D1=DD1*B
 1900 GO SUB 3140
 1910 LET D2=DD2*B
 1920 GO SUB 3160
 1930 LET D3=DD3*B
 1940 GO SUB 3180
 1950 PRINT A$;REF;C$
 1960 PRINT D$;DEL;C$
 1970 PRINT E$;D1;C$
 1980 PRINT F$;D2;C$
 1990 PRINT G$;D3;C$
 2000 PRINT H$;" 9 DB"
 2010 PRINT J$;BWL;" TO ";BWH;" MHZ."
 2020 PRINT K$;" 40 ";L$
 2030 PRINT M$;" 19 DB."
 2040 LET EN=5
 2050 IF EN>3 THEN PAUSE 600
 2060 IF EN>3 THEN CLS 
 2070 GO TO 2550
 2080 REM 6 ELEMENTS
 2090 IF F>70 THEN GO TO 2300
 2100 LET REF=RE*A
 2110 GO SUB 3100
 2120 LET DEL=DE*A
 2130 GO SUB 3120
 2140 LET D1=DD1*A
 2150 GO SUB 3140
 2160 LET D2=DD2*A
 2170 GO SUB 3160
 2180 LET D3=DD3*A
 2190 GO SUB 3180
 2200 LET D4=DD4*A
 2210 GO SUB 3200
 2220 PRINT A$;REF;B$
 2230 PRINT D$;DEL;B$
 2240 PRINT E$;D1;B$
 2250 PRINT F$;D2;B$
 2260 PRINT G$;D3;B$
 2270 PRINT N$;D4;B$
 2280 LET EN=6
 2290 GO TO 2480
 2300 LET REF=RE*B
 2310 GO SUB 3100
 2320 LET DEL=DE*B
 2330 GO SUB 3120
 2340 LET D1=DD1*B
 2350 GO SUB 3140
 2360 LET D2=DD2*B
 2370 GO SUB 3160
 2380 LET D3=DD3*B
 2390 GO SUB 3180
 2400 LET D4=DD4*B
 2410 GO SUB 3200
 2420 PRINT A$;REF;C$
 2430 PRINT D$;DEL;C$
 2440 PRINT E$;D1;C$
 2450 PRINT F$;D2;C$
 2460 PRINT G$;D3;C$
 2470 PRINT N$;D4;C$
 2480 PRINT H$;" 11 DB"
 2490 PRINT J$;BWL;" TO ";BWH;" MHZ."
 2500 PRINT K$;" 35 ";L$
 2510 PRINT M$;" 10 DB."
 2520 LET EN=6
 2530 IF EN>3 THEN PAUSE 600
 2540 IF EN>3 THEN CLS 
 2550 REM ELEMENT DIAM.
 2560 PRINT "WATCH WIND AND BIRD LOADING."
 2570 PRINT "THIS YAGI ASSUMES CONSTANT DIAM.OF BOOM AND ELEMENTS."
 2580 PRINT "OPTIMUM ELEMENT DIAM. IS ";D;"  INCHES."
 2590 LET I$=" INCH MATERIAL"
 2600 IF D <=0.135 THEN PRINT "USE 1/8";I$
 2610 IF D <=0.135 THEN GO SUB 2820
 2620 IF D <=0.3 THEN PRINT "USE 1/4";I$
 2630 IF D <=0.3 THEN GO SUB 2820
 2640 IF D <=0.4 THEN PRINT "USE 3/8";I$
 2650 IF D <=0.4 THEN GO SUB 2820
 2660 IF D <=0.5 THEN PRINT "USE 3/8 OR 1/2";I$
 2670 IF D <=0.5 THEN GO SUB 2820
 2680 IF D <=0.6 THEN PRINT "USE 1/2 OR 5/8";I$
 2690 IF D <=0.6 THEN GO SUB 2820
 2700 IF D <=0.8 THEN PRINT "USE 5/8 OR 3/4";I$
 2710 IF D <=0.8 THEN GO SUB 2820
 2720 IF D <=1.2 THEN PRINT "USE 1 OR 1-1/4";I$
 2730 IF D <=1.2 THEN GO SUB 2820
 2740 IF D <=1.6 THEN PRINT "USE 1-1/4 OR 1-1/2 INCH STOCK."
 2750 IF D <=1.6 THEN GO SUB 2820
 2760 IF D <=1.8 THEN PRINT "USE 1-1/2 OR 1-3/4 INCH STOCK."
 2770 IF D <=1.8 THEN GO SUB 2820
 2780 IF D <=2 THEN PRINT "USE 1-3/4 OR 2 INCH STOCK."
 2790 IF D <=2 THEN GO SUB 2820
 2800 IF D <=2.3 THEN PRINT "USE 2 OR 2-1/4";I$
 2810 IF D>2.3 THEN PRINT "**THE MATERIAL FOR THE YAGI MAY BE TOO HEAVY TO BE SELF-SUPORT- ING**"
 2820 REM BOOM
 2830 IF EN<4 THEN PAUSE 600
 2840 IF EN<4 THEN CLS 
 2850 PRINT ,,"BEST SPACING FOR MAX FORWARD","GAIN IS 0.2 THE WAVLENGTH."
 2860 IF F>70 THEN GO TO 2890
 2870 PRINT "SPACING IS ";S1;" FT. BETWEEN EL.  CENTERS. BOOM ABT. "; INT (S1*(N-1)+1);" FT."
 2880 GO TO 2900
 2890 PRINT "SPACING IS ";S2;" IN. BETWEEN EL.CENTERS. BOOM ABT. "; INT (S2*(N-1)+5);" IN."
 2900 PRINT "BEST BOOM DIAM. IS ABOUT ";BD;" IN."
 2910 PRINT "IF ELEMENTS ACCURATELY CENTERED","THEN CURRENT MINIMUM AND A METALBOOM OK."
 2920 REM FEEDPOINT
 2930 PRINT "FEED-POINT OF A CENTER  BROKEN  ELEMENT HAS IMPEDANCE LOWERED TO"
 2940 PRINT "APPROX. 10-20 OHMS (BALANCED) IF"
 2950 PRINT "ELEMENT SURROUNDED BY PARASITIC ELEMENTS."
 2960 PAUSE 800
 2970 CLS 
 2980 PRINT "IF LOW IMPEDANCE IS  PROBLEM USE A  T  OR GAMMA MATCH"
 2990 PRINT " OR PERHAPS A  BALUN  WILL DO."
 3000 PRINT ,,"AN  UNBROKEN  ELEMENT CAN BE","DRIVEN WITH  T  OR GAMMA DEVICE."
 3010 PRINT ,,"IMPEDANCE OF A  BROKEN  ELEMENT CAN BE INCREASED BY USING A BIT SMALLER  DIAMETER DRIVE ELEMENT."
 3020 PRINT "A  FOLDED  DRIVER ELEMENT WITHINPARASITIC ELEMENTS WILL HAVE A"
 3030 PRINT "BALANCED FEED-POINT IMPEDANCE OFNEARLY 52-OHMS."
 3040 PRINT ,,"YAGI-ANTENNAS ARE FAIRLY HI-Q,  SO OPERATE OVER A NARROW RANGE"
 3050 PRINT "OF FREQUENCIES WITH EFFICIENCY  OF 75-95 PERCENT."
 3060 LET Z= INT (Z*10)/10
 3070 PRINT "YAGI MUST BE MOUNTED A MINIMUM  OF ";Z;" FT. (2 WAVELENGTHS) IN THE CLEAR."
 3080 PAUSE 700
 3090 GO TO 3220
 3100 LET REF= INT (REF*100)/100
 3110 RETURN 
 3120 LET DEL= INT (DEL*100)/100
 3130 RETURN 
 3140 LET D1= INT (D1*100)/100
 3150 RETURN 
 3160 LET D2= INT (D2*100)/100
 3170 RETURN 
 3180 LET D3= INT (D3*100)/100
 3190 RETURN 
 3200 LET D4= INT (D4*100)/100
 3210 RETURN 
 3220 CLS 
 3230 REM  YAGI DIAGRAM
 3240 PRINT ,,"       BOOM >\ :  F= ";F;" MHZ"
 3250 PRINT "RE ----------\ :----------"
 3260 PRINT "             \ :"
 3270 PRINT "DR  ---------\ :---------"
 3280 IF EN >=3 THEN PRINT "             \ :"
 3290 IF EN >=3 THEN PRINT "D1   --------\ :--------"
 3300 IF EN >=4 THEN PRINT "             \ :"
 3310 IF EN >=4 THEN PRINT "D2    -------\ :-------"
 3320 IF EN >=5 THEN PRINT "             \ :"
 3330 IF EN >=5 THEN PRINT "D3     ------\ :------"
 3340 IF EN >=6 THEN PRINT "             \ :"
 3350 IF EN >=6 THEN PRINT "D4      -----\ :-----"
 3360 PRINT ,,"             I FORWARD DIRECTION"
 3370 PRINT "             V"
 3380 PRINT ,,,,
 3390 IF F>70 THEN GO TO 3420
 3400 PRINT "BOOM= ";S1*(N-1);B$,"SPACING = ";S1;B$
 3410 IF F <=70 THEN GO TO 3440
 3420 PRINT "BOOM= ";S2*(N-1);C$,"SPACING = ";S2;C$
 3430 PRINT 
 3440 PRINT "GAIN = ";
 3450 IF N=2 THEN PRINT "5 DB."
 3460 IF N=3 THEN PRINT "7 DB."
 3470 IF N=4 THEN PRINT "8 DB."
 3480 IF N=5 THEN PRINT "9 DB."
 3490 IF N=6 THEN PRINT "11 DB."
 3500 PAUSE 500
 3510 CLS 
 3520 PRINT ,,"WANT ANOTHER DESIGN?    Y/N?"
 3530 INPUT P$
 3540 IF P$ <>"N" THEN RUN 
 3550 PRINT "WANT TO SEE THIS DESIGN AGAIN? Y/N?"
 3560 INPUT P$
 3570 CLS 
 3580 IF P$ <>"N" THEN CLS 
 3590 IF P$ <>"N" THEN GO TO 260
 3600 PRINT AT 15,12;"BYE-BYE",,,,,,"TNX TO 73 MAG     AND HUGH WELLS, W6WTU"
 3610 STOP 
 3620 SAVE "YAGI"
 3630 RUN 
 3640 SAVE "YAGI" LINE 10

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.