India Automation Challenge 2021
OR
About Vayu: A customizable smart air coolers/conditioners controller with IoT integration lets the manufacturers get a room for their production of the coolers from building the control unit. In the upcoming days, it is expected that most of our electronic devices will be connected thus leading to the sustainability of this unit. Working Principle: The controller is an advanced PI-type controller with anti-windup for self-controlling and adapting. The PID calculations are made at 0.1Hz, this slow rate is okay since the temperature is a sluggish changing variable. The motor control is a phase angle control for smooth dimming and variable AC drive of the motor. Firstly, it looks for an input command from the WiFi, if something new is in the buffer, it reads it and changes its setpoint. Else it goes with the previously set setpoint. Then it calculates the PI value needed for the delay time of the phase angle control, then it drives the motor with Triac, three Triac are parallelly placed for the high current drive of the motor. This phase angle control is also done by the same microcontroller by detecting the zero cross, so there is an interrupt occurring when the microcontroller is not in deep sleep mode, when it wakes up (every 10s) it calculates the PI value and with that, the interrupt mask is set and loops with the drive power of the motor, thus driving the motor with the desired speed. After setting the speed, the microcontroller again goes to sleep mode, and this cycle repeats. Tech used: PI control for setting the power of the compressor fan. The drive of the fan is obtained by phase angle control by zero-cross detection. And we made the PCB in EasyEda.
Esp12 wifi, BT16 triac, MOC3021 zero cross triac driver opto-isolator, TNY284DG flyback converter IC, MP2307 buck regulator IC, passive complementary components, screw terminals, PCBs
Arduino IDE, EasyEda, TI's Webench power Supply Design
First things first for the circuit, we used Esp12 for the MCU along with WiFi connectivity, its pretty cheap and reliable with high performance. Flyback power converter ICs for power supply to the Controller circuit, Triac to drive AC motor, Zero Cross detector for phase angle control of the AC motors, Screw terminals for plug and play. For software we used EasyEda for the PCB design, For writing the Firmware we used ArduinoIDE.
The circuit consists of a power converter side, that reduces the HVAC to useable regulated low voltage DC so that it can power the soft electronics, next section is the main control unit(MCU) which is responsible for controlling the whole unit, from interfacing the sensors to generating signals to drive the AC motors. A small temperature and humidity sensor is attached to the ESP12. For the driving circuit it consists of 3 triacs so that heavy motors can also be driven trough it. And Optocoupler, one for driving the triac, and another for detecting the zero cross of the HVAC.
#define kp -1 //tune according to needs #include <Adafruit_AHTX0.h> extern os_timer_t *timer_list; const char* ssid = "Vayu"; String server = "http://"; //set according to the server val Adafruit_AHTX0 aht; WiFi.begin(ssid, password); PCICR |= (1 << PCIE0); pinMode(15,OUTPUT); double error=0, terror=0, dtemp=0; void loop() if(WiFi.status()== WL_CONNECTED){ http.begin(client, server.c_str()); PCMSK0 ^= (1 << PCINT0); } void pidcalc() void fpm_wakup_cb_func(void) ISR(PCINT0_vect){
#define ki -1 //tune according to needs
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include "user_interface.h"
timer_list = nullptr;
const char* password = "1234";
boolean flag = false;
void setup()
{
Serial.println("Connecting");
while(WiFi.status() != WL_CONNECTED) {}
PCMSK0 |= (1 << PCINT0);
wifi_fpm_set_wakeup_cb(fpm_wakup_cb_func);
wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
wifi_fpm_open();
Serial.begin(115200);
aht.begin();
}
double pid[100];
{
sensors_event_t humidity, temp;
WiFiClient client;
HTTPClient http;
drive();
wifi_fpm_do_sleep(10000 * 1000);
{
if(http.GET()>0)
temp=http.getString().toFloat;
for(int i=0;i<100;i++)
{
aht.getEvent(&humidity, &temp);
error = dtemp-temp.temperature;
pid[i] = kp*error + ki*terror;
terror+=error;
}
}
void drive()
{
if(flag)
for(int i=0;i<100;i++)
for(float z=0.0;z<pid[i];z+=0.5)
{
digitalWrite(15, 0);
delayMicroseconds(z);
digitalWrite(15, 1);
delayMicroseconds(z);
digitalWrite(15, 0);
}
}
{
PCMSK0 ^= (1 << PCINT0);
pidcalc();
}
if(PINB & B00000001){
if(last_CH1_state == 0){
flag = true;
}
}
else if(last_CH1_state == 1){
flag = false;
last_CH1_state = 0;
}
}