Lintang Wisesa
Published © GPL3+

ESP8266 NodeMCU & Antares IoT Platform

A simple IoT experiment, connecting a NodeMCU board to monitor a potentiometer and DHT11 via Antares IoT Platform.

BeginnerFull instructions provided1 hour2,108
ESP8266 NodeMCU & Antares IoT Platform

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Breadboard (generic)
Breadboard (generic)
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Jumper wires (generic)
Jumper wires (generic)
×8

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematics

Code

NodeMCU & Antares

C/C++
#include "AntaresESPHTTP.h"
#include "DHT.h"
#define DHTPIN D5
#define DHTTYPE DHT11
DHT dht(DHTPIN,DHTTYPE);

#define SERVER "http://platform.antares.id"
#define PORT "8080"
#define ACCESSKEY "your_antares_access_key"
#define WIFISSID "your_wifi_name"
#define PASSWORD "your_wifi_password"

String projectName = "your_antares_application_name";
String deviceName = "your_antares_device_name";

Antares antares(ACCESSKEY,SERVER,PORT);

void setup() {
    Serial.begin(115200);
    pinMode(D5,INPUT); 
    antares.setDebug(true);
    antares.wifiConnection(WIFISSID,PASSWORD);
}

void loop() {
  String suhu = String(dht.readTemperature());
  String lembab = String(dht.readHumidity());
  String pot = String(analogRead(A0));
  
  int sizeData = 3;
  String dataName[sizeData],dataValue[sizeData];
  dataName[0]= "Suhu";
  dataName[1]= "Lembab";
  dataName[2]= "Pot";

  dataValue[0]= suhu;
  dataValue[1]= lembab;
  dataValue[2]= pot;

  Serial.println(antares.storeData(projectName, deviceName, dataName, dataValue, sizeData));
  delay(10000);
} 

Credits

Lintang Wisesa

Lintang Wisesa

21 projects β€’ 91 followers
πŸ” Full Snack Develaper

Comments