IOT SYSTEM WITH Thinger.io PLATFORM, PART 2
IOT SYSTEM
Now is the time to create a complete system, where our doctor can both monitor the readings of a temperature sensor and also activate a switch on a ventilator or can control the amount of oxygen with a slidebar. All this via remote in some patient who doesn't have much mobility due to his/her illness or his/her disability and in this way the doctor can help us.
ADDING DEVICES
We open the main console and in the Devices section we click on the Add Device button.
As in the case of our post 11, we fill out our form as shown below:
We use the same data in our source code that we will upload to our Arduino NANO 33 IoT board: iot_system.ino
#define _DISABLE_TLS_
// other includes goes here
#include <ThingerWiFiNINA.h>
#define USERNAME "guillengap"
#define DEVICE_ID "IOT_SYSTEM_NANO_33_IOT"
#define DEVICE_CREDENTIAL "8kk1GqqbqsMJnsvV"
#define SSID "*********"
#define SSID_PASSWORD "************"
ThingerWiFiNINA thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
void setup() {
// configure wifi network
thing.add_wifi(SSID, SSID_PASSWORD);
pinMode(13, OUTPUT);
thing["led"] << digitalPin(13);
thing["led2"] << analogPin(12);
thing["temp"] >> outputValue(analogRead(A0));
}
void loop() {
thing.handle();
}
NOTES:
You can download the code here: iot_system.rar
Don't forget to include our SSID and our SSID PASSWORD.
The electrical diagram is shown below.
HOW DOES IT WORKS?
The LED diode connected to pin 13 is controlled remotely by means of a switch and using the Thinger.io platform.
The LED diode connected to PIN 12 is controlled remotely by means of a slider and using the Thinger.io platform.
The TMP36 temperature sensor is sampled and its readings are sent every 5 seconds to the remote iot Thinger.io server.
In the image below we believe that our system is working very well.
In the main menu, we also verify in the Devices section that our device "IOT_SYSTEM_NANO_33_IOT" is connected.
ADDING DASHBOARDS
Now we go to the Dashboards section and click on the Add Dashboard button and fill in the form as shown below.