Breaking News

아두이노 이산화탄소 센서 측정

아두이노 이산화탄소 센서 측정

CO2센서 와  아두이노 연결화면

ZG01CV 센서 모듈을 이용하여 CO2 / 온도센서를 측정할수 있습니다.

회로 구성


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}
void loop() {
  // put your main code here, to run repeatedly:
  float CO2;
  float Temp;
  float CO2_Value = 0;
  float Temp_Value = 0;
  for(int i = 0; i < 100; i++)
  {
    CO2_Value = CO2_Value + analogRead(A0);
    Temp_Value = Temp_Value + analogRead(A1);
  }
  
  CO2_Value = CO2_Value / 100.0;
  CO2 = CO2_Value / 1024 * 5.0;
  CO2 = (CO2 * 3000/ 3;
  Temp_Value = Temp_Value / 100.0;
  Temp = Temp_Value / 1024 * 5.0;
  Temp = (Temp * 50/ 3;
  Serial.print("CO2= ");
  Serial.print(CO2);
  Serial.print(" ppm,");
  Serial.print("Temp= ");
  Serial.print(Temp);
  Serial.println(" C");
  
  delay(1000);
  
}
cs

시리얼 모니터

시리얼 플로우 화면입니다.
파란색 그래프는 CO2, 빨간색은 온도입니다.

시리얼 플로우

아래는 CO2 관련 공기 오염 정보입니다.




댓글 없음