Category: DC Dummyload

DC Dummyload

I started this project a while ago but did not post it back then because of the lack of time. The point of this project was a simple variable load to test power supply’s. As an extra I put in a voltage, current and temperature measurement circuit.

The power is converted in to heat via 8 2N3055 transistors. Each transistor has his own driver and current feedback. This way I can read then individually in the pic and therefore can check if they are all still in a working state.

aansturing

transistoren

transistoren

There are 2 fans mounted next to the heat sink. The fans suck air to the slots of the heat sink. The temperature is measured with a LM35 which is connected to the pic, so if it gets to hot the pic can shut it all down.

Circuit pic print:

schema picprint

schema picprint

pic print

The power supply I used came from an old hub. (From witch I also recycled this enclosure)

The displays are the same as from my safety transformers V2 and V3. I started this project earlier and copied the design to those two projects

Dtisplay

Front panel ready:

Frontpaneel

in werking

The voltage and current measurement works at the moment. The current measurement is a bit of a problem. The MAX186 seems not to work (or I’m doing something wrong :p). I didn’t have time yet to fix it. The code will be posted as the project is complete.

DC Dummyload – Update

After a long time I decided to start again on this project. Quickly it became clear that there were still a few problems whit this project.

The first problem I encountered was that the transistors started to oscillate and draw to much base current when the voltage started to get to low. The oscillations turned out to be caused by the shutdown circuit I placed on the main pcb. After I removed this circuit the oscillations where gone. But there was still the problem of the too big base current in the transistors. This I solved by added 2 resistors to each step of the output stage.

schema

R4 is added in this circuit. Also there needs to be a 150 Ohm 2W resistor placed between this pcb and the base of the 2N3055.

After these modifications it turned out that the power supply became a bit unstable. Therefore I replaced it by a 16V laptop charger. For the microcontroller and displays I added a voltage regulator pcb to create the required 5V.

The cooling fans need 12V, so I added a second voltage regulator pcb with a 7812 voltage regulator (mounted on the big heat sink).

When I was coding the current measurement I noticed another problem. The base current was also measured. To fix this I added a new pcb based on a ZXCT1086E5TA to measure the current trough the positive lead. This measurement however has the disadvantage to only work above 3V. This I “solved” by adding a few lines in the code which put — on the ampere display when the voltage gets too low.

http://elektronicastynus.be/image/77/Stroommeetprint.png

http://elektronicastynus.be/image/77/1367670001.jpg

http://elektronicastynus.be/image/77/1367670006.jpg

To connect this pcb to the main pcb I had to mod the main pcb a bit:http://elektronicastynus.be/image/77/1367670283.jpg

New circuit:

http://elektronicastynus.be/image/77/Main_schema.png

To get a stable measurement, I take the mean value of a number of samples. For this code, the pic I originally designed into the the project, turned out to be too slow. Therefore I replaced it with a PIC16F25K22 (pin compatible). This pic operates at 64Mhz.

The code:

'****************************************************************
          '*  Name    : Dummyload                                         *
          '*  Author  : Stijn Coenen ElektronicaStynus.be                 *
          '*  Notice  : Copyright (c) 2013 Stijn Coenen (Stynus)          *
          '*          : All Rights Reserved                               *
          '*  Date    : 01/05/2013                                        *
          '*  Version : 1.2                                               *
          '**************************************************************** 
Device = 18F25K22
  Include "Config_Fuses_1_2.bas"    
