建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器

建设质量管理条例

This post is originally from www.jaredwolff.com

这篇文章最初来自www.jaredwolff.com

I got my hands on some of the mesh based Particle boards not too long ago. I’ve been itching to try them out but haven’t quite figured out the project.

不久之前,我就接触了一些基于网格的粒子板。 我一直很想尝试它们,但是还没有弄清楚这个项目。

One thing has been bothering me though: air quality. I spend a good amount of time in my office tinkering, soldering, coding and writing. I sneeze occasionally so I always wondered, how bad is it? The house is also prone to mold exposure during the hot months which had me concerned.

一件事情一直困扰着我:空气质量。 我在办公室修补,焊接,编码和书写上花费了大量时间。 我偶尔打喷嚏,所以我一直想知道,它有多糟? 在令我担忧的炎热月份里,房子也容易发霉。

So why not cook something up?

那为什么不煮东西呢?

需要什么 (What’s needed)

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

The most important sensor is the Honeywell HPM series PM2.5/PM10 sensor. This tells you how many micrograms of material is floating around in a cubic volume of space. i.e. it counts the little particles flying around in your air.

最重要的传感器是霍尼韦尔HPM系列 PM2.5 / PM10传感器。 这告诉您在立方体积的空间中漂浮了多少微克的材料。 也就是说,它计算了空气中飞舞的小颗粒。

Second to that, is the AMS CCS811. This sensor tells you the total amount of volatile organic compounds are in the air along with things like C02. It’s another datapoint which is interesting to see. I’ve previously placed this sensor in our basement only to be surprised and see huge spikes in VOC and C02 levels from our (oil burning) furnace turning on in the morning. Time for better ventilation!

其次是AMS CCS811 。 该传感器可以告诉您空气中的挥发性有机化合物总量以及诸如CO2之类的物质。 这是另一个有趣的数据点。 我以前曾将此传感器放在我们的地下室中,只是感到惊讶,并看到早晨(开油)炉中的VOC和CO2浓度急剧上升。 是时候进行更好的通风了!

Finally, the Silicon Labs Si7021 temperature and humidity sensor. These two bits of environmental data are useful. More importantly they’re used by the algorithm in the CCS811 to compute the TVOC and C02. Considering the cost of the CCS811, I’m surprised it doesn’t have these measurements on board but maybe in their next revision..

最后是Silicon Labs Si7021温湿度传感器。 这两位环境数据很有用。 更重要的是,CCS811中的算法将它们用于计算TVOC和CO2。 考虑到CCS811的成本,我很惊讶它没有这些测量值,但可能在其下一个修订版中。

一起布线 (Wiring it all together)

It’s time to wire everything together. At the very least you’ll need:

是时候将所有内容连接在一起了。 至少您需要:

  1. Solder-less breadboard hookup wire

    无焊面包板连接线

  2. A solder-less breadboard

    免焊面包板

  3. A CCS811 breakout board from Adafruit (more details here)

    Adafruit的CCS811接线板 ( 更多详细信息,请点击此处 )

  4. A Si7021 breakout from Adafruit(more details here)

    来自AdafruitSi7021突围 ( 此处更多详细信息 )

  5. A Particle board of your choice.

    您选择的刨花板。

  6. A HPMA115 Particle sensor

    HPMA115粒子传感器

  7. Pre assembled Molex cable for the HPMA115 (Molex P/N 0151340803 or similar)

    用于HPMA115的预装Molex电缆(Molex部件号0151340803或类似产品)

  8. Some 0.1” pitch headers

    约0.1英寸间距的割台

I’ve included a Fritzing example with this project. There’s also a hookup image below:

我在该项目中包含了Fritzing示例。 下面还有一个转播图片:

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》
Note: the original Fritzing diagram was incorrect. Both Vin of the CCS811 and Si7021 should be connected to the 3.3V on the Particle

注意:原始的Fritzing图不正确。 CCS811和Si7021的Vin均应连接到粒子上的3.3V

An Adafruit Feather is used to represent the Particle Argon. Particle does not have Fritzing models quite yet.

Adafruit羽毛用于表示粒子氩。 粒子还没有Fritzing模型。

As you can see everything is hooked up except for the PM2.5 sensor. The pinout is included below.

如您所见,除PM2.5传感器外,其他所有东西都已连接。 引脚排列如下。

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

