Introduction

18th July, 2022 to 22th July, 2022

Google Assistant allows for remote control of Vigyan Ashram’s main gate from any location. When the water in that tank is drained, the gate closes because of the weight of the water on the side that opened it.

Objective

I’ve been tasked with fixing the gate’s aforementioned problems.

  • When we activate the open gate or close gate command, the electronic system of the main gate resets repeatedly.
  • The amount of time needed to open the is also excessive.

The previous circuit’s relay is directly connected to the V In pin, which I believe is causing a voltage drop in the ESP8266, which is connected to the power source of the mobile charger with 5V, causing the ESP to reset. According to datasheet, The ESP8266 can only power the equipment with 3.3 V with 200mA.

So I have used second power source to power the relay and it will isolate the relay circuit from ESP it will also remove back-EMF of pump from reaching to ESP

One relay requires approximately 5V and 68 mA of current in a 2-Channel Relay Module, but the ESP8266 is unable to provide 5V as an output voltage.

Testing of 2-Channel Relay Module Current Consumption
Existing Circuit Diagram
New Circuit Diagram

So to change the existing circuit we’ve purchased Electric board and assembled it.

Code

//Previously, an 18 W pump was used to open the gate, which pumps water at a very low speed. By switching to a 40 W pump, we were able to open the gate in 1 minute and 8 seconds, as opposed to the previous 2 minutes.

#include <ESP8266WiFi.h> #include "Adafruit_MQTT.h" #include "Adafruit_MQTT_Client.h" #define WLAN_SSID "" #define WLAN_PASS "" #define AIO_SERVER "io.adafruit.com" #define AIO_SERVERPORT 1883 #define AIO_USERNAME "VAGateControl" #define AIO_KEY "aio_ZCrs674uVZywEwF2q3JnUL9LINEe" // Assign output variables to GPIO pins const int water_pump_in = 13; //pin D7 const int water_pump_out = 14; // pin D5 int gate_state = 0; int timer = 0; WiFiClient client; // Create an ESP8266 WiFiClient class to connect to the MQTT server. Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY); // Setup the MQTT client class by passing in the WiFi client and MQTT server and login details. Adafruit_MQTT_Subscribe GATE_CONTROL = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME"/feeds/GATE_CONTROL"); void setup() { Serial.begin(115200); delay(10); //motor define pinMode(water_pump_in, OUTPUT); pinMode(water_pump_out, OUTPUT); digitalWrite(water_pump_in, HIGH); digitalWrite(water_pump_out, HIGH); Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(WLAN_SSID); WiFi.begin(WLAN_SSID, WLAN_PASS); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); mqtt.subscribe(&GATE_CONTROL); } void loop() { MQTT_connect(); Adafruit_MQTT_Subscribe *subscription; while ((subscription = mqtt.readSubscription(5000))) { if (subscription == &GATE_CONTROL) { Serial.print(F("Got: ")); Serial.println((char *)GATE_CONTROL.lastread); // Open gate if (!strcmp((char*) GATE_CONTROL.lastread, "ON") && gate_state == 0) { digitalWrite(water_pump_in, LOW); delay(110000); digitalWrite(water_pump_in, HIGH); gate_state = 1; Serial.println("Gate Open"); } else if (!strcmp((char*) GATE_CONTROL.lastread, "OFF") && gate_state == 1) { digitalWrite(water_pump_out, LOW); delay(125000); digitalWrite(water_pump_out, HIGH); gate_state = 0; Serial.println("Gate Close"); } } } } void MQTT_connect() { int8_t ret; // Stop if already connected. if (mqtt.connected()) { return; } Serial.print("Connecting to MQTT... "); uint8_t retries = 3; int cnt = 5; while ((ret = mqtt.connect()) != 0) { // connect will return 0 for connected Serial.println(mqtt.connectErrorString(ret)); Serial.println("Retrying MQTT connection in 5 seconds..."); mqtt.disconnect(); delay(5000); // wait 5 seconds /* retries--; // reset command if (retries == 0) { while (1); }*/ // basically die and wait for WDT to reset me // ESP.restart(); //Serial.println("Reset.."); //delay(1000); } Serial.println("MQTT Connected!"); }
Working of Gate System

25th July, 2022 to 30th July, 2022

For the Open House Exhibition I’ve been tasked with work of Explaining the Oxygen Concentrator so I have the following blog of Mr. Prathmesh Darwade and they also explaing me work flow of OXIKIT and I’ve successfully demonstrated OXIKIT on 29th and 30th July.

For the OXIKIT I’ve got some important comments as follows:

  1. How can we reduce the sound of solenoid valve as this is used for medical purpose.
  2. If we are gonna use this for around hour or so then the oxygen in that premises also gonna reduce so what is the remedy you’re gonna do to this OXIKIT.