uses BBC micro:bit to measure and display indoor air quality using Bosch BME680 and/or Sensirion SGP30

Dependencies:   microbit

uses Bosch BME680 and/or Sensirion SGP30 sensors to measure indor air quality

sensors should be connected to BBC micro:bit using i2c

commands are received and data is being sent using uBit / nordic radio protocol

display ---

last line always indicates: - first dot: bme680 detected - second dot: sgp30 detected - third dot: sgp 30 setting humidity/temperature - fourth dor: sgp30 measuring - fith dot: bme680 measuring

the detect dots should be in a stable state (not blinking) the measuring dots should be blinking (constant light means: measurement failed)

if only one bme680 is present: - first 3 lines indicate gas resistence (air quality / more dots == worse quality) - fourth line indicates humidity level

if only sgp30 is present: - first two lines indicate SGP30 VOC level - third and fourth line indicate sgp30 CO2 level

if both sensors are present: - first line indicates SGP30 VOC level - second line line indicates sgp30 CO2 level - third line indicates bme680 gas resistence (air quality) - fourth line indicates bme 680 humidity level

buttons - B display state, switches betweeen - full bright - low light - display off

AB reset sgp30 baseline in non volatile storage

data logging -- during measurements the minimum and mximum values for each measured value (temperature, air pressure, humidity,gas resistance, VOC, CO2) are being stored in non volatile storage those (and the last measurement results) are being shown when btn A has been pressed

Revisions of main.cpp

Revision Date Message Actions
52:112eaa5282c6 2022-01-20 transmit more information File  Diff  Annotate
51:133f2fb8a7c5 2022-01-17 more delays when sending, had problems when distance was large File  Diff  Annotate
50:63442fd5e709 2022-01-17 fixed possible buffer overflow in radio module and wrong replies in base line set File  Diff  Annotate
49:bbb506b58e6e 2022-01-16 support switching light levels via btn B File  Diff  Annotate
48:52cad865a84f 2019-03-21 code cleanup (removed comments) File  Diff  Annotate
47:881bfe77a00a 2019-02-17 show bme680 gas res linear, not exponential File  Diff  Annotate
46:2fed2865a0f3 2019-02-15 finally up and running again, next steps: split nvstore into general and app specific functions, split ui from main, more tests File  Diff  Annotate
45:d6a9fd9c8200 2019-02-13 more unit tests File  Diff  Annotate
44:67a19da5f269 2019-02-13 more bme tweaking File  Diff  Annotate
43:f968ca84d4ed 2019-02-13 seems the stray values resulting from delay problems have finally been solved File  Diff  Annotate
42:ce269f988ac8 2019-02-13 apparently when working both chips parallel we do not have an i2c issue (buses had been separated) but a delay issue with bme680 -> first attempt to fix that File  Diff  Annotate
41:8f891ea56b0d 2019-02-13 cleanup 2nd i2c Bus if not required File  Diff  Annotate
40:a67a880cb538 2019-02-13 for the moment: seperate the i2c busses of the chips and remove all locking File  Diff  Annotate
39:efe22f143e47 2019-02-13 moved debugging information File  Diff  Annotate
38:0f29a0ea64ca 2019-02-12 attempt to attack on the parrallel influence problem File  Diff  Annotate
34:069c4f6d5b2c 2019-02-12 code cleanup File  Diff  Annotate
33:af2dfab24ca9 2019-02-12 tests and usage of moving average for bme gas resistence File  Diff  Annotate
28:56273b8282ca 2018-12-14 no point displaying sgp300 min values, they are always 0/400 File  Diff  Annotate
27:cb75a0c5c52a 2018-12-14 store bme680 gas resistance indexed by humidity File  Diff  Annotate
24:07a1d2e6914e 2018-12-05 release fibers when loops have finished File  Diff  Annotate
20:2f11b93f4cbf 2018-12-05 use btn B to change display state (bright, low, off) File  Diff  Annotate
19:52e19461e867 2018-12-05 fix data log wipe File  Diff  Annotate
18:c4ac93e01027 2018-12-05 data logging for sgp30 File  Diff  Annotate
17:a2c4dd192146 2018-12-05 more logging File  Diff  Annotate
14:71060505061e 2018-12-05 more flexible nvstore File  Diff  Annotate
13:996026828be7 2018-12-05 update status of sgp onmeasurements File  Diff  Annotate
12:96eb06e837f4 2018-12-05 independent fibres/loops for bme and agp measuring File  Diff  Annotate
11:6844a5578b4f 2018-12-04 code cleanup / smaller functions File  Diff  Annotate
10:8e6b71a46871 2018-12-04 store bme680 max gas resistence File  Diff  Annotate
9:5150afa50eb6 2018-12-04 re-init sensors on btn AB File  Diff  Annotate
8:1bdb50e03d39 2018-12-04 display more data on btn B File  Diff  Annotate
7:80429cbd095f 2018-12-04 properly schedule measure loop at start File  Diff  Annotate
6:fc6f2f08724b 2018-12-04 fixup sgp30 self test File  Diff  Annotate
5:9a04d6d0c2ff 2018-12-04 cleanup UI (less text, more dots) File  Diff  Annotate
4:aef0bddcdf50 2018-12-04 less display.scroll / more information in dots File  Diff  Annotate
3:6084ab9ff0c9 2018-12-04 handle cases where only one sensor is present File  Diff  Annotate
2:544117df8c65 2018-12-04 sgp30 File  Diff  Annotate
1:f9245fb53737 2018-12-03 add humidity physics File  Diff  Annotate
0:cef60cc92da0 2018-12-03 initial bme680 File  Diff  Annotate