Stijn Coenen

Zie Over Mij

Berichten met de meeste reacties

  1. UV-belichtingsbak V3 Update — 7 reacties
  2. Plexiglas buiger — 5 reacties
  3. Rapid CSN140 Elektrische Nietmachine Accu Reparatie (B311) — 4 reacties
  4. “100W Temperature Controlled Soldering Pot” Review — 4 reacties
  5. Afvoer pomp sturing — 3 reacties

Berichten van deze auteur

Scheidingstransformator V2 Update

Nadat ik het dummyload project had afgemaakt, dacht ik eraan dat dit project dezelfde displays gebruikt. De code kon ik dus vrijwel compleet overnemen. Daarom heb ik dit project nu dan ook afgemaakt. De pic in dit project is uiteindelijk een 16F1825 geworden welke op 32Mhz draait.

http://image.elektronicastynus.be/58/1367676911.jpg

 

http://image.elektronicastynus.be/58/1367676912.jpg

 

De code:

'****************************************************************
'*  Name    : Scheidingstransformator V2                        *
'*  Author  : Stijn Coenen ElektronicaStynus.be                 *
'*  Notice  : Copyright (c) 2013 Stijn Coenen (Stynus)          *
'*          : All Rights Reserved                               *
'*  Date    : 01/05/2013                                        *
'*  Version : 1.3                                               *
'*  Notes   : This code is provided to you as is, without       *
'*          : warranty of any kind.Use at own risk!!            *
'****************************************************************
Device = 16F1825
Config1 FOSC_INTOSC, WDTE_OFF, PWRTE_ON, MCLRE_OFF, CP_OFF, CPD_OFF, BOREN_OFF, CLKOUTEN_OFF, IESO_ON, FCMEN_ON
Config2 WRT_OFF, PLLEN_ON, STVREN_OFF, BORV_19, LVP_OFF
Xtal = 8
'****************************************************************    
'EN: Declarations
'NL: Declaraties
    'Displays
        Symbol  Disp_klok       = LATC.5
        Symbol  Spanning_Data   = LATC.4
        Symbol  Spanning_Latch  = LATC.3
        Symbol  Stroom_Data     = LATC.2
        Symbol  Stroom_Latch    = LATC.1
        
    'EN: Measurement values
    'NL: Meetwaardes
        Dim     Spanning        As Word
        Dim     Stroom          As Word      
                  
        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     DispSpanning    As Byte
        Dim     DispStroom      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             = %11111111
        TRISC             = %00000000
         
        All_Digital       = true        
    
        On_Hardware_Interrupt GoTo Interrupts
'****************************************************************    
Opstarten:     
    'EN: Set clock to 64 Mhz
    'NL: klok instellen op 64 Mhz
    OSCCON  = %11110010

    Clear 'ram

    'EN: Timer0 setup to drive the displays
    'NL: Timer0 instellen om de displays aan te sturen
    OPTION_REG  = %00000111
    
    INTCON      = %10100000
    
    'EN: Settings AD converter
    'NL: Instellingen AD converter     
    ADCON1  = %10110000
    
GoTo Main         
'****************************************************************   
Interrupts:
    Context Save
    If TMR0IF = 1 Then
        TMR0IF = 0      'Reset flag
        TMR0   = 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
        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 
            Case 2          
                IntDisp = disp3         
                DispStroom.6    = 0 
            Case Else
                IntDisp = 255
                IntCase = 0                
        EndSelect
                           
        'EN: Outputting transistors data 
        'NL: Transistor data inklokken
        For IntX  = 0 To 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
            Spanning_Data   = DispSpanning.7
            Stroom_Data     = DispStroom.7
            Disp_klok       = 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
        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
        
        Spanning_Latch  = 0
        Stroom_Latch    = 0 
    EndIf
               
    Context Restore
Return
'****************************************************************     
Main:
    While 1 = 1        
        '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
        Spanning        = Spanning /10 
        Spanning        = Spanning - 4.95 
        GemU[0]         = Spanning * 3.25'3.03
        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 1   
        Stroom          = Stroom - 55 'Offset
        
        GemI[0]         = Stroom /4.28
        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 Spanning, X
            DispArU[X] = LRead Cijfers + Temp       
            Temp = Dig Stroom, X 
            DispArI[X] = LRead Cijfers + Temp
        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

Bestanden:

Code file: Download

Hex file: Download

PCB bestanden meter print: Download

Radio flea market Lummen 2013

Monday there was a Radio flea market in Lummen.

