Cheapest method for air measurements

Hello everyone!
I want to step up my home automation game, especially when it comes to air quality.
What I want to do is the following:

  • measure humidity and temperature
  • measure pollen in my room
  • measure CO2

My plan is to make my room optimized for my allergy. So whenever humidity is really low, the humidifier starts. When pollen (or any other small particles) is too high, the air cleaner starts. When CO2 is too high, I want to get a notification on my phone. That should be easy to do and I also know how.

My problem at the moment is: I googled a lot, searched a lot in the forum, but there seems to be lots of new sensors being released regularly.

For pollen measuring I want to use the SDS 021.

What cheap options (via WiFi, not Bluetooth please) would you suggest for measuring temperature, humidity and CO2? If possible, I don’t want to use an Arduino, but instead connect it directly to my Pi or have it communicate via WiFi.
I have found an option by Xiaomi (https://www.aliexpress.com/item/32714410866.html?spm=a2g0o.productlist.0.0.3de06b30thumxz&algo_pvid=13941bd4-ee4a-4a7b-9bad-aa5cdb3cbad0&algo_expid=13941bd4-ee4a-4a7b-9bad-aa5cdb3cbad0-1&btsid=41b1dc51-e843-4a42-878e-4e626cbee58d&ws_ab_test=searchweb0_0,searchweb201602_2,searchweb201603_52), but not sure if this actually works well with Home Assistant.

Thanks for your help!

If you use arduino, you should be able to publish the data to mqtt which will let you easily read the data into HomeAssistant.

I would like to not use the Arduino, but instead connect it directly to the Raspberry Pi running HassIO

Hi I use a nodemcu in each room with an AM2302 to measure temp and humidity. Also connected are ccs811 sensors that measure co2 and volatile compounds. I don’t measure pollen directly however.

The nodemcu is easy to configure through ESPhome and will automatically be detected by Hassio.

That is my on a budget way. all of the required components I obtained for about £15 per room.

1 Like

Thank you! I was arguing whether to buy a fully working system (like the ones Xiaomi offer, but it seems like they are not really well calibrated based on reviews) or do it the DIY way.

I’m just getting into all of this, so I’m not too familiar with this.
But I need those components only for one room. Is it possible to do it without the nodemcu and use a breadboard only? Or would you suggest buying a nodemcu in that case too?

I would recommend the nodemcu. Its easy to configure and manage from right within HA.

ESPhome is excellently documented and supported.

A breadboard is for testing and does not have wifi. A nodemcu has either an esp8266 chip or the more powerfull esp32 and will connect to your wifi. All it needs is a microusb power supply so it can be autonomous from the the hub (HA) from the measurements you will be able to create the automatons you require.

Thanks a lot! I will buy this one then, you’re right about the freedom of putting it in another room

Remember that you need to install the ESPhome addon.

This will provide you with installation instructions and config examples for many sensors.

Thanks a lot! That really helps to understand it.
Some more questions though:

  1. Can you link me where to buy the CCS811 in a cheap way? Most offers I find are 20€+
  2. Based on a google search (and what I can’t find in the ESPhome page), how do I connect the nodemcu with the sensors? Most tutorials use a breadboard and jump wires, is that a good way?

You can find the CCS811 on ebay. I buy most of my sensors from there or aliexpress or banggood. Prices will always vary but I got mine for £8.00 from ebay.

To connect any sensor you ned to look at the example. It will help greatly if you have the nodemcu with you and a diagram of the pins. which you can find here

https://nodemcu.readthedocs.io/en/master/modules/gpio/

but for ease of use this may help?

as a graphical representation. These are for the esp8266 version. the esp32 version may differ.

Once you see that it will help. Also the components you are going to add will be (mostly) 3.3v so the power must come from the appropriate pin. GRD is just ground there are several of those. Then the data pin (for the AM2302 is D2.

As you are starting out. I would recommend reading the esphome page and each sensor. this will start you off. Then for each sensor you buy find the schematic. It will tell which pins do what.
Hope that helps?

Perfect!
I think I got it now, just waiting for the sensors to test it out.

One more thing: ESPHome shows the Adafruit CCS811 sensor - that’s the one that’s mostly about 30€. There’s also a purple CCS811 - is that the same one? Can I just order that one for one third of the price of the Adafruit one?

It is similar. Probably a copy but the config is similar. I have the purple ones and will help you when it arrives. There are not too many hoops to jump.

1 Like

Perfect, then I will post here again once it arrived and I encounter any problems

1 Like

Received everything now!
I setup the DHT22 and the ESP8266 using the ESPHome tutorial. Super easy, worked great.

However, I don’t really get the SCC811 running.
It’s saying

[18:49:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)

and

[18:49:46][W][ccs811:124]: Communication failed! Is the sensor connected?

What does your code look like? Do you have any ideas why that occurs?

Check your connections as follows:

VCC TO 3.3V, GND TO GND, SCL to D1, SDA to D2, WAK to GND, RST to 3.3V.

I am using a CJMCU-811 However.

I did not connect WAK and RST, the other pins are connected that way though.

CJMCU-811 is also what I use!

Add the other two connections and you will be good to go. Just give the nodemcu a restart.

It took me a while to sort that out. But last night I did another build just as I posted and it picked it up straight off the bat.

That was the fix indeed! So simple, thanks a lot. Now I’m trying to get the baseline of it and then I got my system running. Thank you again for your help! I really learned a lot

Just make sure that you let it run for 48hrs to get the baseline. I’m glad I could help.

1 Like