Coder Social home page Coder Social logo

evacuation-occupation-sensor's Introduction

evacutation-occupation-sensor

A remote occupancy sensor for the single bathroom stall in a large office.

This solution leverages a battery powered Espruino MDBT42Q and a RaspberryPi 3 loaded with EspruinoHub to broadcast BLE sensor data via MQTT and serve a static dashboard page.

Setup

Follow the installation instructions for EspruinoHub on a Raspberry Pi 3.

Update config.json with the MDBT42Q address and put it in ~/pi/EspruinoHub.

Open the Espruino IDE at http://RASPBERRY_PI_IP:1888/ide. Load MDBT42Q.js to the MDBT42Q and run save().

Navigate to http://RASPBERRY_PI_IP:1888/mqtt to verify MQTT broadcast.

Navigate to http://RASPBERRY_PI_IP:1888/bathroom to view the bathroom status.

Hardware

Espruino MDBT42Q

MDBT42Q Image

Raspberry Pi 3

RPi3

Adafruit 500 mAh LiPo Battery Adafruit LiPo Charger Sparkfun Tilt Sensor Slide Switch

System Design

Whiteboard image of system

Software

An excellent bridging solution to serve BLE advertising data via MQTT. This lives on the Raspberry Pi 3 and serves the following topics:

/ble/advertise/stall-monitor-men/l  // Lock Status
/ble/advertise/stall-monitor-men/d  // Previous State Duration (sec)
/ble/advertise/stall-monitor-men/battery // Battery Status (Percentage based on max voltage of 3.3V and min voltage of 2.5V)
/ble/advertise/stall-monitor-men/rssi // RSSI

Espruino IDE

The BLE sensor itself runs Javascript, with a number of libraries built in for GPIO and BLE control. See the sensor code in MDBT42Q.js.

The code uses setWatch and NRF.setLowPowerConnection to maximize battery life.

Dashboard

Case Design

The case was designed in AutoDesk Fusion 360, and printed on a MakerBot Replicator 2. Design files can be found in /case

evacuation-occupation-sensor's People

Contributors

drewterry avatar

Stargazers

Carlos Medina avatar Tirell Mckinnon avatar

Forkers

carlosmed

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.