The most important pins are the 5V, GND, RX and TX pins. The other ones can stay disconnected if you choose. Here are the connections called out:

最重要的引脚是5V,GND,RX和TX引脚。 如果您选择,其他的可以保持断开连接。 这是被调用的连接:

5V     -> USB
GND    -> GND
RX     -> TX (on the Argon)
TX     -> RX (on the Argon).

Here’s a picture of everything assembled on a solder-less breadboard.

这是无焊料面包板上组装的所有东西的图片。

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

Another important note is that I modified the cable for the HPMA so they had male pins on the end. That made it easy to insert into the solder-less breadboard. Here’s a zoomed in shot:

另一个重要的注意事项是,我修改了HPMA的电缆,使它们的末端带有公针。 这样就很容易将其插入无焊面包板。 这是放大的镜头:

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

When you purchase the cable for the PM2.5 sensor it came pre-populated with 8 wires. To make things simpler, you can remove 4 of the wires that are not used. The best way to do that is take a sharp tipped tool (dental pick, sewing needle, etc) and stick it under the clips I’ve pointed out in red below:

当您购买PM2.5传感器的电缆时,它已预先装有8根电线。 为简化起见,您可以删除4条未使用的电线。 最好的方法是使用锋利的工具(牙签,缝纫针等)并将其粘贴在我下面用红色指出的夹子下:

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

Then, once you have your sharp implement underneath, tug on the wire and it should slide out.

然后,一旦将尖锐的工具放在下面,就可以拉动电线,并且电线应滑出。

Now you have less wire and less headache. You can use this technique to modify any Molex-like connector.

现在,您的导线更少了,头痛也更少了。 您可以使用此技术来修改任何类似于Molex的连接器。

读取固件 (Plumbing the firmware)

For this project I decided to keep my code consistent with the Wiring/Arduino-like API. That means object oriented C++. It’s been a while where I’ve coded in C++ so when you’re looking at the codebase and wondering “why the hell did he do that!?” Sorry, not sorry. ?

对于这个项目,我决定使我的代码与Wiring /类似Arduino的API保持一致。 这意味着面向对象的C ++。 我用C ++编码已经有一段时间了,所以当您查看代码库并想知道“他为什么这么干!!”时, 对不起,对不起。 ?

The best way to get started is to use Visual Code with the Particle plugins for this project. Click here to get started if you’re not already setup.

最好的入门方法是对该项目的粒子插件使用Visual Code。 如果您尚未设置,请点击此处开始。

Si7021 (Si7021)

The Si7021 is super simple. It only has 4 active pins out of the 6 on the chip.

Si7021非常简单。 它只有6个活动引脚。

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》 (Copied directly from the Si7021 documentation)

The best say to read the temperature/humidity sensor is to issue a blocking read command. In an embedded world, this is not ideal. Unfortunately, there’s no way to know when the readings are ready because there is no interrupt pin.

读取温度/湿度传感器的最佳方法是发出阻塞读取命令。 在嵌入式世界中,这不是理想的。 不幸的是,由于没有中断引脚,因此无法知道何时准备就绪。

As described in the data-sheet, you first write the command and then attempt to read directly from the device. The code looks something like this:

如数据表中所述,您首先要编写命令,然后尝试直接从设备读取数据。 代码看起来像这样:

// Si7021 Temperature
    Wire.beginTransmission(SI7021_ADDRESS);
    Wire.write(SI7021_TEMP_HOLD_CMD); // sends one byte
    Wire.endTransmission();           // stop transaction
    Wire.requestFrom(SI7021_ADDRESS, 2);

    // Get the raw temperature from the device
    uint16_t temp_code = (Wire.read() & 0x00ff) << 8 | (Wire.read() & 0x00ff);

Wire the address of the device, write the command and then subsequently read the number of bytes necessary (Two in this case) The Si7021 will then stretch the clock until the reading has completed.

连接设备的地址,写入命令,然后读取所需的字节数(在这种情况下为2)。然后Si7021将延长时钟直到读取完成。

I didn’t mess around with other settings. Depending on your environment you may have to tweak how much current to feed the heater. You’re mileage may vary so prepare accordingly!

我没有弄乱其他设置。 根据您的环境,您可能需要调整向加热器供电的电流量。 您的里程可能会有所不同,因此请做好准备!

