User Tools

Site Tools


amc2022:groups:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
amc2022:groups:start [2022/09/09 21:08] – [Results and Discussion] emilie001amc2022:groups:start [2022/09/10 23:57] (current) – [Video] emilie001
Line 13: Line 13:
   * 10k potentiometer   * 10k potentiometer
   * 220 ohm resistor   * 220 ohm resistor
-  * Bread boards+  * Breadboards
   * male-to-male jumper cable   * male-to-male jumper cable
  
 ====Elegoo Uno==== ====Elegoo Uno====
-The Elegoo Uno is a microcontroller board that can be programmed with Arduino IDE. It has several pins than be set as in or output for data with using different functions. By installing additional libraries into Arduino IDE the board is able to communicate with a variety of sensors modules and other micro controllers the board has a great range of use.+The Elegoo Uno is a microcontroller board that can be programmed with Arduino IDE. It has several pins than can be set as in or output for data by using different functions. By installing additional libraries into Arduino IDE the board is able to communicate with a variety of sensor modules and other microcontrollers the board has a great range of use.
 ===How to use the Elegoo Uno===  ===How to use the Elegoo Uno=== 
 As mentioned above the Uno is programable with Arduino IDE. To program it you have to connect the board via USB. The written code can then be compiled and uploaded onto the microcontroller.  As mentioned above the Uno is programable with Arduino IDE. To program it you have to connect the board via USB. The written code can then be compiled and uploaded onto the microcontroller. 
 ====LCD Display==== ====LCD Display====
-The LCD display can be used to print values obtained from the measurement of a sensor. It can be used instead of the serial monitor to make a system independent and mobile. The display needs a 5V power supply. Depending on how many of the pins are utilized it can either be used in 4-bit or 8-bit mode. Because of limited availability of digital output pins on the Eleggoo Uno  4-bit or 4-wire mode is usually preferred.+The LCD display can be used to print values obtained from the measurement of a sensor. It can be used instead of the serial monitor to make a system independent and mobile. The display needs a 5V power supply. Depending on how many of the pins are utilized it can either be used in 4-bit or 8-bit mode. Because of the limited availability of digital output pins on the Eleggoo Uno  4-bit or 4-wire mode is usually preferred.
  
 ===How to use the LCD=== ===How to use the LCD===
Line 70: Line 70:
  
 ===How to use DHT11=== ===How to use DHT11===
-In order to use the sensor module it has to be appropriately connected to the microcontroller board. The module has three pins, VCC, Ground and a data pin (see <imgref dht11.jpeg>). The VCC is connected to the 5V power outlet, GND is connected to GND and the data pin is connected to a digital output pin.\\ To program the sensor the right Arduino library has to be installed, in this case the DHT.h library. To test if the sensor was set up properly the following code was used. The heat index was mainly included to test printing characters in as many positions of the LCD as possible and would later be replaced with the CO<sub>2</sub> concentration.+In order to use the sensor moduleit has to be appropriately connected to the microcontroller board. The module has three pins, VCC, Ground and a data pin (see <imgref dht11.jpeg>). The VCC is connected to the 5V power outlet, GND is connected to GND and the data pin is connected to a digital output pin.\\ To program the sensor the right Arduino library has to be installed, in this case the DHT.h library. To test if the sensor was set up properly the following code was used. The heat index was mainly included to test printing characters in as many positions of the LCD as possible and would later be replaced with the CO<sub>2</sub> concentration.
  
 <code c++> <code c++>
Line 96: Line 96:
 float temp = dht.readTemperature(); // Read temperature in celcius float temp = dht.readTemperature(); // Read temperature in celcius
 float hum = dht.readHumidity(); // Read relative humidity in % float hum = dht.readHumidity(); // Read relative humidity in %
-float hi = dht.computeHeatIndex(temp, hum); // Heat index gives the temperature that is felt by humans; dependend on temp. & humidity+float hi = dht.computeHeatIndex(temp, hum); // Heat index gives the temperature that is felt by humans; depending on temp. & humidity
  
 lcd.setCursor(0,0); // setCursor function sets where the text start 0 is the first line and first field lcd.setCursor(0,0); // setCursor function sets where the text start 0 is the first line and first field
Line 120: Line 120:
 <WRAP group> <WRAP group>
 <WRAP half column> <WRAP half column>
