Introduction: ESP - Remote Ambiance Notifier
The prototype is based on the popular IOT chip ESP8266.
ESP8266
This is a low-cost Wi-Fi microchip with full TCP/IP stack and microcontroller capability produced by Shanghai-based Chinese manufacturer, Espressif Systems.
- Processor: L106 32-bit RISC microprocessor core based on the Tensilica Xtensa Diamond Standard 106Micro running at 80 MHz†
- Memory:
- 32 KiB instruction RAM
- 32 KiB instruction cache RAM
- 80 KiB user data RAM
- 16 KiB ETS system data RAM
- External QSPI flash: up to 16 MiB is supported (512 KiB to 4 MiB typically included)
- IEEE 802.11 b/g/n Wi-Fi
- Integrated TR switch, balun, LNA, power amplifier and matching network
- WEP or WPA/WPA2 authentication, or open networks
- 16 GPIO pins
- SPI I²C (software implementation)[5]
- I²S interfaces with DMA (sharing pins with GPIO)
- UART on dedicated pins, plus a transmit-only UART can be enabled on GPIO2
- 10-bit ADC (successive approximation ADC)
Step 1: Parts List
- REES52 Sound Detection sensor Module
- OEM Vibration Sensor Module - SW-420
2 of NodeMCU-WiFi-Arduino-IDE-Lua-based-IoT-ESP8266-Development Board
CP2102 USB 2.0 to TTL UART SERIAL CONVERTER MODULE with DTR pin
LEDs - Red, Yellow, Blue
Step 2: Pin Layout
The Pin Layout
ESP A0 - Sound Sensor OUT
ESP 0 - LED (Sound)
ESP 5 - Vibration Sensor D0
ESP 4 - LED (vibration)
Step 3: Vibration Detection
OEM Vibration Sensor Module - SW-420
The Vibration module based on the vibration sensor SW-420 and Comparator LM393 to detect if there is any vibration that beyond the threshold. The threshold can be adjusted by the on-board potentiometer.
When this no vibration, this module output logic LOW the signal indicate LED light,And vice versa.
Specifications
- The default state of the switch is close
- Digital output Supply voltage:3.3V-5V
- On-board indicator LED to show the results
- On-board LM393 chip
- Dimension of the board: 3.2cm x 1.4cm
Step 4: Sound Detection
REES52 Sound Detection sensor Module
The sound sensor module provides an easy way to detect sound and is generally used for detecting sound intensity. This module can be used for security, switch, and monitoring applications. Its accuracy can be easily adjusted for the convenience of usage. It uses a microphone which supplies the input to an amplifier, peak detector and buffer. When the sensor detects a sound, it processes an output signal voltage which is sent to a microcontroller then performs necessary processing.
Specifications
- Operating voltage 3.3V-5V
- Output model: digital switch outputs (0 and 1, high or low level)
- With a mounting screw hole
Step 5: GPS - Through Google Geolocation API
The Google Maps Geolocation API
The Google Maps Geolocation API returns a location and accuracy radius based on information about cell towers and WiFi nodes that the mobile client can detect. This document describes the protocol used to send this data to the server and to return a response to the client.
Communication is done over HTTPS using POST. Both request and response are formatted as JSON, and the content type of both is application/json. Before you start developing with the Geolocation API, review the authentication requirements (you need an API key) and the API usage limits. Geolocation requests Geolocation requests are sent using POST to the following URL sample:
https://www.googleapis.com/geolocation/v1/geolocat...
Prototype Key: AIzaSyAIPOo9wJkLREEqWACCZbk1Wm601Ojs0iY
Step 6: Notifications Using Telegram Bot Service (Opensource)
Telegram is a messaging app with a focus on speed and security, it’s super-fast, simple and free. It can be used on all devices at the same time — messages sync seamlessly across any number of your phones, tablets or computers.
With Telegram, one can send messages, photos, videos and files of any type (doc, zip, mp3, etc), as well as create groups for up to 100,000 people or channels for broadcasting to unlimited audiences. One can write to phone contacts and find people by their usernames. Telegram is like SMS and email combined — and can take care of all your personal or business messaging needs. In addition to this, it supports end-to-end encrypted voice calls.
Prototype uses Telegram Bot service:
BotToken[] = "537307026:AAFD-w2yixZz29we4Qjw5_HgtL1T9ihMdK8";
Step 7: Analytics - Using ThingSpeak Channel
ThingSpeak is an open source Internet of Things (IoT) application and API to store and retrieve data from things using the HTTP protocol over the Internet or via a Local Area Network. ThingSpeak enables the creation of sensor logging applications, location tracking applications, and a social network of things with status updates".
- ThingSpeak was originally launched by ioBridge in 2010 as a service in support of IoT applications.ThingSpeak has integrated support from the numerical computing software MATLAB from MathWorks,[4] allowing ThingSpeak users to analyze and visualize uploaded data using Matlab without requiring the purchase of a Matlab license from Mathworks. ThingSpeak has a close relationship with Mathworks, Inc.
Prototype uses the following ThingSpeak Channel
- String apiKey = "BJAUZC22GNAUQCQQ";
- String thingtweetAPIKey = "8LFA68AASLC0096N";