Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
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,131
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
21 projects • 93 followers
šŸ” Full Snack Develaper
Contact

Comments

Please log in or sign up to comment.