Finally, these readings are read on a reoccurring timer. I originally was using the millis() call and calculating the different of the start and current time but this eventually breaks (in 50 or so days). Instead I decided to use a system timer (similar to if not the same as the APP_TIMER in the NRF SDK)

最后,这些读数是在重复出现的计时器上读取的。 我最初使用millis()调用并计算开始时间和当前时间的差值,但是最终中断了(大约50天)。 相反,我决定使用系统计时器(如果与NRF SDK中的APP_TIMER不同,则类似)

Timer timer(MEASUREMENT_DELAY_MS, timer_handler);

That way you get your interrupt always at MEASUREMENT_DELAY_MS no matter what! (In my case MEASUREMENT_DELAY_MS = 60000 ms == 60s)

这样一来,无论如何,您总是可以在MEASUREMENT_DELAY_MS获得中断! (在我的情况下, MEASUREMENT_DELAY_MS = 60000 ms == 60s)

CCS811 (The CCS811)

The CCS811 gives you a bit more freedom to play but it comes with it’s own specialness.

该CCS811给你多一点自由发挥,但它与它自己的特殊性

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

In most cases the ADDR pin is set low. This pin modifies one bit of the address. This is useful if you have two of the same device or two devices with the same address on the same I2C bus.

在大多数情况下,ADDR引脚设置为低电平。 该引脚修改地址的一位。 如果在同一I2C总线上有两个相同的设备或两个具有相同地址的设备,这将很有用。

The CCS811 also has a few handy input and output pins. The most important is the interrupt pin. Whenever a reading is complete, this open drain pin will be pulled low. It will only get reset once you read the status register. This is great for asynchronous reads that way you’re not locking up your MCU.

CCS811还具有一些方便的输入和输出引脚。 最重要的是中断引脚。 每当读数完成时,该漏极开路引脚将被拉低。 只有在读取状态寄存器后,它才会重置。 这对于异步读取非常有用,因为您无需锁定MCU。

One important point is that the CCS811 does require you to issue a “start” command. This forces the internal MCU to start executing the TVOC/CO2 sensing algorithm. If you attempt to read the data registers before the application is started you will get bogus data. (The command is 0x90)

重要的一点是CCS811确实要求您发出“启动”命令。 这将强制内部MCU开始执行TVOC / CO2感应算法。 如果尝试在启动应用程序之前读取数据寄存器,则会得到虚假数据。 (命令为0x90)

In the firmware, the CSS811 is processed in the same loop as the Si7021. The code pulls the available data from the CSS811 asynchronous readings. No blocking code!

在固件中,CSS811与Si7021在同一循环中进行处理。 该代码从CSS811异步读数中提取可用数据。 没有阻止代码!

HPMA115 (The HPMA115)

The particle sensor is a bit more tricky. When it is turned on, the device starts sending particulate data on a regular interval. i.e. it’s in auto-send mode every time it powers up.

粒子传感器有点棘手。 打开电源后,设备会定期发送颗粒数据。 即,每次开机时它都处于自动发送模式。

I tried previously to configure the device but sometimes I wouldn’t get a response back. It was always hit and miss. It drove me crazy.

我之前曾尝试配置设备,但有时无法获得响应。 总是很受欢迎。 这让我发疯。

So, in order to turn the device off wen you’re not using it I highly suggest using a load switch of some kind. Not only will this save power but according to Honeywell, it will also increase the lifespan of the fan.

因此,为了关闭设备,如果您不使用它,我强烈建议您使用某种负载开关。 据霍尼韦尔称,这不仅可以节省功率,而且还可以延长风扇的使用寿命。

The flow of the readings:

读数流:

  • Every minute turn it on

    每分钟打开一次

  • Wait for data to be sent

    等待数据发送

  • Read the reading asynchronously via UART

    通过UART异步读取读数

  • Turn it off

    把它关掉

  • Bundle that data into the JSON blob to be sent to the server

    将该数据捆绑到JSON Blob中以发送到服务器

This way there’s no need to mess with any registers. All the more reason why I2C and even SPI are better data buses than UART. I just want it to work!

这样,就无需弄乱任何寄存器。 更为什么I2C甚至SPI比UART更好的数据总线。 我只是想让它工作!

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

I originally chose this sensor a while back for it’s enclosed nature. In my option, it’s easier to integrate. My electrical engineer brain doesn’t want to deal with complex stuff. Give me a box and lets go.

