This code is available for anyone to use, just don't claim it as your own code.
/*
Rainbow_Dash_7x (KJ7BZC)
This code will be available on my site listed at https://sites.google.com/view/kj7bzc/open-alarm-panel
panel info:
THIS PANEL SHOULD NOT BE USED TO PROTECT LIFE OR PROPERTY AND I AM NOT RESPONSIBLE FOR ANY DAMAGES LOSS OR OTHER FAILURE OF LIFE PROPERTY OR EQUIPMENT
just thought I'd say that, anyways lets get on with it
zone 1 is a fire zone
zone 2 is a supervisory zone
model is a Protos*ar FyrLert 50
nac 1 is a strobe nac
nac 2 is a coded audible nac
you might have to hold the silence key for a bit for it to silence if it is coding the nac
also you will have to change the coding option upon power up as it will default to code 3 temporal
note 1:
please don't change the initialization text as I don't want people claiming this code as their own
*/
/*
developer notes:
opmodes:
0-normal
1-trouble
2-supervisory
3-alarm
4-
5-menu for selecting coding options
pins:
D2-lcd d7 pin
D3-lcd d6 pin
D4-lcd d5 pin
D5-lcd d4 pin
D6-lcd en pin
D7-lcd rs pin
D8-silence button
D9-reset button
D10-menu button
D11-nac 1
D12-nac 2
D13-smoke detector power reset relay
A0-beeper
A1-power led
A2-trouble led
A3-supervisory led
A4-alarm led
A5-silenced led
A6-n/a
A7-n/a
*/
//*****************************************************************************************************************************************************************************
#include <LiquidCrystal.h>
const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int silencebutton = 8;
int resetbutton = 9;
int menubutton = 10;
int nac1 = 11;
int nac2 = 12;
int smkrst = 13;
int beep = A0;
int pled = A1;
int tled = A2;
int vled = A3;
int aled = A4;
int sled = A5;
char panelname[] = "steel_beam"; //change this to what you want your panel name to be up to 16 characters
int smokedelay = 5000; //change this to the number of seconds x 1000 to wait for smoke detectors to initialize after a reset
int resetdelay = 5000; //change this to as many seconds x 1000 as you want the smoke detectors power to be cut for on reset
int alarm = 0;
int trouble = 0;
int troublezone1 = 0;
int troublezone2 = 0;
int supervisory = 0;
int acked = 0;
int silenced = 0;
int tval = ;
int aval = ;
void setup() {
Serial.begin(9600);
pinMode(silencebutton,INPUT_PULLUP);
pinMode(resetbutton,INPUT_PULLUP);
pinMode(menubutton,INPUT_PULLUP);
pinMode(nac1,OUTPUT);
pinMode(nac2,OUTPUT);
pinMode(smkrst,OUTPUT);
pinMode(beep,OUTPUT);
pinMode(pled,OUTPUT);
pinMode(tled,OUTPUT);
pinMode(vled,OUTPUT);
pinMode(aled,OUTPUT);
pinMode(sled,OUTPUT);
digitalWrite(smkrst,LOW);
lcd.begin(16, 2);
}
void loop() {
if (opmode == 0) { //normal
}
if (opmode == 1) { //trouble
}
if (opmode == 2) { //supervisory
}
if (opmode == 3) { //alarm
}
if (opmode == 4) { //extra
}
if (opmode == 5) { //menu
}
}
void reset() {
tone(beep,2000);
delay(50);
noTone(beep);
alarm = 0;
trouble = 0;
troublezone1 = 0;
troublezone2 = 0;
supervisory = 0;
acked = 0;
silenced = 0;
opmode = 0;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Reset In System");
lcd.setCursor(0,1);
lcd.print("Detector Reset");
digitalWrite(smkrst,LOW);
}
void initialize() {
lcd.setCursor(0,0);
lcd.print("Rainbow_Dash_7x"); //please don't change this text, see note 1
lcd.setCursor(0,1);
lcd.print("Protos*ar"); //please don't change this text, see note 1
tone(beep,1200);
delay(50);
noTone(beep);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" * Fyrlert 50 * "); //please don't change this text, see note 1
lcd.setCursor(0,1);
lcd.print("Open Alarm Panel"); //please don't change this text, see note 1
digitalWrite(pled,HIGH);
delay(500);
digitalWrite(pled,LOW);
delay(500);
digitalWrite(pled,HIGH);
delay(500);
digitalWrite(pled,LOW);
delay(500);
digitalWrite(pled,HIGH);
delay(500);
digitalWrite(pled,LOW);
delay(500);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("*Initializing*");
lcd.setCursor(0,1);
lcd.print("Detector Reset");
digitalWrite(smkrst,HIGH);
delay(1000);
lcd.setCursor(0,0);
lcd.print("Detector Delay");
delay(smokedelay);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("System Is Normal");
lcd.setCursor(0,1);
lcd.print("AC Power Failure");
}