{"id":3738,"date":"2023-11-18T07:17:03","date_gmt":"2023-11-18T15:17:03","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3738"},"modified":"2023-11-18T07:17:03","modified_gmt":"2023-11-18T15:17:03","slug":"project-28-sensors-sparkfun-environmental-combo-ccs811-bme280-mk09","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3738","title":{"rendered":"Project #28 &#8211; Sensors &#8211; SparkFun Environmental Combo CCS811\/BME280 &#8211; Mk09"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3738-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Sensors #CCS811 #BME280 #TSOP85 #TMP102 #LineSensor #AlcoholGasSensor #MinIMU9 #Pololu #Adafruit #SparkFun #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03a.png\" alt=\"SparkFun Environmental Combo CCS811\/BME280\" width=\"720\" height=\"523\" class=\"alignnone size-full wp-image-3740\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03a-300x218.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03b.png\" alt=\"SparkFun Environmental Combo CCS811\/BME280\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3741\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03c.png\" alt=\"SparkFun Environmental Combo CCS811\/BME280\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3742\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/11\/DL2309Mk03c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>SparkFun Environmental Combo &#8211; CCS811\/BME280<\/strong><\/p>\n<p>The SparkFun CCS811\/BME280 Environmental Combo Breakout takes care of all your atmospheric-quality sensing needs with the popular CCS811 and BME280 ICs. This unique breakout provides a variety of environmental data, including barometric pressure, humidity, temperature, TVOCs and equivalent eCO2 levels.<\/p>\n<p>The CCS811 is an exceedingly popular sensor, providing readings for equivalent eCO2 in the parts per million (PPM) and total volatile organic compounds in the parts per billion (PPB). The CCS811 also has a feature that allows it to fine-tune its readings if it has access to the current humidity and temperature. Luckily for us, the BME280 provides humidity, temperature and barometric pressure. This allows the sensors to work together to give us more accurate readings than they\u2019d be able to provide on their own. We also made it easy to interface with them via I2C.<\/p>\n<p><strong>DL2309Mk03<\/strong><\/p>\n<p>1 x Adafruit METRO M0 Express<br \/>\n1 x DS3231 Precision RTC FeatherWing<br \/>\n1 x Pololu MinIMU-9 v5 Gyro, Accelerometer, and Compass<br \/>\n1 x Pololu Carrier for MQ Gas Sensors<br \/>\n1 x Alcohol Gas Sensor &#8211; MQ-3<br \/>\n1 x SparkFun Line Sensor &#8211; QRE1113<br \/>\n1 x SparkFun Digital Temperature Sensor &#8211; TMP102<br \/>\n1 x SparkFun IR Receiver &#8211; TSOP85<br \/>\n1 x SparkFun Environmental Combo &#8211; CCS811\/BME280<br \/>\n1 x LED Red<br \/>\n1 x ProtoScrewShield<br \/>\n1 x Rocker Switch &#8211; SPST<br \/>\n2 x Resistor 10K Ohm<br \/>\n1 x CR1220 3V Lithium Coin Cell Battery<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Adafruit METRO M0 Express<\/strong><\/p>\n<p>LED &#8211; LED_BUILTIN<br \/>\nSDA &#8211; Digital 20<br \/>\nSCL &#8211; Digital 21<br \/>\nIRR &#8211; Digital 11<br \/>\nLER &#8211; Digital 3<br \/>\nSW1 &#8211; Digital 2<br \/>\nMQ3 &#8211; Analog 0<br \/>\nLSB &#8211; Analog 1<br \/>\nALE = Analog 3<br \/>\nVIN &#8211; +3.3V<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2309Mk03p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #28 - Sensors - SparkFun Environmental Combo CCS811\/BME280 - Mk09\r\n28-09\r\nDL2309Mk03p.ino\r\n1 x Adafruit METRO M0 Express\r\n1 x DS3231 Precision RTC FeatherWing\r\n1 x Pololu MinIMU-9 v5 Gyro, Accelerometer, and Compass\r\n1 x Pololu Carrier for MQ Gas Sensors\r\n1 x Alcohol Gas Sensor - MQ-3\r\n1 x SparkFun Line Sensor - QRE1113\r\n1 x SparkFun Digital Temperature Sensor - TMP102\r\n1 x SparkFun IR Receiver - TSOP85\r\n1 x SparkFun Environmental Combo - CCS811\/BME280\r\n1 x LED Red\r\n1 x ProtoScrewShield\r\n1 x Rocker Switch - SPST\r\n2 x Resistor 10K Ohm\r\n1 x CR1220 3V Lithium Coin Cell Battery\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ DS3231 Precision RTC \r\n#include &lt;RTClib.h&gt;\r\n\/\/ Two Wire Interface (TWI\/I2C)\r\n#include &lt;Wire.h&gt;\r\n\/\/ Keyboard\r\n#include &lt;Keyboard.h&gt;\r\n\/\/ Includes and variables for IMU integration\r\n\/\/ STMicroelectronics LSM6DS33 Gyroscope and Accelerometer\r\n#include &lt;LSM6.h&gt;\r\n\/\/ STMicroelectronics LIS3MDL Magnetometer\r\n#include &lt;LIS3MDL.h&gt;\r\n\/\/ SparkFun Digital Temperature Sensor TMP102\r\n#include &lt;SparkFunTMP102.h&gt;\r\n\/\/ SparkFun IR Receiver - TSOP85\r\n#include &lt;IRremote.h&gt;\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude\r\n#include &lt;SparkFunBME280.h&gt;\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n#include &lt;SparkFunCCS811.h&gt;\r\n\r\n\/\/ Keyboard\r\nString sKeyboard = &quot;&quot;;\r\n\r\n\/\/ DS3231 Precision RTC \r\nRTC_DS3231 rtc;\r\nString dateRTC = &quot;&quot;;\r\nString timeRTC = &quot;&quot;;\r\n\r\n\/\/ Pololu 9DoF IMU\r\n\/\/ STMicroelectronics LSM6DS33 Gyroscope and Accelerometer\r\nLSM6 imu;\r\n\/\/ Accelerometer and Gyroscopes\r\n\/\/ Accelerometer\r\nint imuAX;\r\nint imuAY;\r\nint imuAZ;\r\n\/\/ Gyroscopes \r\nint imuGX;\r\nint imuGY;\r\nint imuGZ;\r\n\/\/ STMicroelectronics LIS3MDL Magnetometer\r\nLIS3MDL mag;\r\n\/\/ Magnetometer\r\nint magX;\r\nint magY;\r\nint magZ;\r\n\r\n\/\/ Gas Sensors MQ\r\n\/\/ Alcohol Gas Sensor - MQ-3\r\nint iMQ3 = A0;\r\nint iMQ3Raw = 0;\r\nint iMQ3ppm = 0;\r\n\r\n\/\/ SparkFun Line Sensor - QRE1113 (Analog)\r\nint iLine = A1;\r\nint iLineSensor = 0;\r\n\r\n\/\/ SparkFun Digital Temperature Sensor TMP102\r\nconst int ALERT_PIN = A3;\r\nTMP102 sensor0;\r\nfloat temperature;\r\nboolean alertPinState;\r\nboolean alertRegisterState;\r\n\r\n\/\/ SparkFun IR Receiver - TSOP85\r\nint RECV_PIN = 11;\r\nIRrecv irrecv(RECV_PIN);\r\ndecode_results results;\r\nString IRValue = &quot;&quot;;\r\nint iLEDRed = 3;\r\n\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude\r\nBME280 myBME280;\r\nfloat BMEtempC = 0;\r\nfloat BMEhumid = 0;\r\nfloat BMEpressure = 0;\r\nfloat BMEaltitudeM = 0;\r\n\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n\/\/ Default I2C Address\r\n#define CCS811_ADDR 0x5B \r\nCCS811 myCCS811(CCS811_ADDR);\r\nfloat CCS811CO2 = 0;\r\nfloat CCS811TVOC = 0;\r\n\r\n\/\/ The number of the Rocker Switch pin\r\nint iSwitch = 2;\r\n\/\/ Variable for reading the button status\r\nint SwitchState = 0;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;28-09&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Date and Time RTC\r\n  isRTC ();\r\n\r\n  \/\/ Pololu Accelerometer and Gyroscopes\r\n  isIMU();\r\n\r\n  \/\/ Pololu Magnetometer\r\n  isMag();\r\n\r\n  \/\/ Gas Sensors MQ\r\n  isGasSensor();\r\n\r\n  \/\/ SparkFun Line Sensor\r\n  isLineSensor();\r\n\r\n  \/\/ SparkFun Temperature TMP102\r\n  isTMP102();\r\n\r\n  \/\/ SparkFun IR Receiver - TSOP85\r\n  isIR();\r\n\r\n  \/\/ SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude\r\n  isBME280();\r\n\r\n  \/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n  isCCS811();\r\n\r\n  \/\/ Read the state of the Switch value:\r\n  SwitchState = digitalRead(iSwitch);\r\n\r\n  \/\/ Check if the button is pressed. If it is, the SwitchState is HIGH:\r\n  if (SwitchState == HIGH) {\r\n\r\n     Keyboard.println(sKeyboard);\r\n    \r\n  }\r\n\r\n  \/\/ Delay 1 Second\r\n  delay(1000);\r\n\r\n}\r\n<\/pre>\n<p><strong>getAccelGyro.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Accelerometer and Gyroscopes\r\n\/\/ Setup IMU\r\nvoid setupIMU() {\r\n\r\n  \/\/ Setup IMU\r\n  imu.init();\r\n  \/\/ Default\r\n  imu.enableDefault();\r\n  \r\n}\r\n\/\/ Accelerometer and Gyroscopes\r\nvoid isIMU() {\r\n\r\n  \/\/ Accelerometer and Gyroscopes\r\n  imu.read();\r\n  \/\/ Accelerometer x, y, z\r\n  imuAX = imu.a.x;\r\n  imuAY = imu.a.y;\r\n  imuAZ = imu.a.z;\r\n  \/\/ Gyroscopes x, y, z\r\n  imuGX = imu.g.x;\r\n  imuGY = imu.g.y;\r\n  imuGZ = imu.g.z;\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(imuAX) + &quot;|&quot; + String(imuAY) + &quot;|&quot;\r\n  + String(imuAZ) + &quot;|&quot;;\r\n  sKeyboard = sKeyboard + String(imuGX) + &quot;|&quot; + String(imuGY) + &quot;|&quot;\r\n  + String(imuGZ) + &quot;|&quot;;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getBME280.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude\r\n\/\/ isBME280 - Temperature, Humidity, Barometric Pressure, and Altitude\r\nvoid isBME280(){\r\n\r\n  \/\/ Temperature Celsius\r\n  BMEtempC = myBME280.readTempC();\r\n  \/\/ Humidity\r\n  BMEhumid = myBME280.readFloatHumidity();\r\n  \/\/ Barometric Pressure\r\n  BMEpressure = myBME280.readFloatPressure();\r\n  \/\/ Altitude Meters\r\n  BMEaltitudeM = (myBME280.readFloatAltitudeMeters(), 2);\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(BMEtempC) + &quot;|&quot; + String(BMEhumid) + &quot;|&quot; +\r\n  String(BMEpressure) + &quot;|&quot; + String(BMEaltitudeM) + &quot;|&quot;;\r\n\r\n}\r\n<\/pre>\n<p><strong>getCCS811.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ CCS811 - eCO2 &amp; tVOC\r\n\/\/ isCCS811 - eCO2 &amp; tVOC\r\nvoid isCCS811(){\r\n\r\n  \/\/ This sends the temperature &amp; humidity data to the CCS811\r\n  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);\r\n\r\n  \/\/ Calling this function updates the global tVOC and eCO2 variables\r\n  myCCS811.readAlgorithmResults();\r\n\r\n  \/\/ eCO2 Concentration\r\n  CCS811CO2 = myCCS811.getCO2();\r\n  \r\n  \/\/ tVOC Concentration\r\n  CCS811TVOC = myCCS811.getTVOC();\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(CCS811CO2) + &quot;|&quot; + String(CCS811TVOC) + &quot;|*&quot;;\r\n\r\n}\r\n<\/pre>\n<p><strong>getGasSensorMQ.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Gas Sensors MQ\r\n\/\/ Gas Sensor\r\nvoid isGasSensor() {\r\n\r\n  \/\/ Read in analog value from each gas sensors\r\n  \/\/ Alcohol Gas Sensor - MQ-3\r\n  iMQ3ppm = isMQ3( iMQ3Raw );\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(iMQ3ppm) + &quot;|&quot;;\r\n\r\n}\r\n\/\/ Alcohol Gas Sensor - MQ-3\r\nint isMQ3(double rawValue) {\r\n\r\n  double RvRo = rawValue;\r\n  \/\/ % BAC = breath mg\/L * 0.21\r\n  double bac = RvRo * 0.21;\r\n  return bac;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getIMUMagnetometer.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ IMU Magnetometer\r\n\/\/ Setup Magnetometer\r\nvoid setupMag() {\r\n\r\n  \/\/ Setup Magnetometer\r\n  mag.init();\r\n  \/\/ Default\r\n  mag.enableDefault();\r\n  \r\n}\r\n\/\/ Magnetometer\r\nvoid isMag() {\r\n\r\n  \/\/ Magnetometer\r\n  mag.read();\r\n  \/\/ Magnetometer x, y, z\r\n  magX = mag.m.x;\r\n  magY = mag.m.y;\r\n  magZ = mag.m.z;\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(magX) + &quot;|&quot; + String(magY) + &quot;|&quot; \r\n  + String(magZ) + &quot;|&quot;;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getIRRemote.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun IR Receiver - TSOP85\r\n\/\/ Setup\r\nvoid isSetupIR(){\r\n\r\n  \/\/ Initialize digital pin LED Red as an output\r\n  pinMode(iLEDRed, OUTPUT);\r\n  \r\n  \/\/ Start the receiver\r\n  irrecv.enableIRIn();\r\n  \r\n}\r\n\/\/\r\nvoid isIR(){\r\n\r\n  if (irrecv.decode(&amp;results))\r\n  {\r\n    \r\n    \/\/ LED Red HIGH\r\n    digitalWrite(iLEDRed, HIGH);\r\n    \r\n    \/\/Serial.print(&quot;IR RECV Code = 0x &quot;);\r\n    \/\/Serial.println(results.value, HEX);\r\n\r\n    IRValue = &quot;0x &quot;;\r\n    IRValue = IRValue + String(results.value, HEX);\r\n\r\n    \/\/ LED Red LOW\r\n    digitalWrite(iLEDRed, LOW);\r\n\r\n    \/\/ IR Resume\r\n    irrecv.resume();\r\n    \r\n  }\r\n  else {\r\n\r\n    IRValue = &quot;0&quot;;\r\n    \r\n  }\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(IRValue) + &quot;|&quot;;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getLineSensor.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Line Sensor\r\n\/\/ isLine Sensor\r\nvoid isLineSensor(){\r\n\r\n  \/\/ Line Sensor\r\n  iLineSensor = analogRead(iLine);\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(iLineSensor) + &quot;|&quot;;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRTC.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Date &amp; Time\r\n\/\/ DS3231 Precision RTC\r\nvoid setupRTC() {\r\n\r\n  \/\/ DS3231 Precision RTC\r\n  if (! rtc.begin()) {\r\n    \/\/Serial.println(&quot;Couldn&#039;t find RTC&quot;);\r\n    \/\/Serial.flush();\r\n    while (1) delay(10);\r\n  }\r\n\r\n  if (rtc.lostPower()) {\r\n    \/\/Serial.println(&quot;RTC lost power, let&#039;s set the time!&quot;);\r\n    \/\/ When time needs to be set on a new device, or after a power loss, the\r\n    \/\/ following line sets the RTC to the date &amp; time this sketch was compiled\r\n    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\r\n    \/\/ This line sets the RTC with an explicit date &amp; time, for example to set\r\n    \/\/ January 21, 2014 at 3am you would call:\r\n    \/\/rtc.adjust(DateTime(2023, 8, 10, 11, 0, 0));\r\n  }\r\n  \r\n}\r\n\/\/ Date and Time RTC\r\nvoid isRTC () {\r\n\r\n  \/\/ Date and Time\r\n  dateRTC = &quot;&quot;;\r\n  timeRTC = &quot;&quot;;\r\n  DateTime now = rtc.now();\r\n  \r\n  \/\/ Date\r\n  dateRTC = now.year(), DEC; \r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  dateRTC = dateRTC + now.month(), DEC;\r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  dateRTC = dateRTC + now.day(), DEC;\r\n\r\n  \/\/ Time\r\n  timeRTC = now.hour(), DEC;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  timeRTC = timeRTC + now.minute(), DEC;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  timeRTC = timeRTC + now.second(), DEC;\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = &quot;SEN|&quot; + sver + &quot;|&quot; + String(dateRTC) + &quot;|&quot; + \r\n  String(timeRTC) + &quot;|&quot;;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getTempTMP102.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun Digital Temperature Sensor TMP102\r\n\/\/ Setup TMP102\r\nvoid isSetupTMP102(){\r\n\r\n  \/\/ Declare alertPin as an input\r\n  pinMode(ALERT_PIN,INPUT);\r\n  \r\n  \/\/ Begin\r\n  \/\/It will return true on success or false on failure to communicate\r\n  if(!sensor0.begin())\r\n  {\r\n    \r\n    while(1);\r\n    \r\n  }\r\n  \r\n  \/\/ set the Conversion Rate\r\n  \/\/0-3: 0:0.25Hz, 1:1Hz, 2:4Hz, 3:8Hz\r\n  sensor0.setConversionRate(2);\r\n  \r\n  \/\/set Extended Mode.\r\n  \/\/0:12-bit Temperature(-55C to +128C) 1:13-bit Temperature(-55C to +150C)\r\n  sensor0.setExtendedMode(0);\r\n  \r\n  \/\/ Set T_HIGH, the upper limit to trigger the alert on\r\n  \/\/ Set T_HIGH in C\r\n  sensor0.setHighTempC(29.4);\r\n  \r\n  \/\/ Set T_LOW, the lower limit to shut turn off the alert\r\n  \/\/ set T_LOW in C\r\n  sensor0.setLowTempC(27.67);\r\n\r\n}\r\n\/\/ is TMP102\r\nvoid isTMP102(){\r\n\r\n  \/\/ Turn sensor on to start temperature measurement.\r\n  \/\/ Current consumtion typically ~10uA.\r\n  sensor0.wakeup();\r\n\r\n  \/\/ read temperature data C\r\n  temperature = sensor0.readTempC();\r\n\r\n  \/\/ Check for Alert\r\n  \/\/ Read the Alert from pin\r\n  alertPinState = digitalRead(ALERT_PIN);\r\n  \r\n  \/\/ Read the Alert from register\r\n  alertRegisterState = sensor0.alert();\r\n  \r\n  \/\/ Place sensor in sleep mode to save power.\r\n  \/\/ Current consumtion typically &lt;0.5uA.\r\n  sensor0.sleep();\r\n\r\n  \/\/ Keyboard\r\n  sKeyboard = sKeyboard + String(temperature) + &quot;|&quot; + \r\n  String(alertPinState) + &quot;|&quot; + String(alertRegisterState) + &quot;|&quot;;\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n  \r\n  \/\/ Give display time to power on\r\n  delay(100);\r\n  \r\n  \/\/ Wire - Inialize I2C Hardware\r\n  Wire.begin();\r\n\r\n  \/\/ Give display time to power on\r\n  delay(100);\r\n\r\n  \/\/ Date &amp; Time RTC\r\n  \/\/ DS3231 Precision RTC \r\n  setupRTC();\r\n  \r\n  \/\/ Initialize control over the keyboard:\r\n  Keyboard.begin();\r\n\r\n  \/\/ Pololu Setup IMU\r\n  setupIMU();\r\n\r\n  \/\/ Pololu Setup Magnetometer\r\n  setupMag();\r\n\r\n  \/\/ Setup TMP102\r\n  isSetupTMP102();\r\n\r\n  \/\/ SetupTSOP85\r\n  isSetupIR();\r\n\r\n  \/\/ SparkFun BME280 - Temperature, Humidity, Barometric Pressure, and Altitude \r\n  myBME280.begin();\r\n\r\n  \/\/ CCS811 - eCO2 &amp; tVOC\r\n  myCCS811.begin();\r\n\r\n  \/\/ Initialize the Switch pin as an input\r\n  pinMode(iSwitch, INPUT);\r\n\r\n  \/\/ Initialize digital pin LED_BUILTIN as an output\r\n  pinMode(LED_BUILTIN, OUTPUT);\r\n  \/\/ Turn the LED on HIGH\r\n  digitalWrite(LED_BUILTIN, HIGH);\r\n\r\n  \/\/ Delay 5 Second\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>RTOS<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor, E-Mentor, STEAM, and Arts-Based Training<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2023<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #Sensors #CCS811 #BME280 #TSOP85 #TMP102 #LineSensor #AlcoholGasSensor #MinIMU9 #Pololu #Adafruit #SparkFun #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; SparkFun Environmental Combo &#8211; CCS811\/BME280 The SparkFun CCS811\/BME280 Environmental Combo Breakout takes care of all your atmospheric-quality sensing needs with the popular CCS811 and BME280 ICs. This unique breakout provides &#8230; <a title=\"Project #28 &#8211; Sensors &#8211; SparkFun Environmental Combo CCS811\/BME280 &#8211; Mk09\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3738\" aria-label=\"Read more about Project #28 &#8211; Sensors &#8211; SparkFun Environmental Combo CCS811\/BME280 &#8211; Mk09\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[294,47,50,49,38,59,5,46,287,58,10,43],"tags":[251,86,6,102,4,19,85,252,246,24,103,9,27,248,109,171,33,34,108],"class_list":["post-3738","post","type-post","status-publish","format-standard","hentry","category-sensors","category-adafruit","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-pololu","category-program","category-arduino-programming","category-projects","category-sparkfun","tag-accelerometer","tag-adafruit","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-gyroscope","tag-magnetometer","tag-microcontroller","tag-pololu","tag-programming","tag-projects-2","tag-sensors","tag-sparkfun","tag-sparkfun-environmental-combo-ccs811-bme280","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3738"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3738\/revisions"}],"predecessor-version":[{"id":3743,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3738\/revisions\/3743"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}