rovale / Innoexp2

Internet of Things - Session material used during the second innovation experience at eVision Industry Software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Innoexp2 IoT

During this second Innnoexp we will explore creating physical 'Things' using Arduinos and similar boards and a wide range of sensors and actuators. Then we will connect them to the Internet of Things using the MQTT protocol and Node-RED. The idea is to get up to speed with the technology as quickly as possible, to give room for creative thoughts and innovation to happen.

This repository contains some Arduino sketches and Node-Red flows used to introduce the basic concepts.

Arduino sketches

Arduino boards are able to read inputs - light on a sensor, a finger on a button - and turn it into an output - activating a motor, turning on an LED. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language, and the Arduino IDE.

A sketch is the name that Arduino uses for a program.

Blink

This is the classic Arduino 'Hello World'.

It introduces:

Button

Turns the LED on when the button is pressed.

It introduces:

Photo resistor

Prints the measured value of a photo resistor to the serial output.

It introduces:

Json

Uses the serial interface. Sends the light sensor value every 500 seconds:

{"light": 0-1024}

Sets the dim value of the LED after receiving:

{"dimmer": 0-255}

The sketch introduces:

  • usage of a library to create / parse Json messages: ArduinoJson.
  • power modulation (PWM) to dim the LED.

BoatHorn

This sketch used to connect an ESP-8266 directly to an MQTT broker and make it send status messages and respond on commands.

Node-RED flows

Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.

It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click. Within NODE-Red it's also easy to create a live data dashboard.

All flows in this repository connect the Aruino through the serial port to Node-Red.

Arduino Serial Json

Connects the Arduino to NODE-Red using the Json sketch and serialport nodes. On the NODE-Red dashboard it displays a gauge for the light intensity and a dimmer slider for the LED.

Arduino Firmata

The same as the previous flow but now using the Firmata protocol with Arduino nodes. It also adds a button to the dashboard to show the state of the button on the Arduino board.

Arduino MQTT

The same as the previous flow but now directing all communication through an MQTT broker, turning our Arduino into a 'Thing' which is connected to the Internet of Things. This flow uses the builtin MQTT nodes.

Related information and links

About

Internet of Things - Session material used during the second innovation experience at eVision Industry Software


Languages

Language:C++ 97.6%Language:C 2.4%