Ohm’s Law

Author(s): Blase Sanzone
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n10 (Volume 3, Issue 10)
Date: October 1982
Pages: 16-17

Ohm’s Law is a useful formula for electronics hobbyists. Using this formula you can calculate the value of a resistor (Ohms), its wattage and the amount of current a circuit will draw. Knowing two pieces of information will allow you to calculate the third.

For example: Your computer and printer need 9VDC at 1.2 amps and you have a 12VDC power supply rated at 1.5 amps. How many Ohms and what wattage rating are needed for the resistor?

Enter the program as listed, RUN. First, the program displays the formula menu. Select the formula you wish to use by entering its number. The computer then displays the formula with an explanation of the variables used. Answer the prompts by entering a value for each variable in the proper unit of measurement. The computer calculates the third variable and asks if you want to continue. Yes gets you back to the menu; No ends the program

Let’s work through our example. Select the formula for calculating resistance. Input the voltage drop (12-9=3) and the current rating of the device, computer and printer (1.2 amps). You see that you need a 2.5 Ohm resistor to drop the voltage from the 12VDC available to the 9VDC needed. You next need to calculate the wattage for this resistor. Select formula 2 from the menu and enter the required variables (2.5 Ohms & 1.2 amps). You now know that you need a 2.5 Ohm resistor rated at least 3.6 watts in series with the power supply to safely run your computer and printer. (Remember: Voltage drop is the difference between available voltage and needed voltage. Express current in terms of amps., for example, 650 millamps = 0.65 amps.)

   5 CLS
10 PRINT AT 0,10;"OHMS LAW"
15 PRINT
20 PRINT "YOU CAN CALCULATE THE FOLLOWING:"
25 PRINT "--------------------------------"
30 PRINT "1 RESISTANCE (OHMS)"
35 PRINT "2 WATTS"
40 PRINT "3 CURRENT (AMPS)"
45 PRINT
50 PRINT "SELECT BY ENTERING A NUMBER"
60 PAUSE 40000
70 LET K$=INKEY$
80 IF K$<"1" OR K$>"3" THEN GOTO 70
90 GOTO VAL K$*100
100 CLS
105 PRINT "THE FORMULA FOR CALCULATING RESISTANCE IS: R=E/I"
110 PRINT
115 PRINT "E=VOLTAGE DROP(AVAILABLE-NEEDED)";"I=CURRENT (IN AMPS)"
120 PRINT "********************************"
125 PRINT "ENTER VOLTAGE DROP"
130 INPUT E
135 PRINT AT 6,20;E
140 PRINT "ENTER CURRENT IN AMPS"
145 INPUT I
150 PRINT AT 7,23;I
155 LET R=E/I
160 LET X=R
165 GOSUB 400
170 LET R=X
175 PRINT AT 10,0;"A ";R;" OHM RESISTOR IS NEEDED TO","REDUCE THE AVAILABLE VOLTAGE BY",E;" VOLT(S) TO A DEVICE DRAWING",I;" AMP(S)."
180 GOTO 500
200 CLS
205 PRINT "THE FORMULA FOR CALCULATING WATTAGE IS: P=I**2*R"
210 PRINT
215 PRINT "I**2=CURRENT,IN AMPS, SQUARED","R=RESISTANCE IN OHMS"
220 PRINT "********************************"
225 PRINT "ENTER THE CURRENT"
230 INPUT I
235 PRINT AT 6,18;I
240 PRINT "ENTER RESISTANCE IN OHMS"
245 INPUT R
250 PRINT AT 7,25;R
255 LET P=I**2*R
260 LET X=P
265 GOSUB 400
270 LET P=X
275 PRINT AT 10,0;"A ";R;" OHM RESISTOR RATED AT ",P;" WATTS IS NEEDED BY A","DEVICE DRAWING ";I;" AMPS."
280 GOTO 500
300 CLS
305 PRINT "THE FORMULA FOR CALCULATING CURRENT IS: I=E/R"
310 PRINT
315 PRINT "E=VOLTAGE DROP",,"R=RESISTANCE IN OHMS"
320 PRINT "********************************"
325 PRINT "ENTER THE VOLTAGE DROP"
330 INPUT E
335 PRINT AT 6,23;E
340 PRINT "ENTER RESISTANCE IN OHMS"
345 INPUT R
350 PRINT AT 7,25;R
355 LET I=E/R
360 LET X=I
365 GOSUB 400
370 LET I=X
375 PRINT AT 10,0;"THE MAXIMUM CURRENT IS ";I;" AMPS","USING A ";R;" OHM RESISTOR TO","DROP THE AVAIABLE VOLTAGE BY ",E;" VOLTS"
380 GOTO 500
400 LET X=(INT (10*(X+(.05))))/10
405 RETURN
500 PRINT AT 15,0;"DO YOU WANT TO CONTINUE Y/N"
505 PAUSE 10000
510 IF INKEY$="Y" THEN GOTO 5
515 IF INKEY$="N" THEN STOP
SYNTACTIC SUM:19638, 8K/16K

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