-The MQ 135 is a sensor that measures the concentration of CO2 and other gases in air. It needs a 5V power supply to operate and has a working current of 150mA. The module has one digital and one analog pin for data output. The material used to sense the gas concentration is SnO<sub>2</sub> which is a metal oxide semiconductor which changes its resistance in contact with gases. R<sub>0</sub> is the internal resistance of the sensor in clean air, and R<sub>S</sub> is the resistance of the sensor in contact with different gases. With the R<sub>0</sub> and R<sub>S</sub> values the concentration in ppm can be calculated. The stainless steal mesh layer as seen in <imgref mq135.jpeg> is there to protect the sensor from particular matter and other disturbances.+The MQ 135 is a sensor that measures the concentration of CO2 and other gases in air. It needs a 5V power supply to operate and has a working current of 150mA. The module has one digital and one analog pin for data output. The material used to sense the gas concentration is SnO<sub>2</sub> which is a metal oxide semiconductor which changes its resistance in contact with gases. R<sub>0</sub> is the internal resistance of the sensor in clean air, and R<sub>S</sub> is the resistance of the sensor in contact with different gases. With the R<sub>0</sub> and R<sub>S</sub> values the concentration in ppm can be calculated. The stainless steel mesh layer as seen in <imgref mq135.jpeg> is there to protect the sensor from particular matter and other disturbances.
 </WRAP> </WRAP>
  
