Gemma M0 Vibration Sensor Motion Alarm

Similar documents
Dear Diary Alarm. Created by Carter Nelson. Last updated on :31:02 PM UTC

Part 1: Playing with Electricity

Alarm project board for micro:bit.

Installing and operating your Enclosed Cabinet Cooling System and digital thermostat

Installing and operating your Cabinet Cooling System, with Digital Thermostat

The most user friendly Security Alarm System L S Section 1 Overview of System Section 2 Planning your Installation

Alarm System SECURE AS 302

LD200 / RLD400 LD200-G /RLD400-G

LMS-188-4P-BMS 4 POINT DIGITAL MONITOR/ALARM WITH PROTOCOL CONVERTER OPERATING INSTRUCTIONS

Colour also can display the time Build a LED colour clock

Safewatch Pro 3000 System Manual

DISPLAY ALARM SYSTEMS

Version 1.03 January-2002 USER S MANUAL

Team Rescue X: Autonomous Firefighting Robot

Using Your. Security System With LED Keypad S5030, S5031, S5032

Summit 3208GLD USER MANUAL. Electronics Line

MULTIGUARD MULTIGUARD USERS MANUAL TYPE S3/240W 26/01/2010

Using the Remote Control Unit

Unpacking, Assembly, and Installation Guide ENGLISH. Page 1 to 10

VAP304 PRO INSTALLATION & OPERATION MANUAL

Congratulations on your Alert- it purchase

1 Introduction. Continue with any key. Process

Instruction Manual Infrared Heater

Homework 5: Theory of Operation and Hardware Design Narrative

KIT 53. CODEPAD/ALARM USING 68HC705P9

LeakSafe. solutions. WaterSwitch2. Installation Instructions

FOR TM-16 EMERGENCY WARNING SYSTEM

OWNER S MANUAL CLEANING ROBOT

Section 9 System Operation

BACK WASH INSIDE THE SPA

READ ME FIRST DIY WIRELESS ALERT. Driveway Alert Kit. Instruction Manual

YOUR SCHOOL STAFF NEEDS PROTECTION

Protect anything, anywhere, anytime.

Model: DC-159. Instruction Manual

METAL DETECTOR MODEL NO: MD1000 OPERATION & MAINTENANCE INSTRUCTIONS PART NO: /08

User s Guide. SUB-MA7240O-0001.OG.Solution doc. Created: 6/05/03. Last Updated: 23/09/03. MA7240AO-0001 Version 1.0

Section 8 System Operation

MA11 - Portable Alarm

OWNER S MANUAL. Fortune Finder Platinum Edition TC-3020 GET THE LATEST UPDATED MANUAL FOR THIS PRODUCT BY VISITING US FREQUENTLY AT

U ser's Guide PC6010

Kwêbeam GSM/Interface/Repeater Module

Instruction Manual. Self-Leveling Combination Cross-Line Laser and Five-Beam Laser Dot Model No &

INSTALLATION AND OPERATION INSTRUCTIONS

Home Doorway Alert Kit

What Is Retrofit? Most retrofit devices will reduce your water and sewer bill enough to pay for themselves within six months.

Thank you for choosing Ideal Security s Home Security System with Telephone Dialer.

Installation, Operation & Maintenance Manual. Wash System

Pool Protector OPERATING INSTRUCTIONS MANUAL

PTE0705 Electric Fence Monitor

STEP BY STEP INSTALLATION INSTRUCTIONS. Wood Blinds. Standard Control

PINK MAGNETIC RECUMBENT BIKE

STEP BY STEP INSTALLATION INSTRUCTIONS. Wood Blinds. Cordless Control

SERVICE MANUAL COOKERS

KNX module for smoke alarm devices Dual/VdS and Q-Label (Order no )

QUICKFIT INSTALL HOOK-UP SHEET FOR ESL KIT REV 1.17 OP

EEMAX HOME ADVANTAGE

LeakSafe. solutions. WaterSwitch2. Installation Instructions

WIRELESS NETWORK USER MANUAL MHz RFT-868-PIR Wireless Passive Infrared Sensor

Sonic Safety. Sonic Safety. Wireless Safety and Security System. HG-1500 System. For System Package OWNER S MANUAL

Dishwasher Load-Unload Indicator. Jitendra Tailor

9000P Wireless Alarm Owner s Manual

Manual & Technical Documentation V1.1

WLS900 Wireless Security System. Table of Contents. Your installing company is, Name: Address: Phone: Your monitoring station is, Name: Phone:

User Manual Doc.Ref : EVO-KNX-UM. EVO-KNX Paradox KNX Interface ELAUSYS EVO-KNX. KNX Interface for Paradox alarm system. User Manual.

