Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Nexa smoke alarm hack

Nexa smoke alarm hack

Scheduled Pinned Locked Moved My Project
7 Posts 2 Posters 4.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • EfflonE Offline
    EfflonE Offline
    Efflon
    wrote on last edited by Efflon
    #1

    Note, I take no responsibilities for modifications you do to your smoke alarm. Use a back up for safety.

    I have a few Nexa KD-101Lx smoke detektors with a built in 433MHz radio that just eats batteries so I had the idea to modify them to talk with a simple MySensors node.
    The construction is actually a alarm and a radio on the same PCB. Looking at the PCB and a bit of testing I found the connection between the smoke alarm and the radio part.
    0_1485604533822_nexa-pcb-label.png
    When the alarm triggers the pin is pulled high and since there already is a 10k pull-up resistor in place all that is needed is to add a cable to my sensor. The "learn" button is re-used for triggering reset and providing ground.
    The original radio is powered by 3xAA so I just cut the cable and re-soldered the cables to use only 2xAA's.
    I will use the newbiePCB for hooking things up and everything's seems to fit inside the case just fine.
    0_1485604635767_nexa-ready.jpg

    Here is the code that will run for the next couple of days.

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * DESCRIPTION
     *
     * Simple fire alarm example modifying a Nexa KD-101L fire alarm
     * Connect digitial I/O pin 3 (FIRE_PIN below) with a 10K resistor to GND.
     * Also connect the FIRE_PIN between the IC and R16 (SMD103=10K).
     */
    
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    #include <MySensors.h>
    #include <Vcc.h>
    
    const float VccMin        = 2.0*0.6;  // Minimum expected Vcc level, in Volts. Example for 2xAA Alkaline.
    const float VccMax        = 2.0*1.5;  // Maximum expected Vcc level, in Volts. Example for 2xAA Alkaline.
    const float VccCorrection = 1.0/1.0;  // Measured Vcc by multimeter divided by reported Vcc
    
    Vcc vcc(VccCorrection);
    
    // Pin connected to the alarm
    #define FIRE_PIN 3
    
    // Id of the sensor child
    #define CHILD_ID 0
    
    // Sleep time in ms        min     s      ms
    unsigned long SLEEP_TIME = 120UL * 60UL * 1000UL;
    
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    void setup()  
    {  
      // Setup the alarm
      pinMode(FIRE_PIN, INPUT);  
    }
    
    void presentation()  {
      // Send the sketch version information
      sendSketchInfo("Fire Alarm", "1.0");
      // Register sensor
      present(CHILD_ID, S_SMOKE, "Alarm tripped", true);
      // Send the current state
      //send(msg.set("0"));
    }
    
    
    void loop()
    {
      bool tripped = digitalRead(FIRE_PIN) == HIGH;
      
      if(tripped) {
        Serial.println("Fire!");
        send(msg.set(1), true);
        wait(1000);
      } else {
        Serial.println("All ok");
        send(msg.set(0), true);
        // Measure battery level
        uint8_t batteryPcnt = static_cast<uint8_t>(0.5 + vcc.Read_Perc(VccMin, VccMax));
        // Send battery level, used as heartbeat of the sensor
        sendBatteryLevel(batteryPcnt);
      }
      // Sleep until fire
      sleep(digitalPinToInterrupt(FIRE_PIN), HIGH, SLEEP_TIME);
    }
    
    marceltrapmanM 1 Reply Last reply
    5
    • EfflonE Efflon

      Note, I take no responsibilities for modifications you do to your smoke alarm. Use a back up for safety.

      I have a few Nexa KD-101Lx smoke detektors with a built in 433MHz radio that just eats batteries so I had the idea to modify them to talk with a simple MySensors node.
      The construction is actually a alarm and a radio on the same PCB. Looking at the PCB and a bit of testing I found the connection between the smoke alarm and the radio part.
      0_1485604533822_nexa-pcb-label.png
      When the alarm triggers the pin is pulled high and since there already is a 10k pull-up resistor in place all that is needed is to add a cable to my sensor. The "learn" button is re-used for triggering reset and providing ground.
      The original radio is powered by 3xAA so I just cut the cable and re-soldered the cables to use only 2xAA's.
      I will use the newbiePCB for hooking things up and everything's seems to fit inside the case just fine.
      0_1485604635767_nexa-ready.jpg

      Here is the code that will run for the next couple of days.

      /**
       * The MySensors Arduino library handles the wireless radio link and protocol
       * between your home built sensors/actuators and HA controller of choice.
       * The sensors forms a self healing radio network with optional repeaters. Each
       * repeater and gateway builds a routing tables in EEPROM which keeps track of the
       * network topology allowing messages to be routed to nodes.
       *
       * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
       * Copyright (C) 2013-2015 Sensnology AB
       * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
       *
       * Documentation: http://www.mysensors.org
       * Support Forum: http://forum.mysensors.org
       *
       * This program is free software; you can redistribute it and/or
       * modify it under the terms of the GNU General Public License
       * version 2 as published by the Free Software Foundation.
       *
       *******************************
       *
       * DESCRIPTION
       *
       * Simple fire alarm example modifying a Nexa KD-101L fire alarm
       * Connect digitial I/O pin 3 (FIRE_PIN below) with a 10K resistor to GND.
       * Also connect the FIRE_PIN between the IC and R16 (SMD103=10K).
       */
      
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      #include <MySensors.h>
      #include <Vcc.h>
      
      const float VccMin        = 2.0*0.6;  // Minimum expected Vcc level, in Volts. Example for 2xAA Alkaline.
      const float VccMax        = 2.0*1.5;  // Maximum expected Vcc level, in Volts. Example for 2xAA Alkaline.
      const float VccCorrection = 1.0/1.0;  // Measured Vcc by multimeter divided by reported Vcc
      
      Vcc vcc(VccCorrection);
      
      // Pin connected to the alarm
      #define FIRE_PIN 3
      
      // Id of the sensor child
      #define CHILD_ID 0
      
      // Sleep time in ms        min     s      ms
      unsigned long SLEEP_TIME = 120UL * 60UL * 1000UL;
      
      MyMessage msg(CHILD_ID, V_TRIPPED);
      
      void setup()  
      {  
        // Setup the alarm
        pinMode(FIRE_PIN, INPUT);  
      }
      
      void presentation()  {
        // Send the sketch version information
        sendSketchInfo("Fire Alarm", "1.0");
        // Register sensor
        present(CHILD_ID, S_SMOKE, "Alarm tripped", true);
        // Send the current state
        //send(msg.set("0"));
      }
      
      
      void loop()
      {
        bool tripped = digitalRead(FIRE_PIN) == HIGH;
        
        if(tripped) {
          Serial.println("Fire!");
          send(msg.set(1), true);
          wait(1000);
        } else {
          Serial.println("All ok");
          send(msg.set(0), true);
          // Measure battery level
          uint8_t batteryPcnt = static_cast<uint8_t>(0.5 + vcc.Read_Perc(VccMin, VccMax));
          // Send battery level, used as heartbeat of the sensor
          sendBatteryLevel(batteryPcnt);
        }
        // Sleep until fire
        sleep(digitalPinToInterrupt(FIRE_PIN), HIGH, SLEEP_TIME);
      }
      
      marceltrapmanM Offline
      marceltrapmanM Offline
      marceltrapman
      Mod
      wrote on last edited by
      #2

      @Efflon How is this working out for you?

      I have to add a couple of smoke detectors soon and want to do the same thing as you...

      Fulltime Servoy Developer
      Parttime Moderator MySensors board

      I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
      I have a FABtotum to print cases.

      EfflonE 1 Reply Last reply
      0
      • marceltrapmanM marceltrapman

        @Efflon How is this working out for you?

        I have to add a couple of smoke detectors soon and want to do the same thing as you...

        EfflonE Offline
        EfflonE Offline
        Efflon
        wrote on last edited by
        #3

        @marceltrapman It's working just fine except the battery level messages seems to be lost (this happens to all my sensors). Just as a precaution I pushed the test button this morning and got a proper response and a battery level.

        marceltrapmanM 1 Reply Last reply
        0
        • EfflonE Efflon

          @marceltrapman It's working just fine except the battery level messages seems to be lost (this happens to all my sensors). Just as a precaution I pushed the test button this morning and got a proper response and a battery level.

          marceltrapmanM Offline
          marceltrapmanM Offline
          marceltrapman
          Mod
          wrote on last edited by
          #4

          @Efflon Nice to know :)
          The battery level thing concerns me though.
          I would think this is (sort of) essential...

          Fulltime Servoy Developer
          Parttime Moderator MySensors board

          I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
          I have a FABtotum to print cases.

          EfflonE 1 Reply Last reply
          0
          • marceltrapmanM marceltrapman

            @Efflon Nice to know :)
            The battery level thing concerns me though.
            I would think this is (sort of) essential...

            EfflonE Offline
            EfflonE Offline
            Efflon
            wrote on last edited by
            #5

            @marceltrapman Yes, I'll check if adding a ack request will help..

            marceltrapmanM 1 Reply Last reply
            0
            • EfflonE Efflon

              @marceltrapman Yes, I'll check if adding a ack request will help..

              marceltrapmanM Offline
              marceltrapmanM Offline
              marceltrapman
              Mod
              wrote on last edited by
              #6

              @Efflon Any news? Before I buy a couple of these :)

              Fulltime Servoy Developer
              Parttime Moderator MySensors board

              I use Domoticz as controller for Z-Wave and MySensors (previously Indigo and OpenHAB).
              I have a FABtotum to print cases.

              EfflonE 1 Reply Last reply
              0
              • marceltrapmanM marceltrapman

                @Efflon Any news? Before I buy a couple of these :)

                EfflonE Offline
                EfflonE Offline
                Efflon
                wrote on last edited by
                #7

                @marceltrapman Haven't had the time to add an ack to the battery request, but the sensor is working just fine. I don't know if it's my home assistant setup or something else causing the battery levels to get lost but I'm sure it's not part of the smoke alarm hack. Since the sensor drain is almost nothing, the battery levels are not moving much.
                I cant guarantee the pcb layout is the same on newer versions of this smoke alarm..

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                19

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular