Robert Korn
Published © MIT

Intervalometer AKA Automated Fog Machine

Got a button to push? Get one of these.

IntermediateFull instructions provided4 hours438
Intervalometer AKA Automated Fog Machine

Things used in this project

Hardware components

Microchip 16f73
×1
lcd 16X1
×1
pushbuttons
×4

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematic

Code

intervalometer.pbp

Plain text
'****************************************************************
'*  Name    : fog machine timer.BAS                             *
'*  Author  : Robert Joseph Korn                                *
'*  Notice  : Copyright (c) 2014 Open Valley Consulting Corp.   *
'*  Date    : 10/25/2014                                        *
'*  Version : 1.6                                               *
'*  Notes   :                                                   *
'****************************************************************

DEFINE      OSC 10
Define      LCD_DREG        PORTC
DEFine      LCD_DBIT        4
define      LCD_RSREG       PORTC
define      LCD_RSBIT       2
define      LCD_EREG        PORTC
define      LCD_EBIT        3
define      LCD_BITS        4
define      LCD_LINES       1
define      LCD_COMMANDUS   2500
DEFINE      LCD_DATAUS      45

            ADCON1          = 6
            OPTION_REG.7    = 0

HTR         var     PORTA.0
TRG         var     PORTC.0
UP          var     PORTB.1
DOWN        var     PORTB.0
LEFT        var     PORTB.2
RIGHT       var     PORTB.3
PWR         var     PORTB.4
LED         var     PORTB.5
FLT         var     PORTB.6
INT         var     Word 
DUR         var     Word 
x           var     Word 
y           var     Word 
            low     LED
            low     TRG

            INT = 150 'default interval 
            DUR = 750 'default duration 
            
            pause       1200
            lcdout      $FE,1,   "FogMachine Timer" 
            pause       1250
            lcdout      $FE,$1, " @2014  OVCCorp "  
            pause       1250

main:
            if          FLT = 1 then  empty
            if          PWR = 1 then  power
            if          HTR = 0 then  heating
            gosub       normal          
            high        TRG
            pause       dur
            low         trg
            
            for         x = 0 to int
            
            for         y = 0 to 100
            
            pause       10
            if          FLT = 1 then  empty
            if          PWR = 1 then  power
            if          HTR = 0 then  heating
            if          up    = 0 then gosub u
            if          dOWn  = 0 then gosub d
            if          LEFT  = 0 then gosub l
            if          RIGHT = 0 then gosub r
            next        y
            
            toggle      led
            
            next        x
            
            goto        main 

            end
    
normal:
            lcdout      $FE,1,    "Int:"  
            lcdout                DEC INT
            lcdout                " "
            lcdout                "Dur:"  
            lcdout                DEC DUR 
            lcdout                "     "
            return

heating:
            lcdout      $FE,1,   "Chamber  Heating"
            pause       1000
            low         LED
            low         TRG
            goto        main
empty:
            lcdout      $FE,1,   "Juice Tank Empty"
            pause       1000
            low         LED
            low         TRG
            goto        main
power:
            lcdout      $FE,1,   "  Standby Mode  "
            low         LED
            low         TRG
            pause       1000
            goto        main
 
u:
            if int < 600 then
                int = int +1
            endif
            goto    cnt

d:
            if int > 30 then
                int = int -1
            endif
            goto    cnt

l:
            if dur > 50 then
                dur = dur -1
            endif
            goto    cnt

r:
            if dur < 1500 then
                dur = dur +1
            endif

cnt:
            x       = 0
            gosub   NORMAL
            pause   100
            return

Fog-machine-timer.hex