HV2R ROTARY LASER INSTRUCTION MANUAL

MEGA WAY LCD 4-CHANNEL MOTORCYCLE ALARM SECURITY SYSTEM. Operation Manual MEGATRONIX CALIFORNIA, U.S.A. MEGA 3100 OPERATE 1

Owner's Manual AURATON 3013 для программного обеспечения вер. F0F

KwêBeams Effective wire free outdoor early warning system

Portable Evaporative Air Cooler User Manual Read and save these instructions before use

CEILING FAN OWNER'S MANUAL

TECH SHEET DO NOT DISCARD PAGE 1. If unsuccessful entry into diagnostic mode, actions can be taken for specific indications:

Part Number Structure ZA 016 L D CT

READ ME FIRST DIY WIRELESS ALERT. Gate Alert Kit. Instruction Manual

Instruction Manual. Self-Leveling Combination Cross-Line Laser and Five-Beam Laser Dot Model No , &

STEMSEL Beginners Project 1: Alarm System

REMOTE CONTROL CAR ALARM SYSTEM

PROFESSIONAL S2 SAFE USER GUIDE ELECTRONIC LOCK USER GUIDE.

EEMAX SERIES-TWO WATER HEATERS

Owner s Guide and Installation Manual

WAIWELA SERIES-TWO WATER HEATERS

Features TREASURE HUNTER S CODE OF ETHICS

Voice Board. Installation and Programming Guide. Runner 4/8,PowerWave 4/8/16 &, Elite64. Add-on Board For Storing Recorded Voice Messages

WIRELESS MOTION SENSOR USER MANUAL MULTI LANGUAGE START-LINE TRANSMITTER AWST-6000

READ ME FIRST DIY WIRELESS ALERT. Add-on Alert Sensor. For Swann Wireless Alert systems. Instruction Manual

Wave Series. Installation and User Guide. PE950 Hand-Held Remote Transceiver PE650 Panel-Mounted Transceiver

Laboratory Airflow Monitors & Controls TYPE C STANDARD & NIGHT SETBACK LED & DIGITAL - VAV SYSTEMS

CONTROL AND INDICATOR MODULE. Potok-BKI INSTRUCTION MANUAL

DXL ALA Settings Guide

ABOUT THIS DOCUMENT AND THE DOCUMENT STRUCTURE WE USE

TPMS USER MANUAL. Table of Contents. Impaqed Products BV.

Silencing an Alarm All/Perimeter and Home/Away Systems. Area Systems. What to do when a trouble tone is sounding

TECHNICAL INFORMATION Touchtronic Clothes Dryers

Part Number Structure ZT 028 L D CT R 15

Getting Started Guide

DM200 = CS200 METAL DETECTOR

Contents. Contents

ENCLOSED PARTS WASHER WITH HEATING SYSTEM ---EPW160-H

STEP BY STEP INSTALLATION INSTRUCTIONS. Durawood Blinds. Standard Lift

Simon XTi Quick Operation Guide

Operating instructions 2-channel code lock. Item No

Transcription:

Gemma M0 Vibration Sensor Motion Alarm Created by John Park Last updated on 2018-08-22 04:06:27 PM UTC

Guide Contents Guide Contents Overview Make the Alarm How It Works Assembly Bending Legs Make Feet Fast Vibration Sensor Code the Alarm with CircuitPython CircuitPython Prep Alarm Code Use the Alarm 2 3 5 5 6 6 7 9 12 12 12 13 Adafruit Industries https://learn.adafruit.com/motion-alarm Page 2 of 13

Overview You can catch enemy spies in the act of touching your stuff by building a motion alarm with a vibration switch, Gemma M0, and a piezo buzzer! Any time it is moved enough to trigger the vibration switch, it will sound the alarm!! 1 x Gemma M0 Small, round microcontroller ADD TO CART 1 x Fast Vibration Sensor Switch Easy to trigger ADD TO CART 1 x Piezo Buzzer Fully enclosed ADD TO CART 1 x 3x AAA Battery Holder with On/Off switch ADD TO CART 1 x AAA batteries 3 pack Alkaline power ADD TO CART 1 x USB Cable 6 A/MicroB ADD TO CART Adafruit Industries https://learn.adafruit.com/motion-alarm Page 3 of 13

You'll also need three M3 x 8mm screws and four nuts to attach parts to the Gemma M0. Adafruit Industries https://learn.adafruit.com/motion-alarm Page 4 of 13