我最初选择这种传感器是因为它具有封闭特性。 在我的选择中,它更易于集成。 我的电气工程师的大脑不想处理复杂的事情。 给我一个盒子放开。

使一切正常 (Getting everything working)

During the development phase of this project I happened to be traveling abroad. The crappy wifi was not cutting it and it was taking forever to iterate on the code. The Argon also had a hard time connected to my iPhone’s AP so I gave up on that idea early on.

在这个项目的开发阶段,我碰巧出国旅行。 糟糕的wifi并没有削减它,并且要花很多时间来遍历代码。 氩气也很难连接到我的iPhone的AP,所以我很早就放弃了这个想法。

So, in order to develop the code that didn’t require the internet I placed the device into manual mode. What does manual mode do? It allows the code to start execution despite not being connected to the Particle cloud. That way you can take readings all day but you don’t have to be connected to Wifi. You can put the device in manual mode by putting this define in your .ino file:

因此,为了开发不需要互联网的代码,我将设备置于手动模式。 手动模式有什么作用? 即使未连接到粒子云,它也允许代码开始执行。 这样一来,您就可以整天读取数据,而不必连接到Wifi。 您可以通过将以下定义放入.ino文件来将设备置于手动模式:

SYSTEM_MODE(MANUAL);

In battery powered applications, this is ideal. Wifi is expensive power-wise and you don’t need to be running it if you don’t have to!

在电池供电的应用中,这是理想的选择。 Wifi在功率方面是昂贵的,如果不需要,则无需运行它!

In a previous experiment, I found that it took about 10-15 seconds from nothing to sending data to the Particle cloud. That’s a long time in the embedded world. That’s one of the main reasons I suspect Particle came out with their mesh system. This allows sleepy end nodes (or nodes that are taking data and periodically sending it to a central point) to run much longer than their Wifi based cousins.

在先前的实验中,我发现从零到将数据发送到粒子云大约花费了10-15秒。 在嵌入式世界中这已经是很长一段时间了。 这是我怀疑粒子与网格系统一起出现的主要原因之一。 这使困倦的终端节点(或正在获取数据并定期将其发送到中心点的节点)的运行时间比其基于Wifi的表兄弟要长得多。

Remember you will have to run the Particle.connect() function in order to connect to wifi in manual mode. Or if you’re ready for it to re-connect, remove SYSTEM_MODE(MANUAL); from your .ino file.

请记住,您必须运行Particle.connect()函数才能以手动模式连接到WiFi。 或者,如果您准备好重新连接,请删除SYSTEM_MODE(MANUAL); 从您的.ino文件中。

更改Wifi凭证 (Changing Wifi Credentials)

During my experiment in trying to get my wifi to work I did discover a few handy Particle tools to change wifi credentials etc. By holding the mode button during operation, the device eventually starts blinking blue. Once blinking blue, you can issue a particle serial wifi which will walk you through the process of changing the credentials.

在尝试使wifi正常工作的实验中,我确实发现了一些方便的Particle工具来更改wifi凭据等。通过在操作过程中按住模式按钮,设备最终开始闪烁蓝色。 呈蓝色闪烁后,您可以发出particle serial wifi ,它将引导您完成更改凭据的过程。

The above process is light years faster than using the iPhone/Android app. I thought the app was cool at first but man does it take a long time to scan and get your devices connected.

与使用iPhone / Android应用程序相比,上述过程要快光年。 我以为该应用程序起初很酷,但是人确实需要很长时间才能扫描并连接设备。

More info on this procedure go here.

有关此过程的更多信息,请转到此处。

出现问题时恢复 (Recovering when things go awry)

I had to recover my Argon during my development process. I did some digging and found that re-programming the OS, App and Bootloader seemed to do the trick.

我必须在开发过程中恢复氩气。 我进行了一些挖掘,发现重新编程OS,App和Bootloader似乎可以解决问题。

Get the files here: Release 0.9.0 (Gen 3) · particle-iot/device-os · GitHub (As of this writing the latest is 0.9.0)

在此处获取文件: 0.9.0版(第3代)·particle-iot / device-os·GitHub (截至撰写本文时,最新版本为0.9.0)

Then program these files in DFU mode by holding the mode button after tapping the reset button once.

然后,在轻按一次reset按钮后按住mode按钮,即可在DFU模式下对这些文件进行编程。

