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

Changes

RevisionDateWhoCommit message
60:6b21ca38ee7c 2022-06-03 jsa1969 cleanup default tip
59:1ca41f08b6a4 2022-06-03 jsa1969 send less data to partner microbit
58:4f6061b6f65a 2022-06-03 jsa1969 fix overflow issue in radio
57:1687d6e37410 2022-03-09 jsa1969 more output
56:6a7142c84db5 2022-01-21 jsa1969 allow setting SGP30 baselins directly by sending a micro:bit radio command
55:f135f5e73273 2022-01-20 jsa1969 fix non volatile storage test
54:7a73502d5308 2022-01-20 jsa1969 some more tests
53:d560c097f1b4 2022-01-20 jsa1969 fix storage of SGP30 baseline
52:112eaa5282c6 2022-01-20 jsa1969 transmit more information
51:133f2fb8a7c5 2022-01-17 jsa1969 more delays when sending, had problems when distance was large
50:63442fd5e709 2022-01-17 jsa1969 fixed possible buffer overflow in radio module and wrong replies in base line set
49:bbb506b58e6e 2022-01-16 jsa1969 support switching light levels via btn B
48:52cad865a84f 2019-03-21 jsa1969 code cleanup (removed comments)
47:881bfe77a00a 2019-02-17 jsa1969 show bme680 gas res linear, not exponential
46:2fed2865a0f3 2019-02-15 jsa1969 finally up and running again, next steps: split nvstore into general and app specific functions, split ui from main, more tests
45:d6a9fd9c8200 2019-02-13 jsa1969 more unit tests
44:67a19da5f269 2019-02-13 jsa1969 more bme tweaking
43:f968ca84d4ed 2019-02-13 jsa1969 seems the stray values resulting from delay problems have finally been solved
42:ce269f988ac8 2019-02-13 jsa1969 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
41:8f891ea56b0d 2019-02-13 jsa1969 cleanup 2nd i2c Bus if not required
40:a67a880cb538 2019-02-13 jsa1969 for the moment: seperate the i2c busses of the chips and remove all locking
39:efe22f143e47 2019-02-13 jsa1969 moved debugging information
38:0f29a0ea64ca 2019-02-12 jsa1969 attempt to attack on the parrallel influence problem
37:9e15c0120f76 2019-02-12 jsa1969 fixup reasonable average logic
36:ea1d6572314e 2019-02-12 jsa1969 only use reasonable range checks on bme gas resistance for max value
35:5f9566f22a2a 2019-02-12 jsa1969 bugfix a return statement, next I need tests for nvstore
34:069c4f6d5b2c 2019-02-12 jsa1969 code cleanup
33:af2dfab24ca9 2019-02-12 jsa1969 tests and usage of moving average for bme gas resistence
32:2c923405660c 2019-02-03 jsa1969 use english terms for and in MovingAverage
31:3284adaf4804 2019-02-02 jsa1969 implements math function: gleitender Durchschnitt
30:2958c6c803b9 2018-12-15 jsa1969 do not store SGP30 min values in microbit.storage, because they are always 0/400
29:7b5a600b24d6 2018-12-15 jsa1969 comment on the number of values we store in microbit.storage
28:56273b8282ca 2018-12-14 jsa1969 no point displaying sgp300 min values, they are always 0/400
27:cb75a0c5c52a 2018-12-14 jsa1969 store bme680 gas resistance indexed by humidity
26:6138698d4e6b 2018-12-06 jsa1969 more sensitive reaction to measurement differences
25:ab53abf41a9e 2018-12-05 jsa1969 update readme
24:07a1d2e6914e 2018-12-05 jsa1969 release fibers when loops have finished
23:051e0add6516 2018-12-05 jsa1969 inserted readme
22:5a8bec9862db 2018-12-05 jsa1969 updated comments
21:01914186ee1d 2018-12-05 jsa1969 added license files for 3rd party open source libs
20:2f11b93f4cbf 2018-12-05 jsa1969 use btn B to change display state (bright, low, off)
19:52e19461e867 2018-12-05 jsa1969 fix data log wipe
18:c4ac93e01027 2018-12-05 jsa1969 data logging for sgp30
17:a2c4dd192146 2018-12-05 jsa1969 more logging
16:3a4b9a3ef2bb 2018-12-05 jsa1969 mention GitHub sources for bme680 and sgp30 code
15:8bb5c580d453 2018-12-05 jsa1969 more const nes
14:71060505061e 2018-12-05 jsa1969 more flexible nvstore
13:996026828be7 2018-12-05 jsa1969 update status of sgp onmeasurements
12:96eb06e837f4 2018-12-05 jsa1969 independent fibres/loops for bme and agp measuring
11:6844a5578b4f 2018-12-04 jsa1969 code cleanup / smaller functions
10:8e6b71a46871 2018-12-04 jsa1969 store bme680 max gas resistence
9:5150afa50eb6 2018-12-04 jsa1969 re-init sensors on btn AB
8:1bdb50e03d39 2018-12-04 jsa1969 display more data on btn B
7:80429cbd095f 2018-12-04 jsa1969 properly schedule measure loop at start
6:fc6f2f08724b 2018-12-04 jsa1969 fixup sgp30 self test
5:9a04d6d0c2ff 2018-12-04 jsa1969 cleanup UI (less text, more dots)
4:aef0bddcdf50 2018-12-04 jsa1969 less display.scroll / more information in dots
3:6084ab9ff0c9 2018-12-04 jsa1969 handle cases where only one sensor is present
2:544117df8c65 2018-12-04 jsa1969 sgp30
1:f9245fb53737 2018-12-03 jsa1969 add humidity physics