Xtal = 16
'****************************************************************    
  'EN: Declarations
  'NL: Declaraties
  'Displays
  Symbol  Disp_klok       = LATB.7
        Symbol  Temp_Data       = LATB.2   
        Symbol  Temp_Latch      = LATB.1   
        Symbol  Spanning_Data   = LATB.4
        Symbol  Spanning_Latch  = LATB.3
        Symbol  Stroom_Data     = LATB.6
        Symbol  Stroom_Latch    = LATB.5
        
    'EN: Measurement values
      'NL: Meetwaardes
      Dim     Temperatuur     As Word
        Dim     Spanning        As Word
        Dim     Stroom          As Dword  
        Dim     StroomFloat     As Float  
        Dim     StroomPrecies   As Bit            
        
        Symbol  N_Samp_T        = 10    'Number of measuring samples; Aantal meetwaardes       
          Dim     GemT[N_Samp_T]  As Word 'Array that contains the samples; Array die de meetwaardes bevat                  
            Symbol  N_Samp_U        = 15          
        Dim     GemU[N_Samp_U]  As Word          
        Symbol  N_Samp_I        = 15         
        Dim     GemI[N_Samp_I]  As Word
        
    'EN: Display values
      'NL: Display waardes  
      Dim     DispTemp        As Byte
        Dim     DispSpanning    As Byte
        Dim     DispStroom      As Byte
    
        Dim     DispArT[3]      As Byte 
        Dim     DispArU[3]      As Byte 
        Dim     DispArI[3]      As Byte              
        
        Dim     IntCase         As Byte
        Dim     IntX            As Byte
        Dim     IntDisp         As Byte       
        
        Dim     X               As Byte
        Dim     Temp            As Byte
        
    'EN: Settings AD converter
      'NL: Instellingen AD converter 
      Declare Adin_Res        10 
        Declare Adin_Tad        FRC  
        Declare Adin_Stime      250         
        
    'EN: Connections 7 segment displays on the 74HC595 pcb's
      'NL: Aansluitingen 7 segment displays aan de 74HC595 op de printjes    
      'dPecgbfa
      Symbol  Nul       = %01001000      '       a        '0         
        Symbol  Een       = %11101011      '     #####      '1
          Symbol  Twee      = %01010010      '     #   #      '2
            Symbol  Drie      = %01100010      '   f # g # b    '3
              Symbol  Vier      = %11100001      '     #####      '4
                Symbol  Vijf      = %01100100      '     #   #      '5
                  Symbol  Zes       = %01000100      '   e # d # c    '6
                    Symbol  Zeven     = %11101010      '     #####      '7
                      Symbol  Acht      = %01000000                       '8
                        Symbol  Negen     = %01100000                       '9
                          Symbol  Uit       = %11111111                       'Out
                            Symbol  Streep    = %11110111                       'Bar
                              'EN: Connections of the transistors On the 74HC595 pcb's
                              'NL: Aansluitingen Transistoren aan de 74HC595 op de printjes
                              Symbol  disp1     = %00001100  
        Symbol  disp2     = %00001010  
        Symbol  disp3     = %00000110             
       
    'EN: Misc
      'NL: Diverse
      Symbol  TMR0IF    = INTCON.2
        
        'Tris registers
          TRISA             =  %00111011
        TRISB             =  %00000000
        TRISC             =  %11111111  
         
        All_Digital       = true        
    
        On_Hardware_Interrupt GoTo Interrupts
'****************************************************************    
  Opstarten:     
    'EN: Set clock to 64 Mhz
      'NL: klok instellen op 64 Mhz
      OSCCON  = %01110111
    OSCCON2 = %11000111  

    Clear 'ram
      
      'EN: Timer0 setup to drive the displays
      'NL: Timer0 instellen om de displays aan te sturen
      T0CON   = %11000111
    INTCON  = %10100000
    INTCON2 = %00000100
    INTCON3 = %00000000
    IPR1    = %00000000
    IPR2    = %00000000
    IPR3    = %00000000
    IPR4    = %00000000
    IPR5    = %00000000
    
    'EN: Settings AD converter
      'NL: Instellingen AD converter     
      ADCON1  = %00000000
    ADCON2  = %10010111
    
GoTo Main         
'****************************************************************   
  Interrupts:
    Context Save
    If TMR0IF = 1 Then
        TMR0IF = 0      'Reset flag
          TMR0L  = 230'   'Preloard timer
            
            'EN: Loading data for the display that is driven this interrupt
            'NL: Data inladen voor het display dat deze interrupt wordt aangestuurd
            DispTemp        = DispArT[IntCase]  
        DispSpanning    = DispArU[IntCase]
        DispStroom      = DispArI[IntCase]
        
        'EN: Get the transistor settings and set the decimal point
          'NL: Transistoren info uitlezen en de comma aanzetten
          Select IntCase 
            Case 0
                IntDisp = disp1       
            Case 1          
                IntDisp = disp2       
                DispTemp.6      = 0          
                DispSpanning.6  = 0
                DispStroom.6    = StroomPrecies
            Case 2          
                IntDisp = disp3   
                DispStroom.6    = StroomPrecies + 1 
            Case Else
                IntDisp = 255
                IntCase = 0                
        EndSelect
                           
        'EN: Outputting transistors data 
          'NL: Transistor data inklokken
          For IntX  = 0 To 7
            Temp_Data       = IntDisp.7 
            Spanning_Data   = IntDisp.7
            Stroom_Data     = IntDisp.7
            Disp_klok       = 1           
            IntDisp         = IntDisp * 2             
            Disp_klok       = 0
        Next    
        'EN: Outputting display data 
          'NL: Display data inklokken
          For IntX  = 0 To 7
            Temp_Data       = DispTemp.7 
            Spanning_Data   = DispSpanning.7
            Stroom_Data     = DispStroom.7
            Disp_klok       = 1
            DispTemp        = DispTemp << 1
            DispSpanning    = DispSpanning << 1
            DispStroom      = DispStroom << 1     
            Disp_klok       = 0
        Next               
             
        'EN: Latch data to the outputs of the 74hc595 ic's
          'NL: Data naar de uitgangen van de 74hc595 ic's latchen
          Temp_Latch      = 1
        Spanning_Latch  = 1
        Stroom_Latch    = 1     
        
        'EN: Set counter for next interrupt
          'NL: Teller bijtellen voor volgende interrupt
          Inc IntCase
        If IntCase > 2 Then
            IntCase = 0
        EndIf
        
        Temp_Latch      = 0
        Spanning_Latch  = 0
        Stroom_Latch    = 0 
    EndIf
               
    Context Restore