particle flash --usb system-part1-0.9.0-argon.bin
particle flash --usb tinker-0.9.0-argon.bin

Program this one in Listening mode:

在“ 聆听”模式下对此程序进行编程

particle flash --serial bootloader-0.9.0-argon.bin

Note: the -argon suffix may be different depending on what you’re programming to. Other options are -boron and -xenon.

注意: -argon后缀可能会有所不同,具体取决于您要编写的内容。 其他选项是-boron-xenon

在命令行上监视 (Monitoring on the command line)

Finally, one of the most useful commands is this one:

最后,最有用的命令之一是以下命令:

particle serial monitor --follow

particle serial monitor --follow

This allows you to use the USB Serial interface to receive debug messages from he device. This is akin to connecting an FTDI device to an Arduino.

这使您可以使用USB Serial接口从设备接收调试消息。 这类似于将FTDI设备连接到Arduino。

For instance, I may be debugging part of the code so I want to see some data. In the Setup() function I’ll be sure to run Serial.begin(), then later on I’ll make a Serial.printf(“data: %d”,data.tvoc); in order for it to be sent over the USB Serial interface.

例如,我可能正在调试代码的一部分,因此我想查看一些数据。 在Setup()函数中,我将确保运行Serial.begin() ,然后稍后再创建Serial.printf(“data: %d”,data.tvoc); 以便通过USB串行接口发送它。

Serial UART for debugging, it’s a beautiful thing.

串行UART用于调试,这是一件很漂亮的事情。

出版 (Publishing)

One thing I did discover during the development process was the publishing limits of the Particle platform. For a single device, you cannot Particle.Publish more than 4 pieces of data in one second. Even though I was taking data every minute, I was sending 6 pieces of individual data to the server at the same time. After testing I soon started to wonder why the heck my C02 and TVOC readings disappeared.

我在开发过程中发现的一件事是Particle平台的发布限制。 对于单个设备,您不能在1秒钟内Particle.Publish 4个以上的数据。 即使我每分钟都在采集数据,但我同时还是向服务器发送了6条单独的数据。 经过测试后,我很快开始怀疑为什么我的C02和TVOC读数消失了。

I had found the culprit.

我找到了罪魁祸首。

So, in order to make things work, I had to format it as a JSON blob. See how I did it exactly below:

因此,为了使工作正常,我不得不将其格式化为JSON blob。 请参阅下面的内容:

String out = String::format("{\"temperature\":%.2f,\"humidity\":%.2f,\"pm25\":%d,\"pm10\":%d,\"tvoc\":%d,\"c02\":%d}",si7021_data.temperature,si7021_data.humidity,hpma115_data.pm25,hpma115_data.pm10,ccs811_data.tvoc,ccs811_data.c02);
Particle.publish("blob", out , PRIVATE, WITH_ACK);

I created a JSON structure and then used String::format to insert each piece where they needed to be. If you are running your device over LTE this will cause you to send more data than necessary. There are better options like Protocol Buffers or using MessagePack. If you’re dealing with complex data, I recommend the former because of its programatic nature. Plus, you can use it with just about any programming language. So web to embedded? No problem.

我创建了一个JSON结构,然后使用String::format将每个片段插入需要的位置。 如果您通过LTE运行设备,这将使您发送的数据超出必要。 还有更好的选择,例如协议缓冲区或使用MessagePack 。 如果您要处理复杂的数据,我建议您使用前者,因为它具有程序性。 另外,您几乎可以将其与任何编程语言一起使用。 那么网络要嵌入吗? 没问题。

After every minute, I only send the data when all three sensors have been read. I use three separate boolean values to determine the state of the sensor readings. Once they have all been set to true do I invoke the Particle.Publishcall.

每分钟之后,我仅在读取所有三个传感器后才发送数据。 我使用三个单独的布尔值来确定传感器读数的状态。 将它们全部设置为true ,我将调用Particle.Publish调用。

Then after publishing, I reset all variables like so:

然后,发布后,我将所有变量重置为:

ccs811_data_ready = false;
si7021_data_ready = false;
hpma115_data_ready = false;

Then, everything starts all over again. You can also create a status struct which has each of these flags neatly inside. Considering I only have three data points, I didn’t go the extra mile there.

