Sierra

Radio

PayPal: View Cart

Project:  W1GQ’s Smart High Power Dummy Load



As the temperature rises past the first programmed threshold, fan #1 turns on.  If the temperature rises past the second threshold, fan #2 turns on.  

If the temperature continues to rise past the alarm threshold, the alarm will sound.


LED’s on the front panel indicate the current state of the fans.


The temperature is displayed on the backlit LCD display.









Inside View


You can see the HamStack CPU board mounted to the chassis on the left.


In the center is the HamStack dual 8A relay board which controls the the two high power fans.


The temperature sensor is a Maxim DS18B20 digital thermometer encased in a metal cylinder.


The sensor talks to the CPU board using the Maxim (Dallas Semiconductor) OneWire serial device protocol

High-Power HF Dummy Load


This project is all about building a really high end dummy load for a top notch contest station.

 

One challenge is to monitor the temperature of the dummy load and turn on the cooling fans at the right time.  


A visible indication of temperature and relay state is provided by the LCD display and LEDs.


An alarm will sound if the temperature exceeds the spec of the dummy load.

{

*****************************************************************************

*  Name    : DummyLoad Project us HamStack                                  *

*  Author  : Bruce J (W1GQ)                                                 *

*  Date    : March 23, 2011                                                 *

*  Version : 1.0                                                            *

*****************************************************************************


PORT Configuration

..PortB.0 - Front panel switch for manual high-speed fan; input command

..PortB.1 - Over Temperature front panel LED

..PortB.2 - Relay 2 is high fan speed

..PortB.3 - Relay 1 is Low fan speed through at 200 ohm resistor

..PortC.0 - On Hamstack Board LED (status)


..NOTE - Cascading If statments to prevent LCD blinking and Relay on/off

         during loop.

}


'-----[ Hardware configuration ]---------------------------------------------

Device = 18F4620

Clock = 16


#option LCD_DATA = PORTD.0                                             'LCD Setup

#option LCD_RS = PORTD.4

#option LCD_EN = PORTD.5


'-----[ Include necessary library files ]------------------------------------

Include "usart.bas"

Include "lcd.bas"

Include "DS18B20.bas"

Include "convert.bas"

Include "utils.bas"


'-----[ Define variables ]---------------------------------------------------

Dim LED As PORTC.0                                                     ' Status LED

Dim relay1 As PORTB.3                                                  ' Fan relay 1

Dim relay2 As PORTB.2                                                  ' Fan relay 2

Dim TempOVER As PORTB.1                                                ' Over Temp front panel LED

Dim ManualHIGH As PORTB.0                             ' Turn on FAN high on front panel (define as input TRISAx = 1

Dim TempA As ShortInt                                                  ' Temp C from DS18B20

Dim TempB As Word                                                      ' Temp C from DS18B20

Dim tempf As Word                                                      ' Temp converted from C to F


'-----[ Initialize program ]-------------------------------------------------

TRISB.0 = 1                                           ' Set B.0 to input (TRISA.x   = 1 input = 0 output)

SetBaudrate (br9600)                                                   ' Set serial port to 9600 baud

SetPin(PORTE.0)                                                        ' Assign pin RE0 to temperature probe

Low(LED)                                                               ' Set status LED to off

Low(TempOVER)                                                          ' Clear LCD screen

Cls                                                              


'-----[ Splash Screen ]------------------------------------------------------

USART.Write("Starting program",10,13)                                  ' send message to serial port

Cls                                                                    ' clear LCD

WriteAt(1,1,"W1GQ - Dummyload")                                        ' write line 1, splash

WriteAt(2,1,"Startup Sequence")                                        ' write line 2, splash

DelayMS (2000)

'-----[ Sequence FANS ]------------------------------------------------------

High (relay1)                                                          ' low fan speed

WriteAt(1,1,"Startup Sequence")                                        ' write line 1

WriteAt(2,1,"Fan: Low Speed  ")                                        ' write line 2

DelayMS (2000)


High (relay2)                                                          ' High fan speed

WriteAt(1,1,"Startup Sequence")                                        ' write line 1

WriteAt(2,1,"Fan: High Speed ")                                        ' write line 2

DelayMS (1500)


High (TempOVER)                                                        ' Over Team front panel LED

