karl grabe
Published © GPL3+

Arduino Smoke Alarm Interface

Monitor one or more Smoke alarms from an Arduino with this shield design

AdvancedFull instructions provided2,554
Arduino Smoke Alarm Interface

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Smoke Alarm with Escape Light e.g. Kiddie i9080EU.
×1
General Purpose Transistor PNP
General Purpose Transistor PNP
Use 800mA transistor e.g. BC327 or equivalent
×1
JST Pair of Female & Male connectors with wire cables
or PCB mounted JST-XH style socket and pigtail
×1
1N5819 – 1A Schottky Barrier Rectifier
1N5819 – 1A Schottky Barrier Rectifier
or BAT85
×1
Momentary Push Button small PCB mounted
×1
Resistors 220 ohm, 820 ohm, 10k, 15 ohm, 4k7, 220 ohm; 5k6
×1
Shield Custom PCB as per fritzing file included in this project
×1
Capacitor 100 nF
Capacitor 100 nF
×1
5 mm LED: Red
5 mm LED: Red
×1
Stacking Headers 1x10; 1x6; 2x8
×1

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Plier, Long Nose
Plier, Long Nose
Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter
any multimeter, ideally with continuity beep
Ear Muffs
to protect you from the smoke alarm sound when testing!

Story

Read more

Schematics

Alarm Arduino Shield IO Interface v7

A PCB Shield and circuit to interface a modified smoke alarm to an Arduino Uno

Alarm Arduino Shield Interface Circuit Diagram

Code

Smoke Alarm Input Output

Arduino
Monitor Modified Smoke Alarm and print on the serial monitor if it's triggered
Activate Smoke Alarm Remote Buzzer when the Shield Test button is pressed
Show status LED flashing when running or On when alarm sounding
/*
   Example Program to
        Monitor Modified Smoke Alarm
        Activate Smoke Alarm Remote Buzzer
        Show status LED when running or alarm sounding

    Hardware Schematic, PCB file and assembly Instructions for this code is here:
    http://Tek4um.com/smokeAlarm

    Release:
      10 May 2021 v1.0 Initial version



  © karl grabe Tek4um.com 2021 www.tek4um.com
  For personal use only.
*/

#define SMOKE_ALARM_INPUT_PIN 2    // connect to R3 (see circuit diagram)
#define BUZZER_OUTPUT_PIN 3   // connect to R4
#define SMOKE_ALARM_LED_STATUS 4   // on if Smoke Alarm input is active
#define SMOKE_ALARM_TEST_BUTTON 5  // for testing
#define HARDWARE_SERIAL_BAUD 115200
#define On true
#define Off false
#define TEST_TIME_DURATION 1000    // Time duration in ms to sound buzzer and status led for testing


void setup() {
  pinMode(SMOKE_ALARM_INPUT_PIN, INPUT);    // Connected to the modified Smoke Alarm
  pinMode(BUZZER_OUTPUT_PIN, OUTPUT);  // Connected to the Remote Buzzer, active LOW
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(SMOKE_ALARM_LED_STATUS, OUTPUT);         // active HIGH
  pinMode(SMOKE_ALARM_TEST_BUTTON, INPUT_PULLUP);  // active LOW

  Serial.begin(HARDWARE_SERIAL_BAUD);
  delay(500);
  Serial.println(F("Monitoring Smoke Alarm... "));

  // Test: Turn on the remote buzzer & Status LED briefly on startup
  setBuzzer (On);
  setStatusLED(On);

  delay(TEST_TIME_DURATION);
  
  setBuzzer (Off);
  setStatusLED(Off);;
  delay (100);                     // Allow C1 capacitor to discharge, otherwise a false alarm on startup
}

void loop() {
  boolean testButtonState = !digitalRead(SMOKE_ALARM_TEST_BUTTON);  // read the test button, active LOW so invert it
  if (testButtonState) {  // if test button presses sound buzzer and LED on the PCB
    setStatusLED(On);     // turn on LED
    setBuzzer (On);       // turn on transistor Q1 to sound buzzer via cable
    delay (TEST_TIME_DURATION);
    setStatusLED(Off);    
    setBuzzer (Off); 
  }

  // Check if the smoke alarm is triggered, print it's state to serial monitor
  boolean smokeAlarmState = digitalRead(SMOKE_ALARM_INPUT_PIN);  // true: alarm is on so it's triggered (e.g. Fire!!)
 
 if (smokeAlarmState) { 
  String AlarmStateText = smokeAlarmState ? "On" : "Off";    // get text of smoke alarm state, true: On, false: Off
  Serial.print(F("A Smoke Alarm is: "));
  if (testButtonState)
    Serial.print (F("(test button)"));                      // test button is pressed
  Serial.println(AlarmStateText);
  setStatusLED(smokeAlarmState); // status led is on when smoke alarm is on
  delay (500);
  return;
}

// *** to do: add background timer to flash LED
  delay(100);         // delay before repeating messages
  flashStatusLED ();  // show program is running
  delay (100);
}



void setBuzzer (boolean state){            // pass true to sound buzzer
  digitalWrite(BUZZER_OUTPUT_PIN, !state); // active low
}

void setStatusLED(boolean state) {        // pass true to turn on LED
  digitalWrite(SMOKE_ALARM_LED_STATUS, state);  
}

void flashStatusLED(){                    // flip the status led
    digitalWrite(SMOKE_ALARM_LED_STATUS, !digitalRead(SMOKE_ALARM_LED_STATUS));
}

Credits

karl grabe

karl grabe

0 projects • 1 follower
Computer Science Lecturer, Electronics & Software Engineer.

Comments