basic stamp programing question
firealarmfreak
Posts: 105
Hey I have a VERY weird problem lol.
Ok i am making a fire alarm control panel using basic stamp 2. For some reason when I activate the alarm, the system resets automaticly and then goes normal, then activates nromally. It does not always do this. Im not sure why it is doing this, but its annoyig and making it not work right. Any help would be greatly apreciated. Thanks. Chris.
Heres my code:
' {$STAMP BS2}
' {$PBASIC 2.5}
'Chris's Homemade 2 Zone Fire Alarm Control Panel
'Panel Features:
'2 Zones
'Power On Delay
'Codes: March Time
'PIN List:
'P0: Alarm Led for Zone 1
'P1: Alarm Led for Zone 2
'P2: Zone 1 Pulls
'P3: Zone 2 Pulls
'P4: Reset Switch
'P5: Silence Switch
'P7: Bell
'P8: Strobes
'P9: Silence Led
'P10: Walk Test Switch
'P12: Walk Test Led
'P13: Piezo (Panels Sounder)
'Code begins below:
'----System Normal----'
Normal:
HIGH 0
HIGH 1
HIGH 9
HIGH 12
HIGH 13
PAUSE 3000
LOW 0
LOW 1
LOW 7
LOW 8
LOW 9
LOW 12
LOW 13
'----Zone 1----'
Zones:
DO
LOW 12
IF (IN2 = 1) THEN
PAUSE 3000
HIGH 0
HIGH 13
GOTO Alarm
ENDIF
'----Zone 2----'
IF (IN3 = 1) THEN
PAUSE 3000
HIGH 1
HIGH 13
GOTO Alarm
ENDIF
loop
'----Alarm----'
Alarm:
DO
HIGH 7
HIGH 8
IF (IN5 = 1) THEN GOTO Silence
PAUSE 250
LOW 7
PAUSE 250
LOOP
'----Audible Silence----'
Silence:
DO
HIGH 9
LOW 7
'----System Reset----'
Reset:
IF (IN4 = 1) THEN GOTO Normal
LOOP
Ok i am making a fire alarm control panel using basic stamp 2. For some reason when I activate the alarm, the system resets automaticly and then goes normal, then activates nromally. It does not always do this. Im not sure why it is doing this, but its annoyig and making it not work right. Any help would be greatly apreciated. Thanks. Chris.
Heres my code:
' {$STAMP BS2}
' {$PBASIC 2.5}
'Chris's Homemade 2 Zone Fire Alarm Control Panel
'Panel Features:
'2 Zones
'Power On Delay
'Codes: March Time
'PIN List:
'P0: Alarm Led for Zone 1
'P1: Alarm Led for Zone 2
'P2: Zone 1 Pulls
'P3: Zone 2 Pulls
'P4: Reset Switch
'P5: Silence Switch
'P7: Bell
'P8: Strobes
'P9: Silence Led
'P10: Walk Test Switch
'P12: Walk Test Led
'P13: Piezo (Panels Sounder)
'Code begins below:
'----System Normal----'
Normal:
HIGH 0
HIGH 1
HIGH 9
HIGH 12
HIGH 13
PAUSE 3000
LOW 0
LOW 1
LOW 7
LOW 8
LOW 9
LOW 12
LOW 13
'----Zone 1----'
Zones:
DO
LOW 12
IF (IN2 = 1) THEN
PAUSE 3000
HIGH 0
HIGH 13
GOTO Alarm
ENDIF
'----Zone 2----'
IF (IN3 = 1) THEN
PAUSE 3000
HIGH 1
HIGH 13
GOTO Alarm
ENDIF
loop
'----Alarm----'
Alarm:
DO
HIGH 7
HIGH 8
IF (IN5 = 1) THEN GOTO Silence
PAUSE 250
LOW 7
PAUSE 250
LOOP
'----Audible Silence----'
Silence:
DO
HIGH 9
LOW 7
'----System Reset----'
Reset:
IF (IN4 = 1) THEN GOTO Normal
LOOP
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
determine if that problem was occurring.
agfa
DEBUG "PROGRAM RUNNING...", CR
If you see that message more than once on your DEBUG screen the program is starting over.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Yes, for sure
Again, a schematic would help in giving you advice.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Any help greatly appreciated.
http://image69.webshots.com/169/4/80/3/2377480030102854175vnWjdk_fs.jpg
1) The polarity of the whole thing is backwards. Please refer to the Industrial Control tutorial (www.parallax.com/Portals/0/Downloads/docs/books/edu/ic.pdf) on page 86 for a schematic.
2) Notice in one schematic that there's a diode connected across the relay. You need this. A 1N4001 rectifier diode from RadioShack will work fine.
3) As shown in the schematics, with a junction transistor like the 2N3904, you need a base resistor (1K will work as shown).
Any of the above could account for your problems.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Chris.
I don't know how you have the bell connected and I don't know how you have the 18V bell supply connected. Both pieces of information are important. It's a good sign that you can make the buzzer work in place of the bell, but it tells me very little about why the bell doesn't work.
I can't stress strongly enough that you need to learn about basic electronics including basic formulas like Ohm's Law and the Power formula. You need to learn about series and parallel circuits and a little about how resistors, capacitors, diodes, and transistors work. Here's one quick introduction: (www.seattlerobotics.org/guide/electronics.html). There are many available on the web.
http://image50.webshots.com/650/7/38/1/2589738010102854175doNfcH_fs.jpg
I still can't tell what's going on from the information you've given although we've eliminated a number of possibilities.
How are you powering the Stamp? Since this works with a buzzer, it doesn't sound like it involves the Stamp or relays.
There could still be noise coupled into the Stamp wiring if the bell wiring runs for some distance with some sort of Stamp
related wiring.
Does this sound accuate and mabe if i get a 24 volt DC power supply it may fix my problem?
Chris.
Chris.
Its not causing the relays to work harder but under powering could be causing the bell to have to put out more power to work, so thats why its not switching. Is this correct?