Line 159: Line 159:
  
 The project went through different development phases. The circuit as well as the code have been changed over time. Every sensor was tested separately before combining the system together. At first, the LCD display was set up as the basis of the project as described [[https://wiki.eolab.de/doku.php?id=amc2022:groups:start#LCD Display|above]]. Then the DHT11 was added next. After that, the RTC was initiated and incorporated to print the time on the LCD. Lastly, the MQ135 was calibrated and added to the system. Initially, the LCD showed the heat index obtained by the DHT11, which was replaced by the CO<sub>2</sub> concentration. Because of lacking space on the display, the concentration is not displayed with its appropriate unit (ppm) and CO<sub>2</sub> had to be abbreviated as "C" The calibration and troubleshooting process for the MQ135 is further described in the chapter [[https://wiki.eolab.de/doku.php?id=amc2022:groups:start#Results and Discussion|Results and Discussion]]. The project went through different development phases. The circuit as well as the code have been changed over time. Every sensor was tested separately before combining the system together. At first, the LCD display was set up as the basis of the project as described [[https://wiki.eolab.de/doku.php?id=amc2022:groups:start#LCD Display|above]]. Then the DHT11 was added next. After that, the RTC was initiated and incorporated to print the time on the LCD. Lastly, the MQ135 was calibrated and added to the system. Initially, the LCD showed the heat index obtained by the DHT11, which was replaced by the CO<sub>2</sub> concentration. Because of lacking space on the display, the concentration is not displayed with its appropriate unit (ppm) and CO<sub>2</sub> had to be abbreviated as "C" The calibration and troubleshooting process for the MQ135 is further described in the chapter [[https://wiki.eolab.de/doku.php?id=amc2022:groups:start#Results and Discussion|Results and Discussion]].
- 
- 
  
  
Line 258: Line 256:
   * The relative humidity suddenly was lower than during any test before. Usually varying from 45 to 60% it suddenly never measured a value over 40% even when placed in rooms with higher humidity.   * The relative humidity suddenly was lower than during any test before. Usually varying from 45 to 60% it suddenly never measured a value over 40% even when placed in rooms with higher humidity.
 As the MQ135 heats up significantly when in use this might be an explanation for the changed results of the DHT11. To test that the MQ135 was removed from the breadboard to eliminate the suspected interference. The DHT11 still measured temperatures that were unrealistic. Right next to an open window and an outside temperature of 20°C the sensor showed a temperature of 25°C. Even with the expected margin of error that measurement is not reasonable. The humidity measurements seemed to improve, returning to their previous range between 45 and 60%.\\ As the MQ135 heats up significantly when in use this might be an explanation for the changed results of the DHT11. To test that the MQ135 was removed from the breadboard to eliminate the suspected interference. The DHT11 still measured temperatures that were unrealistic. Right next to an open window and an outside temperature of 20°C the sensor showed a temperature of 25°C. Even with the expected margin of error that measurement is not reasonable. The humidity measurements seemed to improve, returning to their previous range between 45 and 60%.\\
-Additionally, the CO<sub>2</sub> concentrations were always above the recommended 1400 ppm. Often the measurement was well over 3000 ppm even after airing out for a long period of time. According to the MQ135 [[https://cdn.shopify.com/s/files/1/1509/1638/files/MQ-135_Gas_Sensor_Modul_Datenblatt_AZ-Delivery_Vertriebs_GmbH_94c8b153-6f8e-4696-8cfa-0d8ba832d603.pdf?v=1608535104|datasheet]] the sensor needs a period of up to 48 hours to preheat. But even after over 96 hours without interruption, the measurements were still too high.\\ Additional sources suggested that the MQ135 had to be calibrated by heating up and then measuring and manually correcting the given R<sub>0</sub> in the MQ135 library. After changing the R<sub>0</sub> from originally 76.63 to 45.68 the quality of the measurement did not increase.\\ Lastly, the sensitivity of the sensor module was adjusted by turning the on-board potentiometer on the back of the sensor module. With each change in sensitivity, the sensor ran for at least one hour. Although there was a definite change in the measurements even at the lowest sensitivity the value for the CO<sub>2</sub> concentration was constantly above 1200 ppm at first.\\ After randomly pulling the plug and putting it back in the concentration varied between 250 and 650 ppm at the lowest sensitivity setting. It cannot distinctly be concluded what fixed the sensor’s measurement. Even though the obtained values for the CO<sub>2</sub> concentration seem much more appropiate, it cannot be said for sure whether they are correct or not.+Additionally, the CO<sub>2</sub> concentrations were always above the recommended 1400 ppm. Often the measurement was well over 3000 ppm even after airing out for a long period of time. According to the MQ135 [[https://cdn.shopify.com/s/files/1/1509/1638/files/MQ-135_Gas_Sensor_Modul_Datenblatt_AZ-Delivery_Vertriebs_GmbH_94c8b153-6f8e-4696-8cfa-0d8ba832d603.pdf?v=1608535104|datasheet]] the sensor needs a period of up to 48 hours to preheat. But even after over 96 hours without interruption, the measurements were still too high.\\ Additional sources suggested that the MQ135 had to be calibrated by heating up and then measuring and manually correcting the given R<sub>0</sub> in the MQ135 library. After changing the R<sub>0</sub> from originally 76.63 to 45.68 the quality of the measurement did not increase. This code was used to obtain the new R<sub>0</sub> displayed in the serial monitor. The value was only changed after the sensor ran for at least 24 hours undisturbed and did not change anymore. 
 +<code c++> 
 +#include "MQ135.h" 
 +void setup (){ 
 +Serial.begin (9600); 
 +
 +void loop() { 
 +MQ135 gasSensor = MQ135(A0); // Attach sensor to pin A0 
 +float rzero = gasSensor.getRZero(); 
 +Serial.println (rzero); 
 +delay(1000); 
 +
 +</code> 
 + 
 +Lastly, the sensitivity of the sensor module was adjusted by turning the on-board potentiometer on the back of the sensor module. With each change in sensitivity, the sensor ran for at least one hour. Although there was a definite change in the measurements even at the lowest sensitivity the value for the CO<sub>2</sub> concentration was constantly above 1200 ppm at first.\\ After randomly pulling the plug and putting it back in the concentration varied between 350 and 1000 ppm at the lowest sensitivity setting. It cannot distinctly be concluded what improved the sensor’s measurements. Even though the obtained values for the CO<sub>2</sub> concentration seem much more appropriate, it cannot be said for sure whether they are correct or not.
 =====Conclusion and Outlook===== =====Conclusion and Outlook=====
 All in all, the system is functional. The communication between the sensors, the microcontroller and the LCD is working. It is unsure how accurate the obtained measurements are but as it is the system could be used as tool to give meaningful information and improve indoor air quality.\\ All in all, the system is functional. The communication between the sensors, the microcontroller and the LCD is working. It is unsure how accurate the obtained measurements are but as it is the system could be used as tool to give meaningful information and improve indoor air quality.\\
-Building and expanding the system stepwise helped to understand the different components and the code better. If this same project had to be recreated a bigger LCD and a more controllable environment to calibrate and set-up the gas sensor would be recommended. The bigger LCD would increase the accessibility and even more variables could be displayed. Additionally, things like the unit of CO<sub>2</sub> concentration could be included with no problem.+Building and expanding the system stepwise helped to understand the different components and the code better. If this same project had to be recreated a bigger LCD and a more controllable environment to calibrate and set-up the gas sensor would be recommended. The bigger LCD would increase the accessibility and even more variables could be displayed. Additionally, things like the unit of CO<sub>2</sub> concentration could be included with no problem.\\ 
 + 
 +====Video==== 
 +{{youtube>fCxlqfbRjq8?}} 
 + 
  
  
 =====References===== =====References=====
 +  * https://cdn.shopify.com/s/files/1/1509/1638/files/MQ-135_Gas_Sensor_Modul_Datenblatt_AZ-Delivery_Vertriebs_GmbH_94c8b153-6f8e-4696-8cfa-0d8ba832d603.pdf?v=1608535104
 +  * https://circuitdigest.com/article/16x2-lcd-display-module-pinout-datasheet
 +  * https://elektro.turanis.de/html/prj060/index.html
 +  * https://epow0.org/~amki/car_kit/Datasheet/ELEGOO%20UNO%20R3%20Board.pdf
 +  * https://www.mouser.com/datasheet/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf
 +  * https://www.olimex.com/Products/Components/Sensors/Gas/SNS-MQ135/resources/SNS-MQ135.pdf
 +  * https://www.roboter-bausatz.de/projekte/dht11-temperatur-sensor-per-arduino-auslesen
 +  * https://www.sparkfun.com/datasheets/Components/DS1307.pdf
 +  * https://www.umweltbundesamt.de/sites/default/files/medien/pdfs/kohlendioxid_2008.pdf
 +
amc2022/groups/start.1662750481.txt.gz · Last modified: 2022/09/09 21:08 by emilie001