Puffer
Published

BaNOz/Air, Water, and Surface Sterilizer device

Safe and portable air, water, and Surface sterilization using ozonation and ultraviolet for effectiveness in the virus inactivation process.

IntermediateShowcase (no instructions)662
BaNOz/Air, Water, and Surface Sterilizer device

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
MQ131 Sensor Ozon
×1
Digital Panel Meter, DC Voltage
Digital Panel Meter, DC Voltage
×1
Gravity: Digital 5A Relay Module
DFRobot Gravity: Digital 5A Relay Module
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Power Supply Switching 12V 3A
×1
Flow Sensor 3/8 inch
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Male/Male Jumper Wires
×1
Wemos D1 Mini
Espressif Wemos D1 Mini
×1
HC-06 Bluetooth Module
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Hi Blower P130
×1
Ozone Generator 3g/3000mg/hr
×1
ultraviolet 1 Gpm
×1
Air Pressure Gauge
×1
Switch LED Stainless Button ON/OFF
×1
Switch Actuator, Selector Switches
Switch Actuator, Selector Switches
×1
IRF840 Mosfet
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor 2
MIT App Inventor 2
Firebase
Google Firebase

Hand tools and fabrication machines

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

Story

Read more

Custom parts and enclosures

shape and appearance of the tool

Schematics

System Schematics

Code

Arduino Connection App

Arduino
#define Connect 7
float data1,data2,data3,data4;
unsigned long timeSend;
#include <DHT.h>
DHT dht(3, DHT11); //Pin, Jenis DHT
#include "MQ131.h"

//SENSOR DEBIT
int TURBINE;      //pengukuran SINYAL data yang bersifat incremental
int HSensor = 2; //nama alias pada pin 2
int Calc;
float totald;

void setup(){
 Serial.begin(115200);
 Serial.begin(9600);
 Serial1.begin(115200);
 Serial3.begin(115200);
 dht.begin();

   // Init the sensor
  // - Heater control on pin 2
  // - Sensor analog read on pin A0
  // - Model LOW_CONCENTRATION
  // - Load resistance RL of 1MOhms (1000000 Ohms)
  MQ131.begin(2,A0, LOW_CONCENTRATION, 1000000);

  Serial.println("Calibration in progress...");
  
  MQ131.calibrate();
  
  Serial.println("Calibration done!");
  Serial.print("R0 = ");
  Serial.print(MQ131.getR0());
  Serial.println(" Ohms");
  Serial.print("Time to heat = ");
  Serial.print(MQ131.getTimeToRead());
  Serial.println(" s");
}

void loop(){
 float kelembaban = dht.readHumidity();
 float suhu = dht.readTemperature();

//SENSOR DEBIT
TURBINE = 00; //data awal = 0
sei(); //perintah aktifnya mode interrupt
delay (1000); //nilai delay 1 detik
cli(); //perintah untuk matinya program interrupt
Calc = ((TURBINE * 60 / 7.5)/60); //Pulsa * 60 / 7.5 
totald += Calc;

 Serial.print(kelembaban);
 Serial.print("|");
 Serial.print(suhu);
 Serial.print("|");
 Serial.print(MQ131.getO3(UG_M3));
 Serial.print(" ug/m3");
 Serial.print("|");
 Serial.print(Calc, DEC);
 Serial.print(" L/min");
 Serial.print("|");
 Serial.print(totald/60);
 Serial.print(" L");

    //ke wmos
    data1 = MQ131.getO3(UG_M3),1;//Ozon
    data2 = suhu,1;//Suhu
    data3 = kelembaban, 1;//Kelembaban
    data4 = totald/60;//debit
}

Wemos Connection

Arduino
#include <ESP8266WiFi.h>
#define Connect D2
String apiKey = "S1TBBLPYKO374Y25"; //API KEY
const char* ssid = "RSHS"; //nama wifi
const char* password = "rshs2019"; //password wifi
const char* server = "api.thingspeak.com";
WiFiClient client;
String data1,data2,data3,data4;
void setup() {
  pinMode(Connect,OUTPUT);
  digitalWrite(Connect,LOW);
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  digitalWrite(Connect,HIGH);
}


void loop() {
  Receive();
  digitalWrite(Connect,HIGH);
  while (WiFi.status() != WL_CONNECTED) {
    digitalWrite(Connect,LOW);
    delay(500);
    Serial.print(".");
  }
}
void Receive(){
  if(Serial.available()>0){
    String data=Serial.readString();
    split_data(data);
  }
  if(kode=="data"){
    Serial.println(data1);
    Serial.println(data2);
    Serial.println(data3);
    Serial.println(data4);
    kirim_ke_thingspeak(data1,data2,data3,data4);
    kode="";
  }
}

void split_data(String myString) {
  int Index1, Index2, Index3, Index4, Index5, Index6, Index7, Index8;
  if (myString.length() > 0) {
    Index1 = myString.indexOf('|');
    Index2 = myString.indexOf('|', Index1 + 1);
    Index3 = myString.indexOf('|', Index2 + 1);
    Index4 = myString.indexOf('|', Index3 + 1);
    Index5 = myString.indexOf('|', Index4 + 1);
    Index6 = myString.indexOf('|', Index5 + 1);

    kode = myString.substring(Index1 + 1, Index2);
    data1 = myString.substring(Index2 + 1, Index3);
    data2 = myString.substring(Index3 + 1, Index4);
    data3 = myString.substring(Index4 + 1, Index5);
    data4 = myString.substring(Index5 + 1, Index6);
  }
}

void kirim_ke_thingspeak(String val1,String val2,String val3,String val4,String val5,String val6){
  if (client.connect(server, 80)) {
    String postStr = apiKey;
    postStr += "&field1=";postStr += val1;
    postStr += "&field2=";postStr += val2;
    postStr += "&field3=";postStr += val3;
    postStr += "&field4=";postStr += val4;
    postStr += "&field5=";postStr += val5;
    postStr += "&field6=";postStr += val6;
    postStr += "\r\n\r\n\r\n\r\n\r\n\r\n";
    client.print("POST /update HTTP/1.1\n");
    client.print("Host: api.thingspeak.com\n");
    client.print("Connection: close\n");
    client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
    client.print("Content-Type: application/x-www-form-urlencoded\n");
    client.print("Content-Length: ");
    client.print(postStr.length());
    client.print("\n\n");
    client.print(postStr);
  }
  client.stop();
}

Credits

Septian Suryo, S.Si., Apt.

Posted by Puffer

Comments