Git Product home page Git Product logo

iot-demo's Introduction

IoT-demo

IoT temperature device utilising Arduino, ESP8266, Firebase v3, and HTML/JS client

Intro:

I have created this IoT demonstration as a portfolio piece. The point of the demo isn't to make an accurate temp sensor (although you could do that), it's to demonstrate connecting an IoT device securely to a cloud service for subscribers to consume. Importantly this demo is very low cost, as cheap as AU$25 for components and Google Firebase currently has a free pricing tier.

I have put LOTS of comments into the code to help people understand what is going on and some of limitations of the hardware. Unfortunately the ESP8266 on Arduino is an ongoing work in progress and I've already had to rewrite the demo once due to library updates breaking the code base.

Description:

This is an IoT device that posts readings from a temperature sensor to a cloud service which then sends the data to web clients (typically I get a 1-2 second delay from device to client depending on the connection speed). The device uses a BMP180 temp sensor on an ESP8266 micro controller running Arduino and connects to the internet via a supplied Wifi connection. It connects to Google Firebase using the REST API to post sensor readings in JSON. Clients (web, iOS, Android) can then access the temp data through the Firebase APIs. For the demo I have a one page HMTL site using the Firebase Javascript Web API to receive dynamic callbacks as new data is posted. The demo utilises the ESP8266's ability to connect via HTTPS which is required to talk to the Firebase cloud service.

The device uses the following components:

  • ESP8266 12e (nodeMCU 1.0)
  • ST7735 1.8" display (SPI)
  • BMP180 temperature sensor (I2C)

To run the full demo you will also need:

  • A Google Firebase account to create an application on and generate a secret key. You must fill in the database name, and database secret in the arduino code. You must fill in the domain, database URL, and API into the html code for the web page to connect to Firebase.
  • A Wifi connection for the device to connect to (I have used both Wifi routers and mobile phone hotspots with no problems). You must fill in the SSID and password of the wifi to connect to.

You can run the device just as a temperature sensor without connecting it to Wifi or Firebase.

Device features:

  • Communications are secure (via https) and are direct to Firebase (no proxy).
  • Handles wifi drop outs/ins (SSID green = connected, SSID red = not connected).
  • Displays message payload and status (displays data size in bytes, green background = message success, red background = message failure).
  • (web page) Due to the way Firebase works you do not need to host the web page, you can just run it from your PC. However if you want to demo it on a mobile device (like I need to) you will need to host it.
  • First and foremost this is a temperature sensor, so if it can't connect to wifi is just displays the temperature. IT DOES NOT NEED WIFI OR FIREBASE TO OPERATE. If they are present it uses them - simples!

Future Updates:

I am already planning to add the ability to monitor multiple devices. Although the changes to the arduino code is easy enough (I'll include the MAC address of the device in the post to Firebase) the client changes start to get a bit more complex especially as I want to have swipe navigation to swap between devices.

iot-demo's People

Contributors

nuke66 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.