Guide to publishing Shinyei sensor data on the World Air Quality Index project

Note. The content on this page is outdated.
For the most recent upload API document, go to https://aqicn.org/data-feed/upload-api/

This page is made for those interrested in measuring Air Quality based on the Shinyei sensor. For more information about the Shinyei sensor, please refer to this on-going experiment page: sensor/shinyei/.


--

Hardware Setup

For this experiement, the hardware used to retrieve the data from the Shinyei Sensor is a PC Duino - but any Raspberry PI would also work fine.

All which is needed, on the PC Duino side, to extract the information from the Shinyei sensor is two digital input. In our configuration, we use the GPIO6 and GPIO7 from the PC Duino. Since the PC duino also provide a 5V output, we directly power supply the SHinyei from the Pc Duino pins.

For now, threshold input (IN1) is left unsed, but it will be used later as a way to split particule by size, and hence detect both PM10 and PM2.5 particules.

Scripts

The scripts are available online from github. They are based on the Air Quality data-upload API described at api/sensor.

To run the scripts, you just need to use this simple command: python shinyei-lpo-reader.py. It will output data in the following style:

 $ python shinyei-lpo-reader.py

16:51:27: 13.02 9.27
16:51:32: 10.15 3.03
16:51:37: 8.58 1.86
16:51:42: 8.97 1.01
16:51:47: 8.32 1.05
16:51:52: 8.22 1.05
16:51:57: 7.33 0.75
16:52:02: 6.72 0.75
16:52:07: 6.05 0.75
16:52:12: 6.4 0.75
16:52:17: 7.13 0.75
--- 16:52:22 --- 0.073053159646 0.00751250729585 ---
Posting {'type': 'shinyei-pdp42ns-1u', 'unit': 'lpo', 'value': 0.07305315964603189} {'type': 'shinyei-pdp42ns-2.5u', 'unit': 'lpo', 'value': 0.007512507295851456} -> 200 OK
Server says {u'sensorID': u'589', u'result': u'ok', u'dataids': [2835085, 2835086]}
Firs column is obviously the current time. The second and third column are the measured LPO (in percentage, from 0 to 100). The script measures the LPO over 1 minute, so the 'current' LPO indication will be displayed 10 times. The 1 minute average is displayed as '--- 16:52:22 --- 0.073053159646 0.00751250729585 ---' (unit from 0 to 1). After that, the averaged LPO is posted ( Posting {'type': 'shinyei-pdp42ns-1u', 'unit': 'lpo', 'value': 0.07305315964603189} {'type': 'shinyei-pdp42ns-2.5u', 'unit': 'lpo', 'value': 0.007512507295851456} -> 200 OK ) to the server.


--

Configuration

Once your setup is working, do not forget to use your own sensor ID, by replacing the value "shinyei.test-sensor" in the file shinyei-lpo-reader.py with your own sensor ID. Sensor ID can be any string, but we recommand to use the convention sensor-type.(location+).your-name, such as for instance shinyei.china.beijing.haidian.john-doe.

 uploader = AirQualityUploader("shinyei.test-sensor")
Once you have choosen your own sensor ID, do not forget to protect it by password so that no-one else but you can upload data. For that, you just need to contact us and let us the ID you want to protect. We will then provide you the password to be used.

--

Still to be done

There are sitll many things to be done. Si if you want to join us and support our work, here are some of the things which we need help for:
  • Hardware connectivity based on the Raspberry PI, Beagle Bonne and other IOT Hardware.
  • Use an intermediate arduino-like to poll and pre-process the data from the Shinyei.
  • Improve the python-scripts with fail-safe support (i.e. keep the data even though if there is no WIFI connection).




关于空气质量与空气污染指数

本网站采用的污染指数和颜色与EPA是完全相同的。 EPA的指数可以从 AirNow上查到

空气质量指数 空气质量指数级别(状况)及表示颜色 对健康影响情况 建议采取的措施
0 - 50 一级(优) 空气质量令人满意,基本无空气污染 各类人群可正常活动
51 -100 二级(良) 空气质量可接受,但某些污染物可能对极少数异常敏感人群健康有较弱影响 极少数异常敏感人群应减少户外活动
101-150 三级(轻度污染) 易感人群症状有轻度加剧,健康人群出现刺激症状 儿童、老年人及心脏病、呼吸系统疾病患者应减少长时间、高强度的户外锻炼
151-200 四级(中度污染) 进一步加剧易感人群症状,可能对健康人群心脏、呼吸系统有影响 儿童、老年人及心脏病、呼吸系统疾病患者避免长时间、高强度的户外锻炼,一般人群适量减少户外运动
201-300 五级(重度污染) 心脏病和肺病患者症状显著加剧,运动耐受力降低,健康人群普遍出现症状 儿童、老年人及心脏病、肺病患者应停留在室内,停止户外运动,一般人群减少户外运动
300+ 六级(严重污染) 健康人群运动耐受力降低,有明显强烈症状,提前出现某些疾病 儿童、老年人和病人应停留在室内,避免体力消耗,一般人群避免户外活动
(参考详见 http://zh.wikipedia.org/wiki/空气质量指数)

如果你想了解更多有关空气质量与污染,详见维基百科或者 AirNow

有关健康建议详见北京的Richard Saint Cyr MD医生的博客:www.myhealthbeijing.com


注意事项: 所有空气质量数据在发布时均未经验证,并且为了保证数据质量,这些数据可能随时被修改,恕不另行通知。 世界空气质量指数项目在编制此信息的内容时已经运用了所有合理的技能和谨慎,在任何情况下世界空气质量指数项目团队或其代理人将不会为由于提供此数据而直接或间接引起的伤害、合同损失、侵权及其他任何损失负责。



设置


选择语言:


Temperature unit:
Celcius