Finding the right air purifier

Finally I concluded that my best bet was to get an air purifier that can be remote controlled, and then use an IR blaster to control it. After searching and comparing models, I ended up buying the Hoover Air Purifier 600 for $120. It was big enough to handle my room, uses HEPA filters, automatic fan speed, includes a remote control, and has good Amazon reviews.
Building the IR blaster
One mistake I did was solder the IR diode right onto the board. If I could go back I would make it long enough so that I can bend it in different directions. After soldering the IR Kit together, I soldered a wire from the VCC pad to the 3v3 pin on the RPi. Another wire from the CTL pad to GPIO pin 22. And then the last wire from the GND pad to any GND pin. The following image will help show the pin layout:
Setting up LIRC
sudo apt-get install lirc
Next we will edit the file
/boot/config.txt
and add in the following line at the very end:dtoverlay=lirc-rpi,gpio_out_pin=22
I used my HP MCE Tranceiver in order to record the control keys from the air purifier. The configuration below should be placed in
/etc/lirc/lircd.conf :
# # To find out how to get a proper configuration file please read: # # /usr/share/doc/lirc/README.Debian begin remote name hoover bits 16 flags SPACE_ENC|CONST_LENGTH eps 30 aeps 100 header 9434 4662 one 600 1773 zero 600 606 ptrail 586 repeat 9402 2341 pre_data_bits 16 pre_data 0x42BD gap 111626 toggle_bit_mask 0x0 begin codes KEY_POWER 0x50AF KEY_SPEED 0x10EF KEY_TIME 0xB04F KEY_T 0x42BD609F end codes end remote
The file
/etc/lirc/hardware.conf
should look like so:# /etc/lirc/hardware.conf # # Arguments which will be used when launching lircd LIRCD_ARGS="" #Don't start lircmd even if there seems to be a good config file #START_LIRCMD=false #Don't start irexec, even if a good config file seems to exist. #START_IREXEC=false #Try to load appropriate kernel modules LOAD_MODULES=true # Run "lircd --driver=help" for a list of supported drivers. DRIVER="default" # usually /dev/lirc0 is the correct setting for systems using udev DEVICE="/dev/lirc0" #MODULES="lirc_dev mceusb" MODULES="lirc_rpi" # Default configuration files for your hardware if any LIRCD_CONF="" LIRCMD_CONF=""
Make sure lirc is started with
sudo service lirc start
. You can test to see if it works by using a digital camera pointing at the IR diode and notice it blinks with the command irsend SEND_ONCE hoover "KEY_POWER"
. Note that your cellphone camera may NOT capture the IR blinking. My iPhone 6 did not.Not working?
# Enable pin 22 echo "22" > /sys/class/gpio/export # Set direction to out echo "out" > /sys/class/gpio/gpio22/direction # Set value to one echo "1" > /sys/class/gpio/gpio22/value
If it is still not on, I would use a multimeter to check that 3.3V is reaching the board. Use the AC mode of the multimeter to check the voltage spiking when sending commands to the CTL pin. Also, you can short the VCC and CTL pins together to turn on the diode and verify you soldered the board correctly. If it still does not work, check that you put the diode in the right direction and the transistor is inserted correctly.
Bash script with Dropbox
After having the hardware working and configured on the Raspberry Pi, we now need to create a script that can be run every 5 minutes with a cron job. This script will scan a Dropbox directory for a file that will tell it to either turn on or off.
There is a Dropbox script called Dropbox Uploader available on Github thanks to Andrea Fabrizi. Download the file
Next you will download the script I created in the /opt directory as well, available on my Github. With your /opt directory having both files, remember to make them executable with the
My script can be called with on or off as arguments to control the air purifier. If you do not pass any arguments to it, it will look for the files called air_purifier_on.txt or air_purifier_off.txt to also turn the air purifier on or off respectively inside the directory called Home_Automation. My script also turns off the UV light and sets the fan speed to automatic. I turn off the UV light because the bright blue LED on top to show the UV light is powered happens to bother me while I sleep. You can remove that line from my script if you wish. I mapped the UV control key to KEY_T.
Now we will set the cron job to run my script every 5 minutes with the command
The first line sets the PATH to /opt so that our scripts can be found. The second line moves you to the home directory /home/pi, then it executes my script which will first call the Dropbox script to sync the Home_Automation folder and then check to see if the unique files are in there before deleting them. Then it transfer any text output to the file
dropbox_uploader.sh
in your /opt directory:sudo wget https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh -O /opt/dropbox
Next you will download the script I created in the /opt directory as well, available on my Github. With your /opt directory having both files, remember to make them executable with the
chmod +x FILE_NAME
command. When you first execute the script sh /opt/dropbox
it will run through the steps you need to connect it to your Dropbox account. I decided to make a directory called Home_Automation in my home directory /home/pi/
that will by used for syncing. You can edit my script air_purifier.sh to change the directory name and what the files will be called.My script can be called with on or off as arguments to control the air purifier. If you do not pass any arguments to it, it will look for the files called air_purifier_on.txt or air_purifier_off.txt to also turn the air purifier on or off respectively inside the directory called Home_Automation. My script also turns off the UV light and sets the fan speed to automatic. I turn off the UV light because the bright blue LED on top to show the UV light is powered happens to bother me while I sleep. You can remove that line from my script if you wish. I mapped the UV control key to KEY_T.
Now we will set the cron job to run my script every 5 minutes with the command
crontab -e
and the following two lines:PATH=/opt:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
*/5 * * * * cd /home/pi && sh /opt/air_purifier.sh >> /var/log/automation.log 2>&1
The first line sets the PATH to /opt so that our scripts can be found. The second line moves you to the home directory /home/pi, then it executes my script which will first call the Dropbox script to sync the Home_Automation folder and then check to see if the unique files are in there before deleting them. Then it transfer any text output to the file
/var/log/automation.log
Dropbox with IFTTT

