Alexa Environment IoT Prototype

My Role

My Team

Prototype • IoT • Environment • Arduino • AWS • Databases • MySQL
Placed on the 4th floor.

Duration

Tools

I built an IoT device, called Alexa Environment, which collects environment data from soil of a plant and sends it across the protocols to databases, and to AWS.

There is a GitHub repository with all the code.

Here's a brief write up of the project objective, technical summary and what the schema looked like: 

What is IoT?

Once you build something what do you do with connectivity and data.

Transport: Send data from the device to server.  Or phone ->server ->device.

Most of the problems fit into these 2 concepts.

Know how to use these tools and set a database up.
We’ll write some code in Javascript since it runs everywhere. May do some python.

On hardware side we use Arduino maker 1010. And environment shield that goes on the top of it. Can get from Equipment room for whole of the class.

Once we get Arduino to do something, we need to transport that data somewhere.  Like in semester 1, serial was a transport but that anchors a computer to the arduino. So for transport we have stuff like ethernet, wifi, blue tooth, custom radio stuff.

Simplest way to do this - this was 5 years ago:

Sensor -> Arduino -> serial -> computer

Things have gotten a lot easier now: server costs just a couple of months per month

Another way to do this:

Sensor-> arduino-> xbee/zigbee -> gateway -> server

Another way to do this is using Bluetooth LE (low energy).

Another way to do this is:

Sensor -> Arduino -> network (wifi, cellular LTE) -> server.

Wifi is what we’re going to use in this class to send data.

This class we will use Arduino MKR Family. Theres MKR GSM 1400 if there is no connectivity on internet. We will use MKR Wifi 1010 for the class.  Rob got them for class.

On the 1010 its stable. It tries to validate certificate change, so it knows you;’re connecting to a secure server since it has crypto chip. One of the things we’ll briefly talk about it securing it from sniffing.


They’re powered from 5.5 volt powered by usb. Cellular takes a lot of power so it got to be connected to main power. So if you need a project that is disconnected and runs on a battery, it should be done on MKR LoRa radio (Long Range). There is LoRA-wan that puts encryption on the top of that. LoRa is super low power - good for agriculture projects (you have to keep them sleeping a lot so they wake up send a signal and go back to sleep). LORA is pretty good if you need battery but Tradeoff is its super lowbandwith, less than a mb per day. Some Comcast (machine que) version has higher bandwidth. It’s easy to send data from LoRA to server, but its difficult to send it back to server (because its sleeping).

—————————————————

