Introduction

For several people, bedroom is the most comfortable place in the house. Many people use the bedroom for activity and working too. But, how if the bedroom has uncomfortable condition, like there’s a strong smell from cigarette or the temperature and humidity are not ideal. The room conditions should be maintained for creating ideal and healthy air quality.

Based on that problem, I try to make Smart Air Purifier and Diffuser with Intenet of Things technology, so it can connect to the internet and get access from the smartphone. How this device works by filtering air using High Efficiency Particulate Air (HEPA) Filter and scent the room by aromatherapy steam. The device can be placed on the table and work 24 hours for keeping the room conditions. Beside that, there is alert mechanism by turn on the buzzer if somoone open the door when I’m sleeping, it prevent from theft.

System Implementation

The device works on Direct Current (DC) so it’s required a AC-DC adaptor with 24V working voltage and also LM2596 regulator step down for power source for ESP32 and sensors. The device built using ESP32 as microcontroller, BME280 as humidity and temperature sensors, ambient light sensor as light intensity measurement, magnetic door switch for knowing the door open or not, load cell HX711 to measure the aromatheraphy water volume, a 24V DC fan and ultrasonic mist maker that can be controlled by PWM signal using MOSFET.

The Internet of Things support allows the device can be controlled and monitored using smartphone and browser. ESP32 is connected to the access point using WiFi and become a web server. The device uses HTTP REST for communication to host, and provides a simple API with GET method as follows

NoURLResponse TypeDescription
1http://192.168.1.254/Text/ HTMLOTA login form.
2.http://192.168.1.254/serverIndexText/HTMLOTA upload form.
3.http://192.168.1.254/uploadESP.restart()OTA upload binary file.
4.http://192.168.1.254/turnON?mode=param

Application/ JSONControl device mode by setting the param to low, normal, or high.
5.http://192.168.1.254/turnOFFText/PlainTurn off the fan and the mist maker, also set device mode to OFF.
6.http://192.168.1.254/room_conditionApplication/ JSONGet temperature, humidity, pressure, andabsolute altitiude.
7.http://192.168.1.254/switch_doorApplication/JSONGet door status opened or closed and last time door status changed.
8.http://192.168.1.254/device_modeApplication/JSONGet device mode.
9.http://192.168.1.254/alertApplication/JSONGet alert status true or false.
10.http://192.168.1.254/water_volumeApplication/JSONGet water volume (mL) of aromatheraphy.
11.http://192.168.1.254/ldrApplication/JSONGet lux from ambient light sensor.
Available API List

In general, the hardware architecture of the Smart Air Purifier and Diffuser can be seen in the image below

The Internet of Things technology architecture used can be seen in the image below

I will continue to update and improve the device as I’m still working on it. I’ll try to add PID control to the system. Hope it works well.

Loading