Things used in this project

Hardware components:
Esp01
Everything ESP ESP8266 ESP-01
×1
INA219 - Current sensor
×1
OLED display
×1
AMS1117 - 3,3V
×1
Panasonic eca 1hm221
Capacitor 220 µF
×1
Screw terminal connector
×1
DIN Rail Mounted Plastic Box
×1
Software apps and online services:
Ide web
Arduino IDE
Cayenne logo hi
Cayenne
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)

Schematics

Schematics
Snimek obrazovky (52) cf0p9kjrhb

Code

CodeArduino
#include <Wire.h>
#include <Adafruit_INA219.h>
Adafruit_INA219 ina219;
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

float shuntvoltage = 0;
float busvoltage = 0;
float current_mA = 0;
float current_A = 0;
float loadvoltage = 0;
float power_W = 0;
       
#define CAYENNE_PRINT Serial  
#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"


char token[] = "token";
char ssid[] = "ssid";
char password[] = "password";


void setup()
{
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
  
  Wire.begin(2, 0); // SDA, SDL
  uint32_t currentFrequency;
  ina219.begin();
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}

void loop()
{
  Cayenne.run();
  
  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  loadvoltage = busvoltage + (shuntvoltage / 1000);
  current_A = current_mA / 1000;
  power_W = current_A * loadvoltage; 
  
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.setCursor(0, 0);  
  display.println(loadvoltage);
  display.setCursor(45, 0);
  display.println("V");
  display.setCursor(0, 10);  
  display.println(current_A);    
  display.setCursor(45, 10);
  display.println("A");
  display.setCursor(0, 20);  
  display.println(power_W);    
  display.setCursor(45, 20);
  display.println("W");
  display.display();
  
}


CAYENNE_OUT(V0)
{
  Cayenne.virtualWrite(V0, loadvoltage);
}

CAYENNE_OUT(V1)
{
  Cayenne.virtualWrite(V1, current_A);
}

CAYENNE_OUT(V2)
{
  Cayenne.virtualWrite(V2, power_W);
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

WiFi Messenger
Intermediate
  • 408
  • 8

Protip

Calling my son from his room using 2 ESP8266 modules, instead of shouting.

Smart Garden
Intermediate
  • 1,013
  • 11

Smart Garden is plant environmental monitoring system.

WiDC: Wi-Fi-Controlled FPV Robot
Intermediate
  • 5,107
  • 32

Full instructions

What about using a Wi-Fi remote-controlled robot for exploring your surroundings, reaching inaccessible places, spying and take pictures?

IoT Thermometer Using Python
Intermediate
  • 310
  • 3

Full instructions

How to develop a simple, but powerful, IoT thermometer using a Zerynth-powered single-board MCU and the Zerynth App.

Counting Pulses with Maxim DS1682
Intermediate
  • 66
  • 2

Protip

This project is interfacing the Energy Monitoring system with a pulse counter.

IoT-Based Healthcare
Intermediate
  • 485
  • 16

Full instructions

It is about a wearable device which senses temperature and heart beat and sends it to mobile app or web app. Patient monitoring or self use.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Feedback