If w’re using wifi based board to send data we have these protocols:


  1. HTTP - We’ll do this. Sending Data via HTTP is pretty easy as long as you have the right libraries.  Sensor->Arduino-> HTTP-> Server
  2. CoAP - Particle.io boards for 19 bucks, its arduino like, ability to change code from browser. You can have a webhook (A process to move data from their (particles) server to your server. On my server Node.js receives json, parses it and…data stored. Then we can do some queries. We’re not going to do particle because its too easy and hides complexity
  3. MQTT - We’ll do this. Sensor -> Arduino <-Mqtt->Broker<->Client. In addition to be lightweight it gives us a serve path so its easier than HTTP. (CONVENTION: Location/device/sensor). Server is called Broker. When we are a client we can write to a topic and publish our data. Sometimes we will publish JSON, like {temperature: 73 humidity: 45} to environment. We can also subscribe to a topic. On that arduino I can subscribe to an LED topic that tells me if its off or on or 50% brightness.  MQTT broker does not store anything, it receives a message, it asks who is subscribing to these topics, and then sends it out to them. We are going to be looking at a BROKER called Mosquito. Later on in this class we’ll use AWS, it has IOT core, its also a broker setup. Lets say if we have a product getting messages from light switches we’d have AWS IOT CORE.


Please hit the buttons for project's GitHub, documentation and website. Details here too: http://bit.ly/itp-d2d-20

Key contributions
In this 7 week project: First we’ll did HTTP. Then well did MQTT Arudion with sensors, hook to core IoT which is mqtt broker, then we have rules, to dynamoDB etc. Then we got into databases: Among others we went into Timeseries databases, but mainly SQL-LITE/Postgress-SQL doesn’t enforce a lot of rules, its easy. We used AWS to run some stuff. It’s a good thing to learn. If you want to use Microsoft Azure or Google Cloud, that's great.
No items found.
Prototype • IoT • Environment • Arduino • AWS • Databases • MySQL

I built an IoT device, called Alexa Environment, which collects environment data from soil of a plant and sends it across the protocols to databases, and to AWS.

There is a GitHub repository with all the code.

Here's a brief write up of the project objective, technical summary and what the schema looked like: 

What is IoT?

Once you build something what do you do with connectivity and data.

Transport: Send data from the device to server.  Or phone ->server ->device.

Most of the problems fit into these 2 concepts.

Know how to use these tools and set a database up.
We’ll write some code in Javascript since it runs everywhere. May do some python.

On hardware side we use Arduino maker 1010. And environment shield that goes on the top of it. Can get from Equipment room for whole of the class.

Once we get Arduino to do something, we need to transport that data somewhere.  Like in semester 1, serial was a transport but that anchors a computer to the arduino. So for transport we have stuff like ethernet, wifi, blue tooth, custom radio stuff.

Simplest way to do this - this was 5 years ago:

Sensor -> Arduino -> serial -> computer

Things have gotten a lot easier now: server costs just a couple of months per month

Another way to do this:

Sensor-> arduino-> xbee/zigbee -> gateway -> server

Another way to do this is using Bluetooth LE (low energy).

Another way to do this is:

Sensor -> Arduino -> network (wifi, cellular LTE) -> server.

Wifi is what we’re going to use in this class to send data.

This class we will use Arduino MKR Family. Theres MKR GSM 1400 if there is no connectivity on internet. We will use MKR Wifi 1010 for the class.  Rob got them for class.

On the 1010 its stable. It tries to validate certificate change, so it knows you;’re connecting to a secure server since it has crypto chip. One of the things we’ll briefly talk about it securing it from sniffing.


They’re powered from 5.5 volt powered by usb. Cellular takes a lot of power so it got to be connected to main power. So if you need a project that is disconnected and runs on a battery, it should be done on MKR LoRa radio (Long Range). There is LoRA-wan that puts encryption on the top of that. LoRa is super low power - good for agriculture projects (you have to keep them sleeping a lot so they wake up send a signal and go back to sleep). LORA is pretty good if you need battery but Tradeoff is its super lowbandwith, less than a mb per day. Some Comcast (machine que) version has higher bandwidth. It’s easy to send data from LoRA to server, but its difficult to send it back to server (because its sleeping).

—————————————————

If w’re using wifi based board to send data we have these protocols:


  1. HTTP - We’ll do this. Sending Data via HTTP is pretty easy as long as you have the right libraries.  Sensor->Arduino-> HTTP-> Server
  2. CoAP - Particle.io boards for 19 bucks, its arduino like, ability to change code from browser. You can have a webhook (A process to move data from their (particles) server to your server. On my server Node.js receives json, parses it and…data stored. Then we can do some queries. We’re not going to do particle because its too easy and hides complexity
  3. MQTT - We’ll do this. Sensor -> Arduino <-Mqtt->Broker<->Client. In addition to be lightweight it gives us a serve path so its easier than HTTP. (CONVENTION: Location/device/sensor). Server is called Broker. When we are a client we can write to a topic and publish our data. Sometimes we will publish JSON, like {temperature: 73 humidity: 45} to environment. We can also subscribe to a topic. On that arduino I can subscribe to an LED topic that tells me if its off or on or 50% brightness.  MQTT broker does not store anything, it receives a message, it asks who is subscribing to these topics, and then sends it out to them. We are going to be looking at a BROKER called Mosquito. Later on in this class we’ll use AWS, it has IOT core, its also a broker setup. Lets say if we have a product getting messages from light switches we’d have AWS IOT CORE.


Please hit the buttons for project's GitHub, documentation and website. Details here too: http://bit.ly/itp-d2d-20