If you have not heard of IFTTT, it stands for "IF This Then That", which allows the communication of different kinds of home automation products. I created one recipe to create the file
And that was it! Now my Hoover air purifier automatically turns on and off. It looks kind of hacky, but it is hiding underneath my bed with direct line of sight to the air purifier in front of my bed. If you want to make it even cleaner, you can buy an IR repeater and sneak the long wired IR diode to anywhere you want. Just make sure it points directly to the front of the air purifier.
I also created a php file on my web server that I can call in order to toggle the air purifier. The code is pretty simple:
air_purifier_on
at 10:00pm, and then a file called air_purifier_off
at 7:30am inside the Dropbox directory /Apps/RaspberryPi_dp/Home_Automation
. This is assuming when you ran the Dropbox script for the first time, and followed the instructions, you set it to use its own app directory called Home_Automation.And that was it! Now my Hoover air purifier automatically turns on and off. It looks kind of hacky, but it is hiding underneath my bed with direct line of sight to the air purifier in front of my bed. If you want to make it even cleaner, you can buy an IR repeater and sneak the long wired IR diode to anywhere you want. Just make sure it points directly to the front of the air purifier.
Update
So I kept getting this anxiety that I might be sitting on the side of my bed blocking the IR blaster and the air purifier would not turn on. I had an IR repeater that was broken, so I decided to rip the diode cable and just solder it onto where the current diode is on the board (in parallel). Then I placed the diode in the corner of my bed discretely and I am much happier with its professional look compared to a circuit board taped to the side of my bed.
I also created a php file on my web server that I can call in order to toggle the air purifier. The code is pretty simple:
<?php $pass = $_GET['pass']; if($pass != 'my_super_secret_pass') { header('Location: http://www.google.com/'); } else { $output=shell_exec("ssh pi@192.168.1.10 '/opt/air_purifier.sh on'"); echo "<script>window.close();</script>"; } ?>
All this does is grab the password from the address argument. If it is correct, it will ssh into my RPi and execute my script to turn the air purifier on and then close the page window/tab. If the password is wrong, it will redirect you to Google. The reason for the SSH part is because my web server is on a different machine from my RPi. In order to make the SSH smooth, I also made sure to transfer my RSA keys. If you are hosting your web server on the RPi as well, you can remove the SSH part.
Next I have Launcher which I use to have shortcuts on my Notification Center. I added a new Web Launcher which would go to https://mywebsite.com/home_automation/air_purifier_toggle.php?pass=my_super_secret_pass and use the Hoover logo. Now I can easily press a button on my iPhone or iPad to turn on the air purifier if I need to. And just in case, I made my script send KEY_TIME once in order to place a one hour timer by default since I cannot know if the air purifier is on by accident.
I am using logitech harmony hub to have same solution as yours. a bit more expansive (not much if you buy second hand one), but easier for end user like me. just need to teach the harmony hub and trigger via ifttt
ReplyDeleteGreat Article Cloud Computing Projects
DeleteNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
ReplyDeleteThis article is very much helpful and i hope this will be an useful information for the needed one. Keep on updating these kinds of informative things...
Home Automation in Chennai
smart home in Chennai
Home security in Chennai
Burglar alarm in Chennai
Door sensors Chennai
You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. cancello scorrevole fai da te
ReplyDeleteCoway AP-1512HH Air Purifier. Similarly as with most air purifiers, the Coway AP-1512HH is structured with the particular motivation behind disposing of allergens a coway ap-1512hh filter
ReplyDeleteNowadays it is really important to get connected with clients and keep them in their touch. Moreover, providing proper information on time to increase brand value. Mobile texting service USA may help your business to engage with your clients by sending texts.
ReplyDeleteExcellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. Best air purifier under 10,000 rupees in India
ReplyDeletethe Commission did highlight that ozone also enters into human dwellings from outdoor air, the so-called ambient air. This may elevate the actual ozone concentration above 50 ppb when an air purifier is being operated. Strangely again, there is no legislation in the US Consumer Safety Products Act about the 50 ppb ozone limit. best air purifier under 20000
ReplyDeleteThanks for the valuable information and insights you have so provided here.
ReplyDelete192.168.l.l
192.168 l 254
192.168.0.1
Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign. cheap sandblaster
ReplyDeleteOne of the top wellbeing concerns incorporates indoor air contaminations. Utilizing an entire house air purifier is one approach to address the issue of indoor air poisons.air filter
ReplyDeleteThese electrical home appliances have formed the mainstay of our lives and it would not be out of place that our lives revolve around these home appliances since they tend to help us in our daily chores thereby saving both time and energy.Washer Repair in Los Angeles
ReplyDeleteFind out about air purifiers and locate a protected, compelling unit that is directly for your needs with this air purifier purchasing guide. dehumidifier price in india
ReplyDeleteAnother significant factor to think about when performing upkeep on your air conditioner is cleaning or potentially supplanting air channels.Airco installatie
ReplyDeleteOur services are available in all cities of Minneapolis and its surroundings. We are having years of experience which enabled our customers and clients to trust our services. best washing machine in India
ReplyDeleteIt is additionally a decent advance to take when you face an issues with your AC repair, you don't depend entirely on specialist, rather you put your push to look through the tips and ask anybody master right now handle this sort of issue without anyone else. Airco Limburg
ReplyDeleteVery interesting and informative post, thanks for your hard work and keep going. Compare air purifier rates, specifications, review and ratings.
ReplyDeleteThis particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform! Air Conditioner Installation Toronto
ReplyDeleteI am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. automazioni per cancelli scorrevoli
ReplyDeleteGreat survey, I'm sure you're getting a great response. Best HVAC Oshawa
ReplyDeleteWindow units. Great for small room spaces. They come in different unit sizes according to the size of your room. Air Conditioner Installation Toronto
ReplyDeleteCentral air. This type of HVAC can be expensive but in the long run it's the favorite for overall temperature regulation and comfort level. Many potential home buyers will want this feature, so it's also a great investment. They are also very energy efficient. Air Conditioner Installation Toronto
ReplyDeleteNot a single second went without leaving me in utter surprise.
ReplyDeletevisual automation testing
This blog had a to a great degree solid effect on me.
ReplyDeletehjc helmets
I will invite all my friends to your blog, you really got a great blog.~-;*” Air Purifiers
ReplyDeleteHello, this weekend is good for me, since this time i am reading this enormous informative article here at my home. electronic air cleaner
ReplyDeleteVolatile Organic Compounds (VOCs) are found in a wide variety of common household products: paints, varnishes, cleaning supplies, disinfectants, glues and adhesives, and even new carpet and building supplies. home air purifier
ReplyDeleteI got a Hoover Air Purifier 600 for only $100 and it is a good deal in my opinion. What model of Raspberry Pi did you used on this project? Get the latest updates and guides of this casual running game on official website subway surfers! Also check gacha life pc by lunime.
ReplyDeleteHave you been thinking about a room air conditioner rather than a focal air conditioner yet aren't sure what you ought to be searching for? manutenção de ar condicionado
ReplyDeleteThis also calls for attention to the matter that you have to take good care of the air conditioner and undertake periodic maintenance, so that your machine continues to work in the best condition for a long time. https://www.wtfixair.com.au/
ReplyDeleteThe higher the BTU of an air conditioner, the more powerful it is at cooling. But it also increases the cost of the air conditioner. Normally, hvac replacement boise the BTU of an air conditioner required for cooling a room is calculated by multiplying the square foot area of the room by 35.
ReplyDeleteSearching the best convection microwave oven under 15000 with wore range availability. Shop
ReplyDeletenow! best convection microwave oven under 10000
Looking great work dear, I really appreciate to you on this quality work. Nice post. we also provide Air purifier for large room USA. for more information visit our website.
ReplyDeletevery good work friend i like this post. https://ebestbuy.in
ReplyDeleteKnow what is digital marketing in hindi, and digital marketing meaning in hindi
ReplyDeletehere. Read complete blog for more details. digital marketing hindi
Get to know trp meaning, trp meaning in hindi, trp full form and many others terms about trp
ReplyDeletehere. trp full form
This will guarantee exact temperature control and working cycle. Airco
ReplyDeleteYour blog is very nice, thanks to upload this. non electric water purifier
ReplyDeleteThank you so much for this amazing blog, really great blog. Visit Ogen Infosystem, here you will get creative website designing and website development services in Delhi at an affordable price and also get digital marketing service in Noida.
ReplyDeleteBest Website Designing Company in India
If you are looking for the best b2b data companies then we are providing you the best database or business directory.
ReplyDeleteThank you so much for this article and for sharing the information.
ReplyDeleteNice article.
https://www.applianceindia.in/2020/10/27/9-best-smart-tvs-in-india2020-reviews-and-buying-guide/
Thank you so much for this article and for sharing the information.
ReplyDeleteNice article.
best smart tv in india
Nice article.
ReplyDeletebest washing machine in india
Enjoy delicious cakes and grilling recipes. Buy best microwave ovens and save money. Must read review
ReplyDeletehttps://www.offersingh.com/best-microwave-ovens-india/
Appslure is an award-winning mobile app development company building feature-packed and interactive mobile applications for startups, medium and large enterprises.
ReplyDeleteVery informative article. Here is some information on
ReplyDeleteBest AC in India
simple, educative and informative article thanks publisher for sharing this wonderful article i have bookmarked this.
ReplyDeleteBest high back gaming chair
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. 안전놀이터
ReplyDeleteGet affordable and faster webhosting on hostgator via hostgator coupon code india. Register now to get faster webpage loading.
ReplyDelete