Automated Air Filtration

by technicallywoodworking in Workshop > Woodworking

594 Views, 8 Favorites, 0 Comments

Automated Air Filtration

Building Better Habits | Automated Air Filtration | Node-Red Collab w/ Geeksmithing

One of my goals for 2021 is to start taking my air-quality seriously so for my project I am going to automate turning on and off an air filtration system based on the actual air-quality. Whenever I am doing woodworking in my garage I know I need to be running an air filtration system but if I am being honest I am terrible at remembering to set it up and turn it on ahead of time so that when I get to sanding it's ready to go. By building this automated system I will never have to worry about it and it will only run when it needs to be running.

Supplies

Setup the Raspberry Pi

RPi-Logo-Stacked-Reg-SCREEN.png

Start by following the standard installation instructions for Raspberry Pi OS and be sure to enable SSH so you can access your pi remotely.

https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit

Setup Node-RED Instance

node-red-icon-2.png

Once that is complete and you are going to get our node-red instance running.

Up till this point I have been talking about the brains of this system as a single thing but in reality this project uses a bunch of different pieces of software in connection with node-red. Normally that would mean we have to install all the things in the specific order needed and wire them all up to talk to each other correctly but in this case someone has already automated all of that for us! Pete Scargill has done an amazing job scripting the install and setup exactly how we need it. It’s just called “The Script” but it is a magnificent thing. He even provides step by step instructions for setting it up on a raspberry pi so once you have completed that we should be all set! Next we are going to plugin our air-quality sensor and setup a script to run on boot that will send the values into our node-red instance. We can send data into our instance by using one of the other pieces of software that was configured during the setup: MQTT.

https://tech.scargill.net/the-script/

Setup the Sonoff

The Hardware_1.10.2.png

These smart plugs come with firmware pre-installed that work with the manufacturers app and ecosystem but we need them to work with our private ecosystem so we need to install new firmware. There are a few different options but I went with Tasmota because it is open-source, has a large community around it, and honestly it seemed like the easiest option to me. When I was looking for smart plugs that I could flash with custom firmware I came across a lot of people saying they had success with brand A or B but by far the most commonly used hardware here is the sonoff brand stuff. The reason these smart plugs are so popular with hardware modifiers is because they use the very common esp-8266 wifi board. Since this board is so common there is a ton of information available on how to reprogram it. Don’t worry though we won’t be banging out 1’s and 0’s. Tasmota has a piece of software called Tasmotizer that makes the whole process take about 5 minutes and is done through a graphical user interface.

To install our Tasmota firmware, or flash the device, we need a 3.3v FTDI serial to usb device and we need to access the circuit board of the device. The FTDI board can be picked up from lots of places. Mine happens to be from SparkFun but if you are ordering the air-sensor from adafruit they have one as well that I will link. Sonoff makes accessing the circuit board super simple. Simply pop off the end-cap, slide the rails out, remove the 3 screws and pull out the board. Once the board has been removed do not plug it into the wall until you have completely reassembled it. Seriously be smart and stay safe when working around mains power. Once we have the board out we can solder on 4 short wires to connect our FTDI for flashing. Then it’s just a matter of installing the FTDI board drivers, installing Tasmotizer, and following its instructions. Truly it takes about 5 minutes. Now that we have Tasmota on our plug we can set it up to subscribe and publish on the same broker that our air-quality sensor is publishing on.

https://tasmota.github.io/docs/

Setup a Dashboard

The Dashboard_1.15.1.png

Using node red to setup a dashboard is super simple. The drag and drop interface makes it very intuitive to wire up the display you want. I wired up 2 line charts and 6 gauge charts in just a few minutes.

Start by dragging the inputs on to the flow, then the display types you would like, finally click and drag the dots between them to have the input data flow into the chart.

This step will depend very much on the display you want but the steps are exactly the same.