Giter VIP home page Giter VIP logo

sensoropendetector's Introduction

Sensor Open Detector

Please see the accompanying file LICENSE for details of the terms of use. Note that this software and project should be considered experimental.

Overview

This is a simple Arduino sketch written for the Arduino Nano 33 IoT. It will detect that a sensor is open / closed and is able to notify that the sensor is open / closed. Currently only text-messaging over the Threema messaging service is supported as a means of notification. The board communicates to the Threema API using the internet over a local Wifi connection. The software will connect to the configured Wifi access point only when necessary.

The device has a momentary switch. When the sensor is open the momentary switch can be depressed in order to signal that no notification should be sent -- the notification is "paused".

Wiring

The following diagram shows the very simple wiring for the project;

Wiring

A suitable sensor that would be practical for detecting a sensor being open might be a reed switch.

Dependencies

IDE

The Arduino IDE will be required to build the software and to load it onto an Arduino Nano 33 IoT board.

Device Setup

The Arduino Nano 33 IoT board has a Wifi facility on-board. The firmware should be upgraded and the certificate for the Threema gateway msgapi.threema.ch should be loaded into the board.

Arduino Libraries

The following Arduino libraries are required;

  • WiFiNINA
  • Arduino Low Power
  • ArduinoHttpClient

Threema Handset Application

The people who are receiving messages because the sensor is open will need to have the Threema handset application installed on their mobile phone.

Threema Message Gateway Account

Having a "Basic" Gateway ID account with the Threema Message Gateway service is necessary in order to be able to send textual messages to a user on the Threema handset application.

Configuration

In order to be able to configure the device, a file staticsettings.h should be created. It is included in the .gitignore file because it should not be checked in. The file has the following C++ code structure;

static Settings* STATICSETTINGS = new Settings(
      "Main Gate",
      new WifiSettings("sicht-5", "abc123def456"),
      new MonitoringSettings(2),
      THREEMA,
      new ThreemaSettings(
        "*XXX2222",
        "987abc654def",
        new ThreemaRecipient("UUUU6666",
          new ThreemaRecipient("KKKK4444", NULL)
        )
      )
    );
  • Replace Main Gate with the name of the sensor that this device will manage
  • Replace sicht-5 with the SSID of your Wifi access point
  • Replace abc123def456 with your Wifi access password
  • Replace 2 in MonitoringSettings(2) with the number of minutes that the sensor is open before it will notify
  • Replace *XXX2222 with your Threema Gateway ID
  • Replace 987abc654def with your Threema Gateway password

The structure starting new ThreemaRecip... is a linked list of the Threema recipients who will receive notifications when the sensor is left open. Each recipient is identified by their Threema ID shown in this example by UUUU6666 and KKKK4444.

sensoropendetector's People

Contributors

andponlin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.