Return
'****************************************************************     
  Main:
    While 1 = 1    

        'EN: Temperature measurement
          'NL: Temperatuur meting
          For X = (N_Samp_T - 1) To 1 Step -1    
            GemT[X]     = GemT[X-1]      
        Next
        Temperatuur     = ADIn 1
        Temperatuur     = Temperatuur * 5 
        GemT[0]         = Temperatuur / 9 
        Temperatuur     = 0
        For X = 0 To (N_Samp_T - 1)    
            Temperatuur = Temperatuur + GemT[X]
        Next 
        Temperatuur     = Temperatuur / N_Samp_T
        
        
        'EN: Voltage measurement
          'NL: Spannings meting
          For X = (N_Samp_U - 1) To 1 Step -1    
            GemU[X]     = GemU[X-1]      
        Next
        Spanning        = ADIn 0
        GemU[0]         = Spanning /  1.86
        Spanning        = 0
        For X = 0 To (N_Samp_U - 1)    
            Spanning    = Spanning + GemU[X]
        Next 
        Spanning        = Spanning / N_Samp_U
        
        
        'EN: Current measurement
          'NL: Stroom meting    
          For X = (N_Samp_I - 1) To 1 Step -1    
            GemI[X]     = GemI[X-1]      
        Next
        Stroom          = ADIn 16   
        'EN: Setting the decimal point place
          'NL: Plaats comma bepalen                    
          If Stroom > 500 Then 'X.XX
            StroomPrecies = 0  
            StroomFloat = Stroom * (5/1024) * 10   
        Else                 'XX.X  
          StroomPrecies = 1   
            StroomFloat = Stroom * (5/1024) * 100                 
        EndIf  
        StroomFloat     = StroomFloat / 50
        StroomFloat     = StroomFloat / 0.005
        GemI[0]         = StroomFloat * 1.07
        Stroom          = 0
        For X = 0 To (N_Samp_I - 1)    
            Stroom      = Stroom + GemI[X]
        Next 
        Stroom          = Stroom / N_Samp_I
    
        'EN: Calculate value's for on the display
          'NL: Meetwaardes naar display berekenen
          For X = 0 To 2
            Temp = Dig Temperatuur, X
            DispArT[X] = LRead Cijfers + Temp   
            Temp = Dig Spanning, X
            DispArU[X] = LRead Cijfers + Temp  
            'EN: The ZXCT1086E5TA does Not work below 3V, so display bars when this happens
              'NL: De ZXCT1086E5TA werkt niet onder de 3V, dus als dit gebeurt streepjes weergeven
              If Spanning > 30 Then             
                Temp = Dig Stroom, X
                DispArI[X] = LRead Cijfers + Temp
            Else
                DispArI[X] = Streep
            EndIf
        Next 
        
        'EN: Delay for slower display update
          'NL: Wachten om het display niet te snel te updaten
          DelayMS 75
    Wend
'****************************************************************   
  Cijfers:-  
LData Nul, Een, Twee, Drie, Vier, Vijf, Zes, Zeven, Acht, Negen, Uit, Streep     
End

The dummyload working:

http://elektronicastynus.be/image/77/1367670980.jpg

http://elektronicastynus.be/image/77/1367670974.jpg

Files

Code file: Download

Hex file: Download