What I bought (for 9€ including entrance fee):
-1x partial reel 1R resistors
-1x bag timing belts + pulleys
-1x aluminium sheet
-1x 8*2 LCD

1365180945

Scheidingstransformator V3 Update

De elektronica van de meetprint in dit project is hetzelfde als dat bij de scheidingstransformator V2, hierdoor kon ik dit project vandaag ook afronden.

Het afgewerkte resultaat:

http://image.elektronicastynus.be/59/1367683024.jpg

http://image.elektronicastynus.be/59/1367683020.jpg

DC Dummyload Update

Na lange tijd ben ik toch nog maar eens aan dit project begonnen. Al snel bleken er toch nog een aantal problemen in dit project te zitten.

Het eerste probleem dat ik tegenkwam is dat de transistoren stonden te oscilleren en als de voedingsspanning te laag was veel basisstroom gingen trekken. De oscillaties bleken door de shutdown schakeling op de main print te komen. Na deze verwijderd te hebben waren de oscillaties weg, maar was het probleem van grote transistorstromen nog groter geworden. Om dit op te lossen heb ik bij elke uitgangstrap 2 weerstanden toegevoegd.

schema

In dit schema is R4 toegevoegd. Verder moet er ook een 150 Ohm 2W weerstand tussen dit printje en de basis van de 2N3055 geplaatst worden.

Hierna bleek dat de voeding ook nog onstabiel was geworden bij hogere basis stromen. Daarom heb ik deze vervangen door een oude 16V laptop lader met een 5V spanningsregelaar printje erachter.

 

Voor de fans heb ik nog een 2de printje bijgezet met een 7812 (dit is bij op de grote koelblok gemonteerd).

 

Hierna bleek er nog een probleem met de stroom meting te zijn. Hierbij bleek dat de basisstroom door de transistoren ook mee gemeten werd. Om dit op te lossen heb ik een nieuw printje gemaakt (op basis van de ZXCT1086E5TA) dat de stroom in de + geleider meet. Deze meting heeft wel als nadeel dat deze niet werkt als de spanning van de ingang kleiner dan 3V wordt de stroom meting niet meer klopt. Dit heb ik in de software “opgelost” door dan — op het stroomdisplay te zetten.

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

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

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

Om deze print aan te sluiten heb ik de main print wat veranderd:

https://elektronicastynus.be/image/77/1367670283.jpg

 

Nieuw schema:

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

 

Om de metingen wat stabieler te maken neem ik het gemiddelde van een aantal samples. Hiervoor bleek de pic die ik eerst ingetekend had wat te traag te zijn. Daarom heb ik deze nu vervangen door de PIC18F25K22 (pin compatibel). Deze pic draait op 64Mhz.

 

De 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

 

De dummyload in werking:

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

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

Bestanden:

Code file: Download

Hex file: Download

Radio flea market Eksel 2013

Today there was a Radio flea market in Eksel.

What I bought (for 37€ including entrance fee):

-4x bag wire
-1x bag timing belts + pulleys
-1x 8*2 LCD
-1x partial reel 3V3 zener diode’s
-1x reel resistors
-5x wheel
-1x 24V 300W power supply
-1x 48V 500W power supply

1367766689

Radio flea market Bladel 2013

Today there was a Radio flea market in Bladel. What I bought (for 28€ including entrance fee):

2x voltage regulator pcb
4x power cable
1x parallel port cable
1x wire strippers
1x bag rubber enclosure feet
1x bag timing belts + pulleys
2x lcd
2x bag brown wire

1387715013

Radio flea market Lummen 2014

Today there was a Radio flea market in Lummen. What I bought (for 45,30€ including entrance fee):

16x bag print connectors
2x bag wire1x bag knobs
1x bag relays
1x 230V relay
1x relay socket
2x female connector strip
1x Motor
1x hard disk 80GB IDE

1398081715

Radio flea market Eksel 2014

Today there was a Radio flea market in Eksel.

What I bought (for 33,50€ including entrance fee):
5x    Bag fuse holders
2x    Bag spacers
3x    bag print connectors
1x    Big bearing
1x    Bag washers
1x    Compressor / air pump
1x    50 cd’s

1400408576

Weerstand Decade Box

Ik was al een tijdje van plan om een weerstanden decade box te maken. Nu vond ik de draaischakelaars nogal duur, en wat ouderwets. Daarom heb ik beslist het instellen met een rotary encoder te gaan doen.

Nu moest er nog een manier gevonden worden om de weerstand te maken. Weerstanden schakelen met transistoren of mosfets geeft een te hoge schakelweerstand en kan geen wisselspanning aan. Daarom is de keuze gevallen op relais. Aangezien er maar kleine stromen geschakeld moeten worden voldoen kleine relais. De relais print wordt 2 keer gebruikt met andere waardes weerstanden.

