■ FIGURE 7
'* Notes :The program generates a binary 3 digit sequence to *
'* :switch the multiplexer every 30 seconds. A second *
'* :port outputs a 3 digit sequence every 60 seconds to *
'* :keep track of which cylinder is being monitored. *
'* :A ground on GPIO.5 will stop the count as long as *
'* :the button is pressd.
'***************************************************
REM DEVICE = 16F627A
REM DISABLE LOW VOLTAGE PROGRAMMING
REM CONFIGURATION: INTOSC CLOCKOUT, WDT DISABLED, PWR UP ENABLED,
REM MCLR ENABLED, BROWNOUT DISABLED, NO PROTECTION
the needed circuit.
— Arsenio C. Problete, Jr.
REM PORT B ARE OUTPUT, HOLD INPUT ON PORTB.3 (PIN 9)
REM RA5 (PIN4) IS MASTER CLEAR, RA6 (PIN15) IS CLOCK OUT TEST POINT.
CMCON = 7
TRISA = %00100000 'PORTA.5 IS MASTER CLEAR
TRISB = %00001000 'PORTB.3 IS HOLD INPUT
CNT VAR BYTE
DIGIT VAR BYTE
START:
FOR CNT =0 TO 7
IF CNT<2 THEN DIGIT =1
IF CNT = 2 OR CNT = 3 THEN DIGIT =2
IF CNT = 4 OR CNT = 5 THEN DIGIT =3
IF CNT = 6 OR CNT = 7 THEN DIGIT =4
PORTA = DIGIT
PORTB = CNT
IF PORTB.3 = 0 THEN GOSUB HOLD
PAUSE 30000 '30 SECONDS
NEXT CNT
GOTO START
HOLD:
IF PORTB.3 = 0 THEN GOTO HOLD
RETURN
END
■ FIGURE 8
AA 40 watt fluorescent tube
gives a lot more light than
a 100 watt bulb because
of its greater surface
area; 10,000 mcd ( 10 candles,
equivalent to 126 lumens) is an
intensity measure and LEDs of that
intensity usually have viewing angles
of 20 to 30 degrees. You’ll need 12
to cover 360 degrees and many
more to cover a hemisphere.
Without going through the math, I
am going to estimate 31 LEDs in the
hemisphere. If these are connected
in series, the total voltage is: 31 3. 5
= 108.5 volts. The 250 VAC source
will give 336 volts DC. The total
power input at 20 mA is 6. 7 watts
which is not bad for 126 lumens of
light. That is assuming you use an
11K, five watt resistor in series. Since
you will only save a couple of watts
by using PWM, I think the resistor is
the best way to go.
My 100 watt incandescent lamp
package lists the lumens as 1,700, so
the LED light is 1/10 as bright. You
can buy a commercial LED lamp to
30
February 2009