Hari
Published © Apache-2.0

ESP8266 Voltage Sensor With KiwisIoT Dashboard

Monitor voltage levels in real time using an ESP8266 voltage sensor and KiwisIoT dashboard. View voltage readings remotely over Wi-Fi

IntermediateFull instructions provided-1560 minutes23
ESP8266 Voltage Sensor With KiwisIoT Dashboard

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
Voltage Regulator Module
Digilent Voltage Regulator Module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE
KiwisIoT
Kiwistron KiwisIoT

Story

Read more

Schematics

vol_92iHE3jGx4.png

Code

ESP8266 Voltage Sensor With KiwisIoT Dashboard

C/C++
#include <KiwisIoT.h>

const char* ssid  = "YOUR_WIFI_NAME";
const char* pass  = "YOUR_WIFI_PASSWORD";
const char* topic = "YOUR_TOPIC_ID";

KiwisIoT kiwisiot(ssid, pass, topic);

#define VOLTAGE_PIN A0

// Example values only.
// Calibrate these for your board and voltage divider.
const float ADC_REFERENCE = 3.3;
const float ADC_MAX = 1023.0;
const float DIVIDER_RATIO = 5.0;

void setup() {
  Serial.begin(9600);
  kiwisiot.begin();
}

void loop() {
  kiwisiot.run();


  int sensorValue = analogRead(VOLTAGE_PIN);

  float measuredVoltage =
      (sensorValue / ADC_MAX) *
      ADC_REFERENCE *
      DIVIDER_RATIO;

  kiwisiot.send("1", measuredVoltage);

  Serial.print("Voltage = ");
  Serial.print(measuredVoltage, 2);
  Serial.println(" V");

  delay(1000);
}  

Credits

Hari
13 projects • 1 follower

Comments