然后,一切重新开始。 您还可以创建一个状态结构,其中每个标志都整齐地位于内部。 考虑到我只有三个数据点,因此我没有付出更多努力。

使用Adafruit IO (Using Adafruit IO)

One way to publish is by using Adafruits IO platform. Here’s how to get started.

一种发布方式是使用Adafruits IO平台。 这是入门方法。

  1. Create an account here: https://io.adafruit.com

    在此处创建帐户: https//io.adafruit.com

  2. Next is to create feeds for each of the data types. We’ll need 6 in total.

    《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

    接下来是为每种数据类型创建提要。 我们总共需要6个。

  3. For each feed, add a Webhook.

    《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

    对于每个提要,添加一个Webhook。

  4. Take each webhook address and create a new Webhook in the Particle console

    取得每个Webhook地址并在粒子控制台中创建一个新的Webhook

  5. Change the Request format to JSON

    Request format更改为JSON

  6. Then under Advanced Settings click on Custom for the JSON DATA

    然后在“ Advanced Settings单击“ Custom以获取JSON数据

  7. Replace what’s there using mustache templates. Adafruit IO is looking for a JSON key called value. So set it like this:

    使用小胡子模板替换那里的内容。 Adafruit IO正在寻找一个名为value的JSON密钥。 因此,将其设置为:

    {
     “value”:”{
         {
         {c02}}}”
    }

    You can replace c02 with any of the keys in your JSON blob. As a reminder the current JSON blob looks something like this:

    您可以用JSON blob中的任何键替换c02 。 提醒一下,当前JSON Blob如下所示:

    {
     “temperature”:21.2,
     “humidity”:30,
     “pm10”:2,
     “pm25”:1,
     “tvoc”:650,
     “c02”:1001
    }
  8. Repeat this as necessary until all feeds have a corresponding Webhook configured.

    根据需要重复此操作,直到所有提要都配置了相应的Webhook。

  9. Finally, you can create a dashboard to see them all in one place. This is straight forward just follow the on screen prompts. :)

    最后,您可以创建一个仪表板以在一处查看它们。 只需按照屏幕上的提示进行操作即可。 :)

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

《建设质量管理条例_如何为您的房屋建造负担得起的空气质量传感器》

You can check out my live dashboard here. It’s nifty and just another way to display your data.

您可以在此处查看我的实时仪表板 。 这很漂亮,并且是显示数据的另一种方式。

Sidenote: My first impressions on Adafruit IO are good. It was easy to setup and start using. The main drawback that it’s tedious especially if you have more than a handful of data points. But maybe they’ll fix that in the future!

旁注:我对Adafruit IO的第一印象很好。 设置和开始使用都很容易。 它的主要缺点是乏味,特别是在您拥有多个数据点的情况下。 但也许他们会在将来解决此问题!

Update: If you have multiple pieces of data. You can point your Particle integration to a single endpoint. Just make sure the data is in the same group! Here’s an example of multiple values sent to the same group:

更新:如果您有多个数据。 您可以将粒子集成指向单个端点。 只要确保数据在同一组中即可! 这是发送到同一组的多个值的示例:

{
  "feeds": [
    {
      "key": "tvoc",
      "value": "{
   {
   {tvoc}}}"
    },
    {
      "key": "c02",
      "value": "{
   {
   {c02}}}"
    },
    {
      "key": "temperature",
      "value": "{
   {
   {temperature}}}"
    },
    {
      "key": "humidity",
      "value": "{
   {
   {humidity}}}"
    },
    {
      "key": "pm2-dot-5",
      "value": "{
   {
   {pm25}}}"
    },
    {
      "key": "pm10",
      "value": "{
   {
   {pm10}}}"
    }
  ]
}

Where your URL should look something like:

您的网址应如下所示:

https://io.adafruit.com/api/v2/<USERNAME>/groups/<GROUPNAME>/data

That should keep your Particle integration page a little more sane!

那应该使您的粒子集成页面更加理智!

理解读数 (Making sense of the readings)

The readings can be confusing. Here’s the breakdown of how they work:

