BACKGROUND
This tutorial will explain how to mist or humidify one’s surroundings as a response to an environmental trigger using the Arduino Uno in connection with Grove’s Water Atomizer.
This tutorial is the fourth in the series of tutorials corresponding to the ‘Philly Air Mist’ project completed in the Sensing the City course taught by Allison Lassiter for students in University of Pennsylvania’s Department of City and Regional Planning. In this project, the water atomizer is triggered to produce mist as a response to high air pollution levels detected by a MQ135 air quality sensor.
LIST OF PARTS & SPECIFICATIONS
EXTERNAL Parts:
- Grove Water Atomization Module consisting of :
- a Driver Board,
- a JST Connection Wire, and
- an Ultrasonic Transducer Plate
- Grove Base Shield v2
- MQ 135 Air Quality Sensor
Parts INCLUDED IN KIT:
- Arduino Uno
- Breadboard
- Jumper Wires
- 220Ω resistor
- 9V Battery
SENSOR SPECIFICATIONS:
Grove Water Atomization Module: The ultrasonic atomizer works by using the high-frequency mechanical oscillation of a piezoelectric transducer plate to convert the water particles into tiny droplets. As the frequency of oscillation is higher, the converted droplets are finer. The water droplets are then guided into the air with an inbuilt blower.
Grove Base Shield v2: The Grove Base Shield provides a simple way to connect with Arduino boards in place of the breadboard and jumper wires. It has 16 on-board connectors, with JST connections. The pinout of Base Shield V2 is the same as Arduino Uno R3, therefore the base shield can easily be mounted on top of the Arduino.
MQ 135 Sensor: The MQ-135 sensor belongs to a family of air quality sensors called the MQ series. The MQ-135 sensor is used to detect gases such as NH3,NOx, alcohol, Benzene, smoke, and CO2 ,among others. As these gases come close to the sensor, their particles are ionized and absorbed by the sensor because of a heating current that is generated. This change affects the resistance of the sensor, in turn changing the value of the current leaving it.
CIRCUIT DIAGRAM
WIRING STEPs:
1. Set up the Grove base shield: Position the Grove base shield v2 over the Arduino Uno so that the pins are aligned. Mount it on top of the Arduino Uno board.
2. Atomizer Module Connections: The atomizer module uses JST connections which use female to female connections in place of jumper wires which offer male to male connections. Connect the humidifier disk to the ‘Output’ end of the atomizer module’s driver board. Use the JST wire given in the atomizer kit to connect the other end of the driver board to the base shield mounted on top of the Arduino Uno. In this case, the driver is connected to analog pin A3 on the base shield
3. MQ 135 Sensor Connections: Mount the MQ135 sensor on top of the breadboard. Connect the analog output of the sensor (AO) to analog pin A0 of the Arduino. Connect the digital output of the sensor (DO) to digital pin 2 of the Arduino. Connect the VCC end of the sensor to the 5V source. Connect the ground pin of the sensor to a 220Ω resistor and then to the ground pin of the Arduino Uno.
4. Setting up: Take the circular ultrasonic disk of the humidifier and place it inside a water tray so that it floats. Ensure that the concave side of the disk touches the water.
5. Connect the Arduino Uno to your computer or a power source and run the code below.
CODE
Step 1: The MQ135 sensor needs calibration before using the module. This involves setting a baseline value of R0 (sensor resistance in 1000ppm concentration of LPG) by calculating Rs (Internal resistance of the sensor which changes by gas concentration). Run the following code for 15 minutes in clean air before the first use until R0 has a fixed value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
void setup() { Serial.begin(9600); } void loop() { float sensor_volt; float RS_air; // Rs in clean air float R0; // R0 in 1000 ppm LPG float sensorValue; //Average for(int x = 0 ; x < 100 ; x++) { sensorValue = sensorValue + analogRead(A0); } sensorValue = sensorValue/100.0; //-----------------------------------------------/ sensor_volt = (sensorValue/1024)*5.0; RS_air = (5.0-sensor_volt)/sensor_volt; // Depend on RL on yor module R0 = RS_air/9.9; // According to MQ9 datasheet table Serial.print("sensor_volt = "); Serial.print(sensor_volt); Serial.println("V"); Serial.print("R0 = "); Serial.println(R0); delay(1000); } |
Step 2: Run the following code to trigger the atomizer to produce mist when readings from the air quality sensor crosses a pre-defined threshold value.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
/* MITIGATING AIR POLLUTION USING A WATER ATOMIZER Roshini Ganesh CPLN 5710 Sensing the City / Weitzman School of Design 18 April 2023 This sketch is used to trigger the GROVE Water Atomization module to produce mist in response to high air pollution levels detected by a MQ135 air quality sensor. As pollution levels cross a particular established threshold, the atomizer is activated. A series of high frequency oscillations cause the vibration of the atomizer, converting water to fine droplets which is blown upwards as a mist from the atomizer. This code is derived from Seeduino's 'Grove-Water Atomization demo' as well as microcontroller.com's explainer on 'Interfacing of MQ135 Gas Sensor with Arduino'. Preliminary Step: Before running the code, ensure that the circular disk of the atomizer is placed inside a water tray with its concave side down and in a manner that allows the disk to float. */ const int DO = 2; //initialize digital output pin for the MQ135 sensor // setup code here, to run once: void setup() { Serial.begin(9600); pinMode(A3, OUTPUT); //initialize analog pin as output for the water atomizer pinMode(DO, INPUT); //initialize analog pin as input from the MQ 135 sensor } // main code, to run repeatedly: void loop() { //Step 1: Calculating Air Quality int trigger = 0; //binary integer value to trigger water atomizer float sensor_volt; //float value to calculate air quality float RS_gas; //float value to calculate air quality float ratio; //float value to calculate air quality float R0 = 0.91; //-Replace the name "R0" with the value of R0 in the demo of First Test - 0.91 in this case int sensorValue = analogRead(A0); // read input from air quality sensor sensor_volt = ((float)sensorValue / 1024) * 5.0; //Calculate air quality RS_gas = (5.0 - sensor_volt) / sensor_volt; //Calculate air quality ratio = RS_gas / R0; //Calculate air quality //Step 2: Triggering Atomizer based on observed air quality trigger = digitalRead(DO); if (trigger == 1) && (sensorValue > 400) //trigger atomizer for air pollution values above the threshold of 400 { digitalWrite(A3, HIGH); //switch on the atomizer } else if (trigger == 0) //atomizer is not triggered { digitalWrite(A3, LOW); //switch off the atomizer } delay(30000); //wait for 30s before taking the next reading } |
Thus, the water atomizer can be used as a mitigating device when poor air quality is recorded. The atomizer can also be used with a variety of other sensors including temperature and humidity sensors to monitor environmental quality and produce mist to function as an indoor humidifier, as a scent emitter, and as a warning system accompanying smart home setups among many others.