Rutvik PatelIshwariy joshiJay Prajapati
Created November 29, 2019 © GPL3+

Stormbreaker⚡

IoT node which can be fixed on any electricity/light pole which cuts off the power to the pole as soon as it detects that current is leaking

IntermediateFull instructions provided6 hours35

Things used in this project

Hardware components

ESP8266 ESP-01
Espressif ESP8266 ESP-01
×2
Azure Sphere MT3620 Starter Kit
Avnet Azure Sphere MT3620 Starter Kit
×1
lipo battery
×1
Buzzer
Buzzer
×1
LED (generic)
LED (generic)
×1
Relay (generic)
×1
Grove - Water Sensor
Seeed Grove - Water Sensor
Generic water sensor
×1
current sensor
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Cayenne
myDevices Cayenne
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering

Story

Read more

Schematics

Video explanation of the circuit

Code

ESP8266 data transfer to cayenne code

Arduino
//#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>


// WiFi network info.
char ssid[] = "speechbee";
char wifiPassword[] = "speechbee";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "f2bfbae0-e0b6-11e6-bac1-91ed518c84d3";
char password[] = "58b002da849db53ccd80ace55c2bab68fea0da4c";
char clientID[] = "91ffd540-43f2-11e9-86b5-4fe3d2557533";

void setup() {
  Serial.begin(115200);
  Cayenne.begin(username, password, clientID, ssid, wifiPassword);
  pinMode(A0, INPUT);
  pinMode(D2, INPUT);
  pinMode(D3, INPUT);

  pinMode(D0, OUTPUT);
  pinMode(D1, OUTPUT);
  pinMode(D5, OUTPUT);
}

int Rain;
int elec;
int align;
int power;
int alert;


void loop() {
  Cayenne.loop();
  Rain = analogRead(A0);
  elec = digitalRead(D2);
  align = digitalRead(D3);
  //Serial.println(elec);
}

CAYENNE_OUT(V2) {

  if ( Rain >= 200) {
    Cayenne.virtualWrite(V2, 1);
  }
  else if ( Rain <= 100) {
    Cayenne.virtualWrite(V2, 0);
  }

}


CAYENNE_OUT(V1) {

  if ( Rain >= 10) {
    Cayenne.virtualWrite(V1, 1);
  }
  else if ( Rain <= 5) {
    Cayenne.virtualWrite(V1, 0);
  }

}



CAYENNE_OUT(V3) {

  if ( elec == 1) {
    Cayenne.virtualWrite(V3, 1);
    Cayenne.virtualWrite(V5, 92.3);
    digitalWrite(D0, LOW);
    digitalWrite(D1, LOW);

  }
  else if ( elec == 0) {
    Cayenne.virtualWrite(V3, 0);
    Cayenne.virtualWrite(V5, 0);
    digitalWrite(D0, HIGH);
    digitalWrite(D1, HIGH);
  }

}


CAYENNE_OUT(V4) {

  if ( align == 1) {
    Cayenne.virtualWrite(V4, 0);
  }
  else if ( align == 0) {
    Cayenne.virtualWrite(V4, 60);
  }

}


//CAYENNE_OUT(V5) {
//
//  if ( elec == 1) {
//    Cayenne.virtualWrite(V5, 0);
//  }
//  else if ( elec == 0) {
//    Cayenne.virtualWrite(V5, 96.5);
//  }
//
//}



CAYENNE_IN(V6) {
  power = getValue.asInt();

  if (power == 1) {
    digitalWrite(D5, HIGH);
  }
  else if (power == 0) {
    digitalWrite(D5, LOW);
  }
}




CAYENNE_OUT(V7) {


    Cayenne.virtualWrite(V7, 76);

}





CAYENNE_IN(V8) {
  alert = getValue.asInt();

  if (alert == 0) {
    digitalWrite(D0, HIGH);
    digitalWrite(D1, HIGH);

  }
  else if (alert == 1) {
    digitalWrite(D0, LOW);
    digitalWrite(D1, LOW);


  }
}

Azure sphere(MT3620) code

Azure sphere code to ping the city command and control centre server whenever power to a pole is cut-off, i.e, Send a button-press event to Azure IoT Central or an Azure IoT Hub when you press button A on the MT3620 development board.

Credits

Rutvik Patel

Rutvik Patel

3 projects • 0 followers
Ishwariy joshi

Ishwariy joshi

0 projects • 0 followers
seek myself as a full stack project maker and a part stack tech news explorer,Currently pursuing Electronic and communication engineering.
Jay Prajapati

Jay Prajapati

1 project • 3 followers
IoT | Robotics | Automation | AI | Data Science | Industry 4.0 Mechanical Engineering Student at Birla Vishvakarma Mahavidyalaya

Comments