Maker Pro
Maker Pro

24 hour time delay circuit

podface

Apr 14, 2011
3
Joined
Apr 14, 2011
Messages
3
i need some advice for making a time delay circuit which is a door catch
im trying to make a circuit that powers a solenoid for a set time and turns off after...say 24 hours. Also the time intervals need to be easily changed.
im thinking about using a 4060b ic or a pic.

i was thinking something like this
http://www.edutek.ltd.uk/Circuit_Pages/24hrTimer.html
but would it be better with 1 4060b instead of 2

any help would be appreciated
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
That circuit looks fine as long as you're not too concerned about 5% or even 10% variance between the calculated and actual intervals.

A pic could give you a timer as accurate as it's clock, and potentially programmable for any duration that you desire.
 

podface

Apr 14, 2011
3
Joined
Apr 14, 2011
Messages
3
im kind of a complete noob with pics so which pic would you recommend that is quite accurate and is easy to program
 

cizel

Apr 16, 2011
2
Joined
Apr 16, 2011
Messages
2
I just have used the 16F883, so i can't tell you the easiest pic to use, this is not that easy because it has 24 pins and there are pics with less pins. Downloading the datasheet http://sklep.avt.pl/photo/_pdf/PIC16F887I_P.pdf?sess_id=053e849f01e8561820c32ce1ab0cdace you can see the different commands to program the pic.
This is an example program that given a certain number it returns you the square number of the given one

LIST P=16F883

;#INCLUDE <P16F883.INC>

TRISA EQU 0x85

TRISB EQU 0x86

ANSEL EQU 0x188

ANSELH EQU 0x189

PORTA EQU 0x05

PORTB EQU 0x06

STATUS EQU 0x03

E EQU 0x21

H EQU 0x22

A EQU 0X23



ORG 000H



BANKSEL TRISA

MOVLW 0x80

MOVWF TRISA

CLRF TRISB

BANKSEL ANSEL

CLRF ANSEL

CLRF ANSELH



INI:

BANKSEL PORTA

CLRF PORTA

CLRF PORTB

CLRF E

GOTO SUBINI



SUBINI:

CLRF H

CLRF A

BTFSS PORTA,7

GOTO $-1

BTFSC PORTA,7

GOTO $-1

INCF PORTA

MOVF PORTA,0

MOVWF E

GOTO POT



POT:

INCF H

INCF A

MOVF PORTA,0

SUBWF H

MOVF A,0

MOVWF H

BTFSS STATUS,0

GOTO SUM

GOTO SAL



SUM:

MOVF PORTA,0

ADDWF E,1

GOTO POT



SAL:

MOVF E,0 ;0X01 E

MOVWF PORTB ;0X01 PB

MOVLW 0x0F

SUBWF PORTA,0 ;C=0

BTFSS STATUS,0

GOTO SUBINI



END
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Also take a look at the PicAXE.

The chips individually cost more, but easier and cheaper to program. If you want to move up to a real PIC programmed in assembly language or C or PicBASIC later on, you will have some experience that will be valuable.
 
Top