Relais print:


http://image.elektronicastynus.be/83/1307108369.jpg

Onderdelenlijst:
Print laag ohmig

3 1K R22, R23, R24
1 1K8 R26
3 1R R1, R2, R3
1 1R8 R5
1 2K2 R25
1 2R2 R4
1 3K3 R28
1 3R3 R7
1 4K7 R27
1 4R7 R6
3 10R R8, R9, R10
1 18R R12
1 22R R11
1 33R R14
1 47R R13
3 100R R15, R16, R17
1 180R R19
1 220R R18
1 330R R21
1 470R R20
2 100nF C1, C2
2 74HCT595 IC1, IC3
2 ULN2803 IC2, IC4
16 TQ2-24V K1, K2, K3, K4, K5, K6, K7, K8, K9,
K10, K11, K12, K13, K14, K15, K16

Print Hoogohmig

3 10K R1, R2, R3
1 18K R5
1 22K R4
1 33K R7
1 47K R6
3 100K R8, R9, R10
1 180K R12
1 220K R11
1 330K R14
1 470K R13
3 1M R15, R16, R17
1 1M8 R19
1 2M2 R18
1 3M3 R21
1 4M7 R20
2 100nF C1, C2
2 74HCT595 IC1, IC3
2 ULN2803 IC2, IC4
12 TQ2-24V K1, K2, K3, K4, K5, K6, K7, K8, K9,
K10, K11, K12

 

Aanstuur print:

Onderdelenlijst:

2 1µF C3, C4
1 10K R2
1 10K R1
1 16F648A (Geprogrammeerd) IC1
2 100nF C1, C2
1 Drukknop S1
1 Rotary encoder S1
1 REG1117-5V IC2

 

Met frontpaneel:

Voeding

Dit deel is op experimenteerprint opgebouwd, hierdoor zijn er geen printlay-outs beschikbaar. de print bestaat uit een 18V transformator, gelijkrichter en een elco.

Printen ingebouwd in de behuizing:

Klaar:

Code in de microcontroller:

Device = 16F648A
Config FOSC_INTOSCIO, WDTE_OFF, PWRTE_ON, MCLRE_OFF, BOREN_OFF, LVP_OFF, CPD_OFF, CP_OFF

All_Digital           = true
Xtal                  = 4

Declare PortB_Pullups   On

Declare LCD_DTPin       PORTB.4  
Declare LCD_ENPin       PORTB.2
Declare LCD_RSPin       PORTB.3
Declare LCD_Interface   4
Declare LCD_Lines       2

Symbol  RotEncoderA   = PORTB.1  
Symbol  RotEncoderB   = PORTB.0 
Symbol  RotSwitch     = PORTA.2

Symbol  PushSwitch    = PORTA.4
Dim     PushSwitchBit As Bit

TRISB                 = %00000011
TRISA                 = %01111100

OPTION_REG            = %01000000 
INTCON                = %10010000
Symbol  INTF          = INTCON.1     

Symbol  klok          = PORTA.0
Symbol  Data_Pin      = PORTA.7
Symbol  ZetVast       = PORTA.1

Dim  DispWaarde[7]    As Byte
Dim  SetWaarde[7]     As Byte
Dim  DispTeller       As Byte
Dim  CursorTeller     As Byte
Dim  UitHex           As Byte 
Dim  UitDig           As Byte
Dim  UitCount         As Byte
Dim  ArrayTeller      As Byte
Dim  Warning          As Bit
'dim teller as byte
       
On_Hardware_Interrupt GoTo IrInterrupt  
    
GoTo Init     
'****************************************************************
IrInterrupt:
    Context Save       
       If INTF = 1 Then
          'Flaggen resetten
          INTF = 0
          If RotEncoderA = 1 Then
             'Aftellen
             If DispWaarde[6 - DispTeller] > 0 Then
                Dec DispWaarde[6 - DispTeller]
             EndIf
          Else
             'Optellen  
             If DispWaarde[6 - DispTeller] < 9 Then
                Inc DispWaarde[6 - DispTeller]
             EndIf                       
          EndIf   
       EndIf 
    Context Restore         