Plain text
:020000040000FA
:10000000B201E0280408A700871107110711831621
:100010008711071107110F30870583122708B218BF
:100020002E283A30A100FC308D203330A60042202B
:100030001030A10068308D20422064308C202230A6
:10004000A600422020302D200C302D2001302D2004
:1000500006302D20B21427082E283214A600321C98
:100060003C280711033C031C412841200930A10012
:10007000C4308D20031408003214FE3C0319DB2821
:100080000715321C321087150F3087052608F03906
:1000900087048711A60E321842282D308C200314B5
:1000A0000800B31329080319B3170530A800273037
:1000B000A300103067200330A300E8306720A301BD
:1000C00064306720A3010A30672024086E28A2004C
:1000D0002508A1002408A000BA202008A000A80339
:1000E0000319B313290803197828280203180800F4
:1000F0002008031DB313B31B0800303ED628A3010C
:10010000A200FF30A207031CA307031CDB28033057
:10011000A100E4308D208128A101F63EA000A109B4
:10012000031C9828FE300000A00703189328A0079E
:100130006400A10F9228000020189E282018A028F3
:100140000800A2000330AA28A2000130AA28A200B9
:100150000630AA28A80023082102031DB12822087E
:100160002002043003180130031902302805031D52
:10017000FF30DB28A501A4011030A600210DA40D3D
:10018000A50D2208A4022308031C230FA5020318AF
:10019000D0282208A40723080318230FA50703105B
:1001A000A00DA10DA60BBE282008DB288400310875
:1001B0008A0030088200831303138312640008004E
:1001C000831606309F0081138312861283168612CF
:1001D000831207108316071083129630BA00BB01F2
:1001E000EE30B8000230B9000430A300B0308A010C
:1001F0008020FE308A01032001308A01032046302E
:100200008A0103206F308A01032067308A010320AE
:100210004D308A01032061308A01032063308A0156
:10022000032068308A01032069308A0103206E3080
:100230008A01032065308A01032020308A010320CF
:1002400054308A01032069308A0103206D308A010D
:10025000032065308A01032072308A0103200430B4
:10026000A300E2308A018020FE308A0103200130A1
:100270008A01032020308A01032040308A010320B4
:1002800032308A01032030308A01032031308A0164
:10029000032034308A01032020308A0103202030DB
:1002A0008A0103204F308A01032056308A0103203F
:1002B00043308A01032043308A0103206F308A01D2
:1002C000032072308A01032070308A01032020301D
:1002D0008A0103200430A300E2308A0180206400F8
:1002E0008A11061B6C2A64008A11061AB12A64005E
:1002F0008A11051C272A8A11E22107148316071088
:1003000083123908A30038088A0180200710831659
:1003100007108312BC01BD013C08A0003D08A100EC
:100320003B08A3003A088A01A4208A11031DDD2995
:10033000BE01BF013E08A0003F08A100A301643038
:100340008A01A4208A11031DD2290A308A017F2044
:1003500064008A11061B6C2A64008A11061AB12AED
:1003600064008A11051C272A64008A118618BA299C
:100370008A11F62264008A110618C0298A110723FF
:1003800064008A110619C6298A111A2364008A1189
:100390008619CC298A112D23BE0A0319BF0A8A1196
:1003A000031D9A2920308606831686128312BC0A02
:1003B0000319BD0A8A11031D8C298A016F29630064
:1003C0008A01DF29FE308A01032001308A010320DF
:1003D00049308A0103206E308A01032074308A017B
:1003E00003203A308A010320A9013A08A4003B08FF
:1003F000A5000230B000B1018A01512020308A01ED
:10040000032044308A01032075308A0103207230B2
:100410008A0103203A308A010320A9013808A40088
:100420003908A5000230B000B1018A015120203006
:100430008A01032020308A01032020308A01032012
:1004400020308A01032020308A0103200800FE307A
:100450008A01032001308A01032043308A010320EE
:1004600068308A01032061308A0103206D308A01DF
:10047000032062308A01032065308A010320723034
:100480008A01032020308A01032020308A010320C2
:1004900048308A01032065308A01032061308A01D7
:1004A000032074308A01032069308A0103206E30F2
:1004B0008A01032067308A0103200330A300E8305B
:1004C0008A018020861283168612831207108316F3
:1004D000071083128A016F29FE308A010320013040
:1004E0008A0103204A308A01032075308A010320E3
:1004F00069308A01032063308A01032065308A0154
:10050000032020308A01032054308A010320613007
:100510008A0103206E308A0103206B308A01032098
:1005200020308A01032045308A0103206D308A0182
:10053000032070308A01032074308A01032079304F
:100540008A0103200330A300E8308A01802086124C
:1005500083168612831207108316071083128A01EE
:100560006F29FE308A01032001308A0103202030E8
:100570008A01032020308A01032053308A0103209E
:1005800074308A01032061308A0103206E308A01B1
:10059000032064308A01032062308A01032079300D
:1005A0008A01032020308A0103204D308A01032074
:1005B0006F308A01032064308A01032065308A018C
:1005C000032020308A01032020308A010320861274
:1005D00083168612831207108316071083120330C6
:1005E000A300E8308A0180208A016F293A08A00020
:1005F0003B08A1000230A30058308A01A1208A11D3
:10060000031D052BBA0A0319BB0A8A113C2B3A08B1
:10061000A0003B08A100A3011E308A01A7208A1177
:10062000031D182B0130BA020030031C013EBB022F
:100630008A113C2B3808A0003908A100A3013230F0
:100640008A01A7208A11031D2B2B0130B80200302C
:10065000031C013EB9028A113C2B3808A00039085E
:10066000A1000530A300DC308A01A1208A11031DFE
:100670003C2BB80A0319B90ABC01BD018A01E22169
:0806800064308A017F200800AC
:02400E00F63F7B
:00000001FF

Credits

Robert Korn

Robert Korn

15 projects • 20 followers
I Made the Internet of Things before people had a name for it.

Comments