Make the Alarm How It Works A vibration switch is a very small cylindrical sensor that has a stiff piece of metal surrounded by a spring. The spring normally doesn't touch the stiff leg, so the circuit is open. When it is moved, the spring will vibrate a bit, touching the stiff leg, and closing the circuit. You can see the copper leg with its coiled spring surrounding the silver colored leg in this cutaway photograph. By connecting one leg to analog pin A0 and the other to GND, we can code the Gemma M0 so that it monitors the analog value of the A0 input pin when the spring vibrates it will send the analog pin to ground, and so the analog voltage value will decrease. When the value goes below a certain threshold, the code will send a pulse width modulated (PWM) tone signal to the piezo buzzer on D0 to make it sound the alarm. Adafruit Industries https://learn.adafruit.com/motion-alarm Page 5 of 13

Assembly The Gemma M0 can't make any sounds on it's own, so let's connect the piezo buzzer to it so we can hear it! Bending Legs Adafruit Industries https://learn.adafruit.com/motion-alarm Page 6 of 13

We'll use the two M3 screws and nuts to connect the buzzer's legs to the D0 and GND pads of the Gemma M0. Use pliers (or your fingers) to bend the legs down, carefully, making sure not to break them off. While the legs will bend easily to their new position, trying to move them back to their original position may be more stress than they can take. Each leg can fit nicely into a small groove molded into the plastic case. Make Feet Use the pliers or the screws themselves to form small hook-like feet at the end of each leg, as shown here, so they will connect to D0 and GND. (You can check the other side of the board to see the pad names on the silkscreen.) Adafruit Industries https://learn.adafruit.com/motion-alarm Page 7 of 13

It doesn t matter which leg of the buzzer goes to which pad, it is not polarized. Thread the nuts on and tighten them, being careful that the legs don't touch any copper pads on the board other than their respective pin assignments. Adafruit Industries https://learn.adafruit.com/motion-alarm Page 8 of 13

Fast Vibration Sensor OK, now that the piezo is connected, we'll add the vibration switch. We ll connect the vibration switch to A0 with the thicker, silver colored leg. Use a screw and nut to connect it to the Gemma M0 as shown. You'll use an extra nut to connect the thin wire of the vibration sensor to the same GND screw that's being used for the piezo buzzer. Adafruit Industries https://learn.adafruit.com/motion-alarm Page 9 of 13

Adafruit Industries https://learn.adafruit.com/motion-alarm Page 10 of 13

That s all there is to it next we ll program it! Adafruit Industries https://learn.adafruit.com/motion-alarm Page 11 of 13

Code the Alarm with CircuitPython CircuitPython Prep Follow this guide https://learn.adafruit.com/adafruit-gemma-m0/circuitpython (https://adafru.it/zal) to get started with coding the Gemma M0 in CircuitPython. Install the latest release version of CircuitPython on the board. You may also want to install the Mu editor https://learn.adafruit.com/adafruit-gemma-m0/installing-mu-editor (https://adafru.it/bgp) for your coding needs. Once you can successfully code in Mu and upload to the board, return here. Alarm Code The alarm code will do two fundamental things: measure the analog voltage value on pin A0 to see when it drops below a certain threshold, and use PWM (pulse width modulation) to play alarm tones on the piezo buzzer over pin D0. Copy the code below, paste it into Mu, and then save it to your Gemma M0 as main.py. # Motion Sensor Alarm # uses Gemma M0, vibration sensor on A0/GND, & piezo on D0/GND import time import pulseio from analogio import AnalogIn import board piezo = pulseio.pwmout(board.d0, duty_cycle=0, frequency=440, variable_frequency=true) vibrationpin = AnalogIn(board.A0) def get_voltage(pin): return (pin.value * 3.3) / 65536 while True: print((get_voltage(vibrationpin),)) vibration = get_voltage(vibrationpin) if vibration < 1: # the sensor has been tripped, you can adjust this value # for sensitivity for f in (2620, 4400, 2620, 4400, 2620, 4400, 2620, 4400): piezo.frequency = f piezo.duty_cycle = 65536 // 2 # on 50% time.sleep(0.2) # on 1/5 second piezo.duty_cycle = 0 # off time.sleep(0.02) # pause time.sleep(0.01) # debounce delay Test the alarm by touching or tapping it. As soon as it senses a bit of movment, BEEP BEEP BEEP BEEP BEEP!!! Adafruit Industries https://learn.adafruit.com/motion-alarm Page 12 of 13

Use the Alarm Now, you re ready to deploy the alarm. Hook up the battery pack, set the alarm in your bag or secret hollow book, and then turn it on. When your overly curious enemy rummages around in your things, the piercing alarm will let you catch them in the act! Adafruit Industries Last Updated: 2018-08-22 04:06:21 PM UTC Page 13 of 13