Garage Door Monitor and Opener

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Introduction

This system implements a simple garage door opener and environmental monitor. The hardware connects to the internet using Wi-Fi then on to the Pelion Device Management Platform which provides device monitoring and secure firmware updates over the air (FOTA). Pelion Device Management provides a flexible set of REST APIs which we will use to communicate to a web application running on an EC-2 instance in AWS. The web application will serve a web page where we can monitor and control our garage..

This project is intended to work on the DISCO-L475VG-IOT01A from ST Microelectronics It implements a simple actuator to drive a relay to simulate pushing the "open" button on older style garage doors which do not use a rolling code interface.

The system is designed to be mounted over the door so that the on board time of flight sensor can be used to detect if the door is open or closed.

The system also monitors temperature, humidity and barometric pressure.

https://os.mbed.com/media/uploads/JimCarver/garageopener.jpg

Hardware Requirements:

DISCO-L475G-IOT01A https://os.mbed.com/platforms/ST-Discovery-L475E-IOT01A/

Seeed Studio Grove Relay module https://www.seeedstudio.com/Grove-Relay.html

Seeed Studio Grove cable, I used this one: https://www.seeedstudio.com/Grove-4-pin-Male-Jumper-to-Grove-4-pin-Conversion-Cable-5-PCs-per-Pack.html

Connect to the PMOD connector like this:

https://os.mbed.com/media/uploads/JimCarver/opener.jpg

This shows how I installed so that the time of flight sensor can detect when the door is open

https://os.mbed.com/media/uploads/JimCarver/opener1.jpg https://os.mbed.com/media/uploads/JimCarver/opener2.jpg

To use the project:

You will also need a Pelion developers account.

I suggest you first use the Pelion quick state to become familiar with Pelion Device Management. https://os.mbed.com/guides/connect-device-to-pelion/1/?board=ST-Discovery-L475E-IOT01A

Web Interface

For my web interface I am running node-red under Ubuntu in an EC2 instance on AWS. This can run for 12 month within the constraints of their free tier. Here is a tutorial: https://nodered.org/docs/getting-started/aws

You will also need to install several node-red add ons:

sudo npm install -g node-red-dashboard

sudo npm install -g node-red-contrib-mbed-cloud

sudo npm istall -g node-red-contrib-moment

After starting node-red import the contents of GarageFlow.txt from the project, pin the flow into the page.

To enable your web app to access your Pelion account you need an API key.

First you will neet to use your Pelion account to create an API key.

https://os.mbed.com/media/uploads/JimCarver/api_portal.jpg

Now we need to apply that API key to your Node-Red flow.

https://os.mbed.com/media/uploads/JimCarver/api_node-red.jpg

Committer:
JimCarver
Date:
Thu Dec 05 19:03:48 2019 +0000
Revision:
37:ec1124e5ec1f
Parent:
9:265744785d33
Bug fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MarceloSalazar 9:265744785d33 1 Permissive Binary License
MarceloSalazar 9:265744785d33 2
MarceloSalazar 9:265744785d33 3 Version 1.0, September 2015
MarceloSalazar 9:265744785d33 4
MarceloSalazar 9:265744785d33 5 Redistribution. Redistribution and use in binary form, without
MarceloSalazar 9:265744785d33 6 modification, are permitted provided that the following conditions are
MarceloSalazar 9:265744785d33 7 met:
MarceloSalazar 9:265744785d33 8
MarceloSalazar 9:265744785d33 9 1) Redistributions must reproduce the above copyright notice and the
MarceloSalazar 9:265744785d33 10 following disclaimer in the documentation and/or other materials
MarceloSalazar 9:265744785d33 11 provided with the distribution.
MarceloSalazar 9:265744785d33 12
MarceloSalazar 9:265744785d33 13 2) Unless to the extent explicitly permitted by law, no reverse
MarceloSalazar 9:265744785d33 14 engineering, decompilation, or disassembly of this software is
MarceloSalazar 9:265744785d33 15 permitted.
MarceloSalazar 9:265744785d33 16
MarceloSalazar 9:265744785d33 17 3) Redistribution as part of a software development kit must include the
MarceloSalazar 9:265744785d33 18 accompanying file named "DEPENDENCIES" and any dependencies listed in
MarceloSalazar 9:265744785d33 19 that file.
MarceloSalazar 9:265744785d33 20
MarceloSalazar 9:265744785d33 21 4) Neither the name of the copyright holder nor the names of its
MarceloSalazar 9:265744785d33 22 contributors may be used to endorse or promote products derived from
MarceloSalazar 9:265744785d33 23 this software without specific prior written permission.
MarceloSalazar 9:265744785d33 24
MarceloSalazar 9:265744785d33 25 Limited patent license. The copyright holders (and contributors) grant a
MarceloSalazar 9:265744785d33 26 worldwide, non-exclusive, no-charge, royalty-free patent license to
MarceloSalazar 9:265744785d33 27 make, have made, use, offer to sell, sell, import, and otherwise
MarceloSalazar 9:265744785d33 28 transfer this software, where such license applies only to those patent
MarceloSalazar 9:265744785d33 29 claims licensable by the copyright holders (and contributors) that are
MarceloSalazar 9:265744785d33 30 necessarily infringed by this software. This patent license shall not
MarceloSalazar 9:265744785d33 31 apply to any combinations that include this software. No hardware is
MarceloSalazar 9:265744785d33 32 licensed hereunder.
MarceloSalazar 9:265744785d33 33
MarceloSalazar 9:265744785d33 34 If you institute patent litigation against any entity (including a
MarceloSalazar 9:265744785d33 35 cross-claim or counterclaim in a lawsuit) alleging that the software
MarceloSalazar 9:265744785d33 36 itself infringes your patent(s), then your rights granted under this
MarceloSalazar 9:265744785d33 37 license shall terminate as of the date such litigation is filed.
MarceloSalazar 9:265744785d33 38
MarceloSalazar 9:265744785d33 39 DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
MarceloSalazar 9:265744785d33 40 CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
MarceloSalazar 9:265744785d33 41 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
MarceloSalazar 9:265744785d33 42 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
MarceloSalazar 9:265744785d33 43 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
MarceloSalazar 9:265744785d33 44 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
MarceloSalazar 9:265744785d33 45 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
MarceloSalazar 9:265744785d33 46 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
MarceloSalazar 9:265744785d33 47 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
MarceloSalazar 9:265744785d33 48 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
MarceloSalazar 9:265744785d33 49 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.