'****************************************************************
Init:
    Cls
      
    UitDig = DispWaarde[3] 
    UitHex = UitDig << 4
    UitDig = DispWaarde[2]
    UitHex = UitHex + UitDig   
    UitHex = ~UitHex    
    SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]
    
    UitDig = DispWaarde[1]  
    UitHex = UitDig << 4
    UitDig = DispWaarde[0]
    UitHex = UitHex + UitDig   
    UitHex = ~UitHex   
    SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]   
    
    UitHex = 0
    UitDig = DispWaarde[6]
    UitHex = UitHex + UitDig         
    UitHex = ~UitHex  
    SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]   
    
    UitDig = DispWaarde[5] 
    UitHex = UitDig << 4
    UitDig = DispWaarde[4]
    UitHex = UitHex + UitDig    
    UitHex = ~UitHex   
    SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]   
    
    High ZetVast
    DelayUS 20
    Low ZetVast
                   '12345678
    Print At 1, 1, "E-Stynus"
    Print At 2, 1, "  2014  "
    DelayMS 750
    Cls  

    Print At 1,1, "Set:"   
    DispTeller = 0
    
    'Ohm teken in lcd steken
    Print $FE,$40,$00,$0E,$11,$11,$11,$0A,$1B,$00
'****************************************************************
Main:
While 1 = 1      
   'Relais aansturen bij rotary encoder button druk
   If RotSwitch = 0 Then
      For ArrayTeller = 0 To 6  
          SetWaarde[ArrayTeller]     = DispWaarde[ArrayTeller] 
          If SetWaarde[ArrayTeller]  > 9 Then
             SetWaarde[ArrayTeller]  = 0     
             DispWaarde[ArrayTeller] = 0
          EndIf    
      Next
      
      UitDig = DispWaarde[3] 
      UitHex = UitDig << 4
      UitDig = DispWaarde[2]
      UitHex = UitHex + UitDig   
      UitHex = ~UitHex    
      SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]
      
      UitDig = DispWaarde[1]  
      UitHex = UitDig << 4
      UitDig = DispWaarde[0]
      UitHex = UitHex + UitDig   
      UitHex = ~UitHex   
      SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]   
      
      UitHex = 0
      UitDig = DispWaarde[6]
      UitHex = UitHex + UitDig         
      UitHex = ~UitHex  
      SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]   
      
      UitDig = DispWaarde[5] 
      UitHex = UitDig << 4
      UitDig = DispWaarde[4]
      UitHex = UitHex + UitDig    
      UitHex = ~UitHex   
      SHOut Data_Pin, klok, MsbFirst, [UitHex \ 8]   
  
      High ZetVast
      DelayUS 20
      Low ZetVast
      
      DelayMS 100  
      While RotSwitch = 0   
            DelayMS 100  
      Wend
        
   EndIf 
    
   'Warning teken                               
   Warning = 0
   For ArrayTeller = 0 To 6  
       If DispWaarde[ArrayTeller] <> SetWaarde[ArrayTeller] Then
          Warning = 1
       EndIf   
   Next
   If Warning = 1 Then
      Print At 1, 8, "!"
   Else      
      Print At 1, 8, " "
   EndIf
    
   'Decade positie
   If PushSwitch = 0 And PushSwitchBit = 0 Then
      PushSwitchBit = 1
      DelayMS 100
      If DispTeller < 6 Then
         Inc DispTeller
      Else
         DispTeller = 0
      EndIf
   EndIf
   If PushSwitch = 1 Then
      PushSwitchBit = 0
   EndIf
   For ArrayTeller = 0 To 6  
       If DispWaarde[ArrayTeller] > 9 Then
          DispWaarde[ArrayTeller] = 0
       EndIf    
       Print At 2, 7 - ArrayTeller, Dec1 DispWaarde[ArrayTeller]
   Next
   Print At 2,8, 0
   '(Print At 1,4, Dec DispTeller          
   Print $FE, $0E           'Underline cursor on
   Print $FE, $C0           'Move cursor to beginning of second line 
   CursorTeller = 0
   While CursorTeller < DispTeller
       Print $FE, $14      'Move cursor right one position
       Inc CursorTeller
   Wend
   
   
   DelayMS 100                   
   
Wend
End

Bestanden:

PCBs bestellen:

Scheidingstransformator V3 Update

Na een aantal maanden gebruik bleken de solid state relais niet altijd betrouwbaar te schakelen. Zo kwam het een keer voor dat de power relais aan bleef, maar de weerstanden niet overbrugt werden.

Hierdoor werden deze veel te warm omdat deze niet op continu belasting berekend zijn.

 

De verbrande pcb:

 

Na deze verbrande print heb ik beslist een nieuwe versie te bouwen, deze keer met echte relais:

Schema:

 

PCB:

 

Foto:

De firmware in de microcontroller blijft hetzelfde.