WriteAt(1,1,"Startup Sequence")                                        ' write line 1

WriteAt(2,1,"DANGER Over Temp")                                        ' write line 2

DelayMS (1500)

Low (TempOVER)


High (relay2)                                                          ' High fan speed

WriteAt(1,1,"Startup Sequence")                                        ' write line 1

WriteAt(2,1,"Fan: High Speed ")                                        ' write line 2

DelayMS (1500)

Low (relay2)


High (relay1)                                                          ' low fan speed

WriteAt(1,1,"Startup Sequence")                                        ' write line 1

WriteAt(2,1,"Fan: Low Speed  ")                                        ' write line 2

DelayMS (1500)

Low (relay1)

           

WriteAt(1,1,"W1GQ - Dummyload")                                        ' write line 1, splash

WriteAt(2,1,"  ~~ READY ~~   ")                                        ' write line 2, splash


DelayMS(2000)                                                          ' Delay Splash Screen


'-----[ initialize LCD ]-----------------------------------------------------

    Cls

    WriteAt (1,1,"Temp =        ")                                      ' Write Temp to LCD    

    WriteAt(2,1,"Fan OFF        ")                                      ' Write LCD message


'-----[ Start Program Loop ]-------------------------------------------------

If Not Find Then                                                        ' Look for temperature probe

   USART.Write ("No Temp Prob Found", 10, 13)                           ' Send message to serial port

   WriteAt(1,1,"No Temp Prob Found")                                    ' write message to LCD

Else                                                            ' Temperature probe found, process normally...

    While true                                                          ' Do this loop forever

          Convert           

          GetTemp(TempA, TempB)                                         ' Get temp information

          tempf = (TempA*1.8)+32                                        ' Convert C to F

          USART.Write ("Temp = ", DecToStr(tempf), 10, 13)              ' Send to Serial port

          WriteAt (1,1,"          ")                                    ' Clear LCD

          WriteAt (1,1,"Temp = ", DecToStr(tempf))                      ' Write Temp to LCD


'[Manual front panel switch turn on ]

          ManualHIGH = (PORTB.0)

          If ManualHIGH = 0 Then                                         ' Front Panel Switch to turn on FAN

                WriteAt(2,1,"Switch ON       ")                          ' Write LCD message                

                DelayMS (500)                                            ' delay by 500ms                

                High (relay1)                                            ' low speed fan

                DelayMS (1000)                                           ' delay by 500ms

                High (relay2)                                            ' high speed fan

          Else


'[Over Temp Warning]      

               If tempf > 110 Then                                       ' Over Temperature

                     WriteAt(2,1,"DANGER: > 110F   ")                    ' write line 2  

                     USART.Write("Fan OVER Temp",10,13)                  'serial port message

                     High (TempOVER)                                     ' Turn ON Front Panel LED  

               Else


'[Greater than 95F turn on FAN HIGH]           

                    If tempf > 95 Then                                   ' Second temperature trigger

                         USART.Write("Fan High, First temperature trigger at >90F",10,13) 'serial port message

                         WriteAt(2,1,"Fan High: > 95F ")                 ' Write LCD message             

                         High (relay2)                                   ' Turn on Relay 2

                         Low (TempOVER)                                  ' Turn OFF Front Panel LED

                    Else                      


'[Greater than 85F turn on FAN Low ]

                        If tempf > 85 Then                                ' First temperature trigger

                             USART.Write("Fan LOW, First temperature trigger > 85F",10,13) 'serial port message

                             Low (TempOVER)                               ' Turn OFF Front Panel LED

                             WriteAt(2,1,"Fan Low: > 85F ")               ' Write to LCD

                             Low (relay2)

                             DelayMS (500)

'[If NOT ManualHIgh, under warning temp, less than 95 and less than 85 then turn fan off]

                        Else

                             Low (relay2)

                             DelayMS (1000)

                             Low (relay1)                                 

                             WriteAt(2,1,"Fan OFF        ")               ' Write LCD message

                        EndIf                                             ' low fan end        

                   EndIf                                                  ' high fan end

               EndIf                                                      ' over temp end

         EndIf                                                            ' manual on/off end

    Wend                                                                  ' Wend is for the While loop

EndIf                                                                     ' EndIf for the prob statement            



Swordfish Basic source code