SuperHouse #38: DIY air quality sensor part 1 - "Basic" version

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi i'm jonathan Aqsa and this is super house some years ago out of the blue I got a really bad sinus infection I ended up in hospital delirious for five days on an IV antibiotic drip and it really messed me up in fact it's left the sinuses and the left side of my face really sensitive so now whenever I'm exposed to things like dust or pollen in the air I can get a really bad sinus infection and it happens very quickly so the result is that I've become really conscious of trying to make sure that my environment is clean I keep this lab as clean as possible I've got two vacuum cleaners in here and I'm constantly vacuuming I don't let any of the pets in because I don't want any pet hair and that sort of thing in here I want this to be a place where I can come and actually have nice clean air and not worry about it affecting my sinuses and because of all the bush fires in Australia recently there's been a lot of smoke around and a lot of people have been really concerned about particulate matter in the air you've probably seen comment about things like PM 2.5 face masks what I wanted to do was investigate how much dust is in the air and also things like emissions from 3d printers people worry about fumes from 3d printers but from what I've heard the fumes aren't really so much of a problem as things like tiny particles of plastic which can be emitted and end up floating around in the air as a very fine dust and that can affect people sinuses as well so I found some some sensors and I've made a couple of air quality sensors I'm working on one which is like the rolls-royce version at the moment it's got a color LCD on the front and it measures both particulate matter at different sizes and also temperature pressure humidity and volatile organic compounds I'm going to talk about that one in a future video because this is a much more complicated system but if you want to build something yourself you can do it very easily just using a couple of parts all you need is a particulate matter sensor something like a we must deal one mini with an esp8266 on it so it's got Wi-Fi and we can program it using the Arduino nice and easy a case to put it in you really only need to solder a few connections load the firmware and you can make yourself your own little particulate matter sensor that will give you some sense of the quality of the air around you now the key to this project is this little sensor it's called a particulate matter sensor it's made by ash Engine based company called panting which I think translates to rising vine or something but it's translated in English as plant hour and they've made a few different models over the years they started off with the PM s1 double zero three a few years ago and then they've come out with a whole series of sensors since then which are basically refinements on the same basic principle what I've got here is a PM s 3w 3 there's a 5 w and this is a 7 wo 3 which is their newest one which hasn't been out all that long the 5 SS 3 is pretty commonly available and it comes with a lead that makes it easier to connect so this is probably the best one to use for this project the the difference between the 3 the 5 and the 7 is really just that they've optimized the mechanicals a bit the the airflow has been improved a little bit and they've made the 7 quite a bit smaller than the 5 we're going to be using this one for now the way these things work is quite interesting what they're trying to do is detect particles floating around in the air that are so small that you can't see them with the human eye you'd normally need something like an electron microscope to be able to detect something down in the 2 and 1/2 micro region it's like a 3% the width of the human hair so they're sized very very small in fact particles these size are so small that they almost behave like a gas even though they are a solid so when they're floating around in the air they can be distributed for a very long time they don't settle very easily like heavier dust does they're so fine that once they go into your body that can end up in your bloodstream and cause all sorts of problems so detecting them is quite tricky and these do it in a very interesting way what they do is use a principle where a laser produces a which is then scattered by the particles and it's detected by a sensor on the opposite side of a chamber now you might see that diagram and think I remember high school physics I know what's going on here angle of incidence equals angle of reflection yada-yada-yada the light bounces around but you'd be wrong it's actually much more interesting than that when you take any material and you shave it down to being in the order of a couple of microns in thickness it's no longer totally opaque to light life's going to pass through it to some extent that means that the little particles that are floating around don't just bounce light off them they can also act as lenses because you have internal refraction taking place within the object but it gets even weirder than that because the wavelength of light is somewhere around the 0.5 micron range so what we're talking about is detecting objects that are so small that they are in the region of the wavelength of light itself and when you have light interacting with an object which is as small as its own wavelength it doesn't really behave like a particle anymore it starts to behave like a wave and so it's characteristics become quite different you find that the light itself can bend around the back of an object and it interacts with the surface of it in interesting ways there is a really cool paper which it explains how this works and I'll put a link to it on the project page just down below so make sure you check that out it's not all that long and it goes into the background of how light interacts with these particles down that this satisfies very interesting if you want to learn more about it we don't need to understand all of that though because amazingly this little $15 device implements the laser and the scattering sensor and the control chip which interprets at all and figures out the numbers and gives it to us the fact that they can do this for $15 just boggles my mind these things are magic but because particles exist along a whole range of sizes they're not exactly 2.5 microns or 1 micron or whatever what they do is a statistical process called pinning and it categorizes particles into particular size ranges the number that it gives for a PM one point zero for example is particles smaller than one micron in size and then the PM 2.5 value is particles between 1 micron and 2.5 microns pm10 is particles between 2.5 and 10 microns so the numbers that come out of particulate matter sensors are either a count of the number of particles that it's detected at a certain size range or the total mass in micrograms per cubic meter of particles in that size range that are detected in the air sample I think there's plenty of theory for now let's just get on with it say I like that turn on the soldering iron and build this thing so the parts that we need we're going to use a PMS five zero zero three particulate matter sensor I recommend this one in particular because it's the second most recent version it's easily available and it comes with a cable that it makes it very easy to make connections we also need a we must do one mini just the basic version will do it's got an esp8266 on it it gives us Wi-Fi and USB the PM s500 three has a connector on the side for power and i/o one thing to be careful of is that it needs 5 volts power but all of the i/o is only 3.3 volts the reason it needs 5 volts is there's a fan in it which keeps air circulating through the test chamber now there are multiple models of the five ss3 including a version that has I squared C but by far the most common is just the basic model which has a UART interface for a really simple project like this we don't need to send any data to it in fact we don't even need to control the device at all so we only care about three connections we just want to supply 5 volts and ground to it for power and then we need to connect to the TX line which is how the sensor sends its data out we don't even need to connect to the rx line because we're not sending any communications to the sensor we're just going to watch it and see what information it sends out to us start by plugging the cable in make sure you get the connector around the right way it's slightly delicate and make sure it's all clipped in properly then we need to cut the cable off about two thirds of the right about here so as we've just seen we only care about three of the connections on here so I'm just going to grab some wire strippers and strip off the wires they go to pins one two and five so that's 5 volts ground and TX from the sensor not tuned those wires so that we can connect them to the d1 mini so now we need to find the right pins on the WHMIS d1 mini for making our connections now if you have it oriented the usual way so it reset button down on the bottom left here and the USB pin towards you there is five volts and ground and we're going to use d4 to connect to the TX that comes from the PMS v w3 what I'm going to do is bring those connections in from the side that has the USB socket that's just because I want it to fit into a little 3d printed case that I'll show you in a moment and just because of the way it's oriented it makes it easier if the connection to come in from that side so now I've just got to get the the pin one from the PMS going into the 5 volt connection on here and i'll solder these in place put on the 5 volts to start with then pin 2 is the ground from the pms it's all sort of that in place and then in 5tx data coming out of the PMS going into d4 on the d1 mini oops flopping around a little bit there I've just got to try to make that stay in the right position trying to do this in a way that is visible to the camera which is not very convenient okay and that's it so if we look at the pin out as a diagram you'll see that it's actually incredibly simple it's just these three salty connections and if we look at this now oriented the way I had it in that picture so do you want many kind of upside down you can see five volt ground and pin five TX coming from there and believe it or not that is the total of the electronics assembly we can now plug this into USB and get some software onto it and get some data out of this so this is pretty much the easiest assembly project that you'll ever have to do the software to go on this enter you have a few options I'm going to show you two different options then the first is definitely the easiest if you just want something that will get you up and going quickly go for tez motor you might think of it as being something that you use on device like a Sun off for remote power control but because tez motor has the built-in infrastructure for working with senses it has support for the PMS 5 w 3 and also it has easy Wi-Fi setup all of those good things mqtt it's perfect for this project the easiest way to install test motor on this device is to use the tasmat Iser I've just done a whole video about this explaining how to install it and set it up it's pretty easy so I won't repeat it here once you got tasmat eyes are running click refresh and have a look at what ports you've got here and then what I'm going to do is take the device plug it into my USB hub and we can click refresh and now we can see that we've got a new device in here it's doubled up there's a TTY dot USB serial and the Cu USB serial and it's like the Cu dot USB serial this is the air quality Center and I'm also going to install a release version of taz motor so I'll click on release and we want taz motor bin just the standard installation and click on tasmat eyes so what this does is pull down the latest version of tez motor and it uploads it onto the d1 mini it takes care of all of it for you don't need to mess around with ESP tool so it's very cool it takes a minute or so to do the upload so be patient just sit there and watch the progress bar all done so now we need to power cycle it I'm just going to unplug the device plug it back in again and we'll just say ok in here now the d1 mini will restart and it will be running tez motor but it's not on our Wi-Fi network yet we need to configure it once again tasmat either saves us so it come along here and click on send config enable the Wi-Fi section put in the details for your Wi-Fi network and down here where we have the option of putting in either a template or a module normally what you would do is you would select module and then say what type of device it is but we've built a little custom module here so what we can do is not use module we'll use template I've created a template which pre configure this so I'm just going to paste that template in there and this is available on the super house site I've got MQTT set up already I'm just going to click Save and this will send the configuration to the device our device now has tez motor installed and it's been configured if you use that template it'll already know about the PMS 5 SS re sensor and it'll be acquiring data from it so now what we can do is either look at the MQTT broker to get the data or we can use the web interface what I'm going to do is have a look in my DHCP server to find out the IP address that's been assigned to this device and then open the web interface once I found the IP address for the new device on my network I just put it into a browser and we get this interface you can see that it's already giving us values in micrograms per cubic meter at 12.5 and 10 micron sizes and it's giving us PPD which is particles per deciliter and that is giving us in point 3.5 12.5 five and ten micron sizes so these are a count of the number of particles in that particular size range witches which it's detecting per decilitre these numbers can be quite interesting because when you have a very clean environment you might find that the value in micrograms per cubic meter is below one so in this case we've got zero for the one micron size but if we look down here we've got twenty oh it's just dropped to 18 PPD and then at 0.5 we've got 48 and at point three we've got over a hundred but because these particles are so small even though it's counting this number of particles it's still rounding down to zero micrograms per cubic meter what we can also do is have a look at how this d1 mini has been configured into as motor we didn't have to do anything because I've already created the template if you pasted the template in then you get the pin assignments and everything taken care of for you but you can also do it manually now to see what happened in the template we can come into the interface and click on configure template and this is what I set up I just said super house aqs or air quality sensor as the the module name it's based on the generic module and then GPIO two which is d4 on the d1 mini I set to be PMS five double zero three and that enables the driver for that particular sensor and has motor can then process the data that's coming in on that pin and then display it to us and that's why we're getting these values coming back to us in here and this is also being reported to mqtt because we configured MQTT in that setup so we can now link this to our home automation system and you know chart and report those values if we want to so now we've got something that's functional but still not pretty and this is d1 Mini wired to a sensor it's kind of ugly you can't have this sitting on the shelf in your lounge room and not look like it some Frankenstein's monster project so what I've done is designed a 3d printed case that encloses all of this the case is almost symmetrical the only difference is that one part of it has holes in here to align with the holes in the sensor so I'll disconnect power from here and the way this works is I have the main compartment here for the PM s500 3 and you can see a section down here where the d1 mini fits in and then a bit of room for the cables to wrap around that's why when I cut these leads off I did it at about 2/3 length it gives enough room now there are no fastenings to keep this enclosure attached but what I've done is tuned the size so that on my printer at least this slides in and it's basically just like a firm slide fit you can pull it out no problems but it's not going to fall off it stays there by itself and then what I do is bring the deal 1 mini around and this is also why I said earlier to bring the wires in from the side with the USB socket that then slides into those little slots and it's held in place and the USB socket is then visible through this part of the case so and I can grab a pair of tweezers do a little bit of jiggling a bit of stuffing and just shove these wires down into this part of the case make sure everything clears and there we go you can see that it's got the sensor and the d1 mini and then I can just take the other half of the case bring it over at the top and slide it together now in this case the the d1 mini is kind of getting in the way you can jiggle it a little bit with a pair of tweezers or something it's not quite going into the other slot yet and if I move that that's it and it all closes up so now we've got something that looks much more respectable I mean this sort of thing it can put it up on a shelf somewhere where can you see that I don't know but that could go up on a shelf in your lounge room or kitchen or wherever and it just looks like little Apple device I think so then we can plug in power powers up there's no real way to tell at the moment because there's no LED visible but this is now powered up I can just see the blue LED flashing under there and taking samples so this will now be reporting back to the MQTT broker with the values that it's taking if you want the simplest possible air quality sensor this is it it's the PMS spot zero zero three until one mini three solder connections Taz motor and a 3d printed case I'll put up the design files for the 3d printed case on the super house site on the page for this episode so if you're watching this on YouTube make sure you look down below for the link in the video description that takes you to a page with far more information that isn't included in this video including photos of the assembly process and links with a software and everything you need make sure you check that out so that's really all you need if you want to build the most basic particulate matter sensor but there are some big limitations firstly the plant our sensor that is in this is not really designed for continuous long-term use the laser and the sensor within it can degrade over time they're really only rated to about 6,000 continuous hours abuse which works out to be like 8 or 9 months it's not that long the usual way to deal with that is to put the sensor to sleep for a few minutes wake it up give it time to move air and stabilize take a reading and then put it back to sleep again so in the next episode what we're going to do is look at a more advanced version of this which will use fancier software that will take care of that for us and the other thing is that there's no way to look at this and interact with it directly it publishes all the information to MQTT or on its web interface so it would be really handy if you could just walk up to it and look at a display and see what it's reading well it doesn't take many more parts this is a slightly fancier version it's very similar to the one we've just done today except that it adds a display and a mode switch so you can just walk up to it and see what the reading is directly on the unit so that is the display model that we're going to look at in the next episode so come back to check that out and in the meantime go and build something cool [Music]
Info
Channel: SuperHouseTV
Views: 39,677
Rating: 4.9657073 out of 5
Keywords:
Id: 5FdTRIq6_mY
Channel Id: undefined
Length: 22min 3sec (1323 seconds)
Published: Thu Mar 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.