Apps and online services

About this project

About This Project

Hey!! I'm Neoxelox and I will show you the "Sensometer", a great example of IoT! This project has 22+ sensors; "+" because I have more sensors coming! :) Also it has an IR Emitter, so I can pull Up/Down/Stop my blinds (yes my blinds have IR ). The project is powered by two Arduinos: Mega and MKR100. The Mega reads the sensors data and via Serial transmits it to MKR1000, who is responsible for uploading it to the Cayenne cloud. This is also a practical way to test how Arduino Mega and Cayenne Dashboard behave with lots of data and sensors. As I want to make it portable, I will make a connection between the gas sensors and some NPN transistors to control when the sensors are ON or OFF if they are not used, because they consume a lot of power.

NOTE: This project is not finished, because I cannot finish it in time for the contest since I didn't receive all the sensors yet. So it's missing a project box and a screen for visualize data without internet. So, yes it will look very ugly and very messy.

Sensors and Their Uses

Sensors (RIGHT NOW):

[DS3231 | RTC] : Controls time. It is more focused on the screen that I will add in the Future.

[KY-039 | Pulse Sensor] : Reads pulse/beats. It is always important to monitor your pulse! (in the future it will also have an oxymeter)

[HC-SR04 | Ultrasonic Sensor] : Reads distance (and in the future the speed). It is VERY useful, really, I mean you can know instantly retrieve the distance between two objects! And it has a margin of error of 2 mm.

[KY-015 | DHT11] : Reads temperature and humidity. A good IoT project has a temperature and humidity sensor.

[GY-91 | BMP280/MPU9250] : Reads altitude and pressure (and in the future I will also control the magnetic compass, as well as the accelerometer). The same as before! The altitude is an extra but it is also useful.

[PHOTORESISTOR] : Reads illuminance (lux). It is good to know the illuminance to protect ourselves of sunburns!

[KY-024 | Magnetic Field] : Reads magnetic fields (Gauss, not Teslas - because it's too big). It is proven that certain magnetic fields don't allow us to sleep correctly, so it is good to know if there is a field above our bed.

[UVM 30A | UltraViolet] : Reads ultraviolet radiation (UV Index). It is very important to know the UV Index (0 - +11) for our health. If something returns a high value, it can cause severe damage to our skin, like cancer.

[HXJ-17 | Sound Sensor] : Reads sound (Db). This is useful, for instance, if you can't sleep because of your neighbor, you can know if he/she screams loud enough to report him/her.

[KY-022 | IR RECEIVER] : Reads IR (and in the future it will also have an analog read for IR radiation of Sun). It is useful for connecting your remote control, so that you can control your device.

[EMF SENSOR] : Reads electromagnetic fields (I don't know the unit). It is also proven that changes in electromagnetic fields can produce devastating effects on us,; it can cause severe illness and weakness, so it is good to know the strength of the field.

[TCS3200 | Color Sensor] : Reads colors (RGB). Why? Why not! (Now I don't have to take a picture and then go to paint to know RGB color value.)

[KY-005 | IR EMITTER] : Makes my blinds go Up/Down or Stop. I can automate it with Cayenne triggers. If the UV Index or illuminance of the Sun (and in the future, the IR Radiation) is high, my blinds can go down.

[MQ8] : Reads hydrogen gasses. They are colorless and don't smell, but they are so explosive!

[MQ9] : Reads CO gasses. Like hydrogen, they are colorless and they don't smell, but they are EXTREMELY dangerous; they can kill you in seconds.

[MQ2] : Reads fuel gasses. I have a gas boiler and it is good to know if there were ever any leak.

[MQ135] : Reads air quality / CO2 gasses. It is good to know the quality of the air you breathe.

What's Connected

The project has two Arduino Boards. It combines the power of Arduino Mega and the connectivity of Arduino MKR1000. They are connected to each other through serial communication. The Arduino Mega is responsible of reading all the sensors, and controlling my blinds, whereas the Arduino MKR1000 is responsible for reading the data of the Mega and uploading it to Cayenne Cloud (in the future this board will also control a screen and a couple of speakers, so with a button from Cayenne Dashboard I could listen to my favorite track).

Triggers & Alerts

This project has (right now) two Triggers, but I could easily put 22 triggers/alerts for every sensor.

UV Index: It pulls my blinds down when there are high levels of UV Index

Illuminance of Sun: It also pull my blinds down when there is high illuminance (yes, I know UV Index and illumicance of the Sun are proportional, but this is just in case the UV sensor fails; I don't want a sunburn).

Scheduling

As of right now I only have one actuator (I mean my blinds), the project has only one schedule action: Everyday at 6:45 a.m. (yes, I have to get up at that hour), the blinds pull up automatically, so I can get up.

Dashboard Screenshots

A pretty messy Dashboard.

The gauges seems to be a little bugged.

Photos of the Project

Data of Arduino Mega (it seems very messy and it actually is, but it is because debug mode was set to True; but this is not the way data transmit it to the Arduino MKR1000):

Arduino Mega:

Arduino MKR1000 (I just realized that in this photo it is not connected):

The project (as I said, I know it looks ugly but I didn't finish it yet): The cable without the cover is the antenna for the EMF sensor.

Video

Code

Arduino MKR1000Arduino

//#define CAYENNE_DEBUG // Uncomment to show debug messages#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space#include<CayenneMKR1000.h>// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.chartoken[]="**********";// Your network name and password.charssid[]="********";charpassword[]="*****";voidsetup(){Serial.begin(9600);Cayenne.begin(token,ssid,password);}voidloop(){Cayenne.run();Serial.println("8");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V23,Serial.read());}Serial.println("9");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V17,Serial.read());}Serial.println("11");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V20,Serial.read());}Serial.println("12");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V21,Serial.read());}Serial.println("13");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V19,Serial.read());}Serial.println("14");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V18,Serial.read());}Serial.println("15");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V22,Serial.read());}Serial.println("16");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V15,Serial.read());}Serial.println("17");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V16,Serial.read());}Serial.println("18");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V11,Serial.read());}Serial.println("19");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V14,Serial.read());}Serial.println("20");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V24,Serial.read());}Serial.println("21");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V5,Serial.read());Cayenne.virtualWrite(V6,Serial.read());Cayenne.virtualWrite(V7,Serial.read());}Serial.println("25");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V0,Serial.read());}Serial.println("26");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V1,Serial.read());}Serial.println("27");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V2,Serial.read());}Serial.println("28");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V3,Serial.read());}Serial.println("29");delay(250);if(Serial.available()>0){Cayenne.virtualWrite(V4,Serial.read());}}CAYENNE_IN(V8){intvalue=getValue.asInt();if(value==1){Serial.println("22");}}CAYENNE_IN(V9){intvalue=getValue.asInt();if(value==1){Serial.println("23");}}CAYENNE_IN(V10){intvalue=getValue.asInt();if(value==1){Serial.println("24");}}