这些读数可能会造成混淆。 以下是其工作方式的细分:

  1. Humidity is showing in relative percentage points. This is the relative humidity we know and love. Remember it may differ with what’s outside. This depends on if your house is air conditioned or if you’re running a heater etc.

    湿度以相对百分比表示。 这是我们知道和喜欢的相对湿度。 记住,外面可能有所不同。 这取决于您的房屋是否装有空调或是否正在运行加热器等。

  2. Temperature is in degrees C (can be modified in firmware if you so choose)

    温度以摄氏度为单位(如果您选择的话,可以在固件中进行修改)

  3. TVOC is in ppb (parts per billion). VOCs can be in the form of harmful chemicals you have around the house. More information about VOCs check out thislink from the EPA.

    TVOC以ppb(十亿分之一)为单位。 VOC可能是您家中所有有害化学物质的形式。 有关VOC的更多信息,请从EPA查看此链接

  4. C02 is in ppm (parts per million). We breathe in oxygen and exhale carbon dioxide. You may find your VOC and C02 levels rising when you’re in the room. C02 does correlate to VOCs as well. More info in the data sheet.

    CO 2以ppm(百万分之一)为单位。 我们吸入氧气并呼出二氧化碳。 当您在房间里时,您可能会发现VOC和CO2含量上升。 CO 2也确实与VOC相关。 数据表中的更多信息。

  5. PM10. Is in µg/m3 (micrograms per meter cubed). The particle sensor uses a scattered laser when then shines across the air chamber to a sensor on the other side. The more the rays are blocked, the more particles in the air. The particle sensor then does some calculations to determine the amount of particles in a certain volume and thus your µg/m3.

    PM10。 单位为微克/立方米(每立方米微克)。 当粒子传感器穿过气室到达另一侧的传感器时,粒子传感器将使用散射激光。 光线被阻挡得越多,空气中的微粒越多。 颗粒传感器然后进行一些计算以确定一定体积中的颗粒数量,从而确定您的µg / m3。

  6. PM2.5 is the same as above but it tracks much smaller particles. (Less than or equal to 2.5µm in size!) More information on the EPA’s website here.

    PM2.5与上面的相同,但它跟踪的颗粒小得多。 (尺寸小于或等于2.5μm!) 更多信息请访问EPA网站。

不在乎您无法控制的事情? (Don’t care for something you have no control over?)

Check out my tutorial on creating your own amazing looking IoT dashboard.

查阅我的教程,以创建自己的精美IoT仪表板。

你做到了! (You did it!)

Congrats. You’ve made it this far. You deserve a day at the spa. Or maybe some chocolate ice cream. Or if you’re really feeling adventurous, both, at the same time??

恭喜。 到目前为止,您已经做到了。 您应该在水疗中心度过一天。 或一些巧克力冰淇淋。 或者,如果您真的想同时冒险,那么两者都可以吗?

After building one of these you may feel like your time is worth investing elsewhere. Maybe you want to build a cool web backend with fancier charts and algorithms. Maybe even use some machine learning (why not!)

建立其中之一后,您可能会觉得自己的时间值得在其他地方投入。 也许您想使用更高级的图表和算法来构建一个不错的Web后端。 甚至可以使用一些机器学习(为什么不!)

If you want something already assembled and available you should check out the Particle^2 (Pronounced Particle Squared). It has everything here including the ability to switch on and off the HPM particle sensor. You can even run it on batteries! So put that sucker anywhere you want. Check it out here.

如果您希望某些东西已经组装好并且可用,则应签出“粒子^ 2”(带发音的粒子平方)。 它具有一切功能,包括打开和关闭HPM粒子传感器的功能。 您甚至可以使用电池运行它! 所以把那个吸盘放在你想要的任何地方。 在这里查看。

Here’s the full video on the Particle Squared.

这是“粒子平方”的完整视频。

代码和来源 (Code and Source)

This whole project is released under the Creative Commons Share-Alike license. Get the source code and hardware files here.

整个项目均以知识共享类似许可方式发布。 在此处获取源代码和硬件文件。

准备好《终极指南》 (Get Ready for the Ultimate Guide)

This post is an excerpt from my upcoming Ultimate Guide on Particle Mesh. Early subscribers get a discount when it becomes available! Click here to get signed up.

这篇文章摘录自我即将出版的《粒子网格终极指南》。 早期订户可获得折扣! 单击此处进行注册。

翻译自: https://www.freecodecamp.org/news/how-to-build-an-affordable-and-proven-air-quality-sensor/

建设质量管理条例

    原文作者:cumian9828
    原文地址: https://blog.csdn.net/cumian9828/article/details/108154644
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