<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">리튬이온 배터리로 구동되면서,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">집안의 온도와 습도를 매 10분마다 서버(ThingSpeak)로 전송하도록 만들어 보았다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">배터리 구동형으로 만든 이유는 측정 위치의 선정과 이동에 좀더 자유롭기 위해서이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">ESP8266의 Deep Sleep 모드를 사용하여,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">10분 동안 수면(~0.08 mA)하다가 잠깐(~5초) 깨어서 측정 및 기록을 하고,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">다시 깊은 수면에 들어가므로 전지 소모를 최소화한다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">그래도 잠깐 깨어 있는 동안에,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">ESP8266의 WiFi 모드 전력 소비가 매우 커서 (~70mA 이상) 초절전 수준은 못되고,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">18650 배터리 1개로 5~6달 정도 작동할 것으로 예상된다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">물론 측정 간격을 10분이 아니라 더 늘리면 거의 비례적으로 배터리 수명이 증가하는데,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">(즉, 20분 간격이라면 ~10달 정도 작동 예상)</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">집안의 온습도가 전기 제품의 소비전력 처럼 바로바로 바뀌는 것이 아니므로,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">10분 정도의 측정 간격이라도 충분히 자주하는 편이라고 생각한다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff; user-select: auto !important;"><span style="font-size: 9pt; user-select: auto !important;">만약&nbsp;</span><span style="font-size: 9pt; user-select: auto !important;">수면 모드를 사용하지 않지 않고,</span></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff; user-select: auto !important;"><span style="font-size: 9pt; user-select: auto !important;">편하게 WeMos D1 Mini 와 보조 충전기 등을 사용하여 연속으로 작동 시키면,</span></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff; user-select: auto !important;"><span style="font-size: 9pt; user-select: auto !important;">18650 배터리로는 하루 정도 밖에 가지 않을 것이다.</span></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">온도와 습도 센서로는 DHT12를 사용했는데,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">직전의 포스트에서 좀더 자세히 소개를 하였다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">(DHT12 관련 글 --&gt;&nbsp;<a href="http://blog.naver.com/twophase/221077552919" target="_blank" class="con_link" style="text-decoration-line: none; overflow-wrap: break-word;">http://blog.naver.com/twophase/221077552919</a>&nbsp;)</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">DHT12는 사용하면서 가지고 있는 다른 센서들과 비교를 해 보니,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">비교적 정확하고 여러가지로(가격, 크기, 해상도, 전력소모량, 속도 등) 마음에 든다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 회로도이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">DHT12 센서도 ESP8266이 깨어 있는 동안에만 작동되도록,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">ESP8266의 디지털 출력을 통해서 전원을 공급한다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">이 센서의 소비전류량이 ~1 mA 정도로 작기 때문에 가능하다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">비록 3.3V 레귤레이터인 662K에는 항상 전기가 공급되고 있으나,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">초절전형 부품이라서 여기서의 전력소모는 무시할 수 있을 정도다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">ESP8266으로는 ESP-12E를 사용했다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">WeMos Mini D1 과 같은 개발 보드는 만들기가 훨씬 편하기는 하지만,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">불필요하게 전지가 계속 소모되는 부품들(CH340G 등)이 있어서 사용하지 않았다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">한편, 아래 회로도에서 GPIO16 핀과 Reset을 연결한 이유는,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">수면 모드에서 깨어날 때 MCU가 리셋이 되도록 한 것이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">(예전 글 참조 --&gt;&nbsp;<a href="http://blog.naver.com/twophase/220727303211" target="_blank" class="con_link" style="text-decoration-line: none; overflow-wrap: break-word;">http://blog.naver.com/twophase/220727303211</a>&nbsp;)</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><img src="https://postfiles.pstatic.net/MjAxNzA4MjBfMjgx/MDAxNTAzMTU2MDA1MDk3.jDGK05dp_8mwYklBkQoEjF0V-fE-uf4j-91n2z78NGUg.6TOR-DcQplcRZ7Ns-glZgNKYbEbA11KpZcWB0ZbkGj4g.JPEG.twophase/20170820_1.jpg?type=w2" width="423" height="215" id="MjAxNzA4MjBfMjgx/MDAxNTAzMTU2MDA1MDk3.jDGK05dp_8mwYklBkQoEjF0V-fE-uf4j-91n2z78NGUg.6TOR-DcQplcRZ7Ns-glZgNKYbEbA11KpZcWB0ZbkGj4g.JPEG.twophase/20170820_1.jpg" alt="" class="_photoImage" data-lazy-src="" style="border: none; cursor: pointer;" />&nbsp;</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 위 회로를 완성한 모습이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">ESP-12 에 직접 작업하기는 피곤하므로,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">흰색 어댑터 보드를 이용했다.&nbsp;</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">(단, 저항을 떼어내고 3.3V 레귤레이터를 부착 하는 등의 개조 작업은 수행함)<br style="clear: both;" /><br style="clear: both;" /><img src="https://postfiles.pstatic.net/MjAxNzA4MjBfMTky/MDAxNTAzMTU1NDk3ODMw.zFdqvHOzts3QLh1wNsPJaldJnKLgdSw8tcgXLsfedXUg.gQh4aXp5bP1PECXNkqM0sYW-zI4jOATrPdDv_GPu4Ngg.JPEG.twophase/20170820_2.jpg?type=w2" width="640" height="562" id="MjAxNzA4MjBfMTky/MDAxNTAzMTU1NDk3ODMw.zFdqvHOzts3QLh1wNsPJaldJnKLgdSw8tcgXLsfedXUg.gQh4aXp5bP1PECXNkqM0sYW-zI4jOATrPdDv_GPu4Ngg.JPEG.twophase/20170820_2.jpg" alt="" class="_photoImage" data-lazy-src="" style="border: none; cursor: pointer;" /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 뒷면의 모습이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">부착한 662K(3.3V 레귤레이터)를 볼 수 있다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">빨간색 슬라이드 DIP 스위치는 스케치를 업로드할 때만 사용한다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">스케치 업로드는 USB to TTL 컨버터를 사용했다.<br style="clear: both;" /><br style="clear: both;" /><img src="https://postfiles.pstatic.net/MjAxNzA4MjBfNDkg/MDAxNTAzMTU1NDk4MDEw.crqUp2hYM6oBwTNBK_YwFsuxnH9O3lATTa96RBBq1Vwg.OrfcUSYbfnypFvZqM1a3QdlBdDEl4CvN8aDALDILoSwg.JPEG.twophase/20170820_3.jpg?type=w2" width="640" height="549" id="MjAxNzA4MjBfNDkg/MDAxNTAzMTU1NDk4MDEw.crqUp2hYM6oBwTNBK_YwFsuxnH9O3lATTa96RBBq1Vwg.OrfcUSYbfnypFvZqM1a3QdlBdDEl4CvN8aDALDILoSwg.JPEG.twophase/20170820_3.jpg" alt="" class="_photoImage" data-lazy-src="" style="border: none; cursor: pointer;" /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 최종 완성하여 배터리로 작동되는 모습이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">계속 켜져 있다면 ESP8266 몸통에서 열이 많이 나지만,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">10분에 수초동안만 작동하므로 온도 센서에 거의 영향을 주지 않을 정도이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">그래도 온도센서의 부착 시엔 이런 점을 고려하여 위치시켰다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">총 전기 소모량은,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">ESP8266이 열심히 작동 중인 (짧게는 ~4초, 길게는 ~10초) 동안에는 70~72mA가 흐르고,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">수면 모드에서는 0.06 mA 정도로 측정되었다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br style="clear: both;" /><img src="https://postfiles.pstatic.net/MjAxNzA4MjBfMTM4/MDAxNTAzMTU1NDk4MTQy.xU_fcPm1uzMYaEHTAG6Hv_yc0ZCVfZW-_sUxydK9TAAg.4zXEFXNAiuY6pwHz5rMaF8tGmHPc_LTkih4LoI66HQ4g.JPEG.twophase/20170820_4.jpg?type=w2" width="640" height="417" id="MjAxNzA4MjBfMTM4/MDAxNTAzMTU1NDk4MTQy.xU_fcPm1uzMYaEHTAG6Hv_yc0ZCVfZW-_sUxydK9TAAg.4zXEFXNAiuY6pwHz5rMaF8tGmHPc_LTkih4LoI66HQ4g.JPEG.twophase/20170820_4.jpg" alt="" class="_photoImage" data-lazy-src="" style="border: none; cursor: pointer;" />&nbsp;</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 스케치 소스이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">측정된 데이터는 ThingSpeak에 보내며,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">10분 동안 자고 있다가 깨어나서는(Reset) 다시 코드의 맨처음부터 실행된다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">즉, 실제로는 꺼져있다가 다시 켜지는 것이라고 봐도 무방하다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">반복되는 부분이 없으니 loop() 내에서의 코드는 의미가 없어서 비워 두었다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">한편, 맨 아래 deepSleep() 명령어에서 5를 뺀 것은 대량 5초 정도 깨어있기 때문이고,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">1.05를 곱한 것은 실측한 시간과의 차이로 부터 도출된 보정 계수이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">즉, ESP8266에 내장된 deepSleep()용 타이머가 그리 정확하지 않은 것 같다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">================</p>
<div style="line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; display: inline-block; background-color: #ffffff;">
   <div style="line-height: 1.5; font-family: 나눔고딕, NanumGothic, 돋움, Dotum;"><br /></div>
   <div style="line-height: 1.5;">
      <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; font-size: 13px; font-family: consolas; white-space: nowrap !important;">
         <tbody>
            <tr style="margin: 0px; padding: 0px;">
               <td nowrap="" style="word-break: break-all; margin: 0px; padding: 0px 3px; color: #010101;">
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #999999;">//</span></div>
                  <div style="line-height: 1.5;"><span style="color: #999999;">//&nbsp;&nbsp;ESP8266_DHT12_WiFi_v1.0.ino&nbsp;(2017.8.19)&nbsp;&nbsp;</span></div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #999999;">//</span></div>
                  <div style="line-height: 1.5;"><span style="color: #999999;">//&nbsp;&nbsp;<a href="https://playground.arduino.cc/Main/Dht" target="_blank" class="con_link" style="text-decoration-line: none; overflow-wrap: break-word;">https://playground.arduino.cc/Main/Dht</a></span></div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #999999;">// &nbsp;DHT12 Library&nbsp;--&gt;&nbsp;<a href="https://github.com/Bobadas/DHT12_library_Arduino" target="_blank" class="con_link" style="text-decoration-line: none; overflow-wrap: break-word;">https://github.com/Bobadas/DHT12_library_Arduino</a></span></div>
                  <div style="line-height: 1.5;"><span style="color: #999999;">//</span></div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;</div>
                  <div style="line-height: 1.5;"><span style="color: #0033cc;">#include</span>&nbsp;&lt;DHT12.h&gt;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #0033cc;">#include</span>&nbsp;&lt;Wire.h&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;DHT12&nbsp;uses&nbsp;I2C&nbsp;(GPIO4=SDA,&nbsp;GPIO5=SCL)</span></div>
                  <div style="line-height: 1.5;">DHT12&nbsp;dht12;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;Default&nbsp;Unit&nbsp;=&nbsp;CELSIUS,&nbsp;ID&nbsp;=&nbsp;0x5c</span></div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;</div>
                  <div style="line-height: 1.5;"><span style="color: #0033cc;">#include</span>&nbsp;&lt;ESP8266WiFi.h&gt;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">WiFiClient&nbsp;client;</div>
                  <div style="line-height: 1.5;">&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">String&nbsp;apiKey&nbsp;=&nbsp;<span style="color: #009900;">"D35Z56XXXXXXXXXX"</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;your&nbsp;ThingSpeak&nbsp;API&nbsp;key</span></div>
                  <div style="line-height: 1.5;"><span style="color: #0033cc;">const</span>&nbsp;<span style="color: #0033cc;">char</span>*&nbsp;ssid&nbsp;=&nbsp;<span style="color: #009900;">"U+NetB083"</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;your&nbsp;ssid</span></div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #0033cc;">const</span>&nbsp;<span style="color: #0033cc;">char</span>*&nbsp;password&nbsp;=&nbsp;<span style="color: #009900;">"XXXXXXXXXX"</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;your&nbsp;password</span></div>
                  <div style="line-height: 1.5;"><span style="color: #0033cc;">const</span>&nbsp;<span style="color: #0033cc;">char</span>*&nbsp;server&nbsp;=&nbsp;<span style="color: #009900;">"api.thingspeak.com"</span>;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;</div>
                  <div style="line-height: 1.5;"><span style="color: #0033cc;">const</span>&nbsp;<span style="color: #0033cc;">int</span>&nbsp;VccDHT&nbsp;=&nbsp;0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;Vcc&nbsp;pin&nbsp;for&nbsp;the&nbsp;Power&nbsp;of&nbsp;DHT12</span></div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #0033cc;">const</span>&nbsp;<span style="color: #0033cc;">int</span>&nbsp;recordPeriod&nbsp;=&nbsp;600;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;Recording&nbsp;Period&nbsp;(seconds)</span></div>
                  <div style="line-height: 1.5;">&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;"><span style="color: #0033cc;">void</span>&nbsp;setup()&nbsp;{</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;Wire.begin();</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;pinMode(VccDHT,&nbsp;OUTPUT);</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;digitalWrite(VccDHT,&nbsp;HIGH);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;DHT12&nbsp;ON</span></div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;WiFi.begin(ssid,&nbsp;password);</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;<span style="color: #0033cc;">while</span>&nbsp;(WiFi.status()&nbsp;!=&nbsp;WL_CONNECTED)&nbsp;delay(500);</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;<span style="color: #0033cc;">if</span>&nbsp;(client.connect(server,80))&nbsp;{&nbsp;&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;postStr&nbsp;=&nbsp;apiKey;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postStr&nbsp;+=<span style="color: #009900;">"&amp;field1="</span>;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postStr&nbsp;+=&nbsp;String(dht12.readTemperature(),&nbsp;1);</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postStr&nbsp;+=<span style="color: #009900;">"&amp;field2="</span>;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postStr&nbsp;+=&nbsp;String(dht12.readHumidity(),&nbsp;1);</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"POST&nbsp;/update&nbsp;HTTP/1.1\n"</span>);&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"Host:&nbsp;api.thingspeak.com\n"</span>);&nbsp;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"Connection:&nbsp;close\n"</span>);&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"X-THINGSPEAKAPIKEY:&nbsp;"</span>+apiKey+<span style="color: #009900;">"\n"</span>);&nbsp;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"Content-Type:&nbsp;application/x-www-form-urlencoded\n"</span>);&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"Content-Length:&nbsp;"</span>);&nbsp;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(postStr.length());&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(<span style="color: #009900;">"\n\n"</span>);&nbsp;</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;&nbsp;&nbsp;client.print(postStr);&nbsp;&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;}</div>
                  <div style="line-height: 1.5;">&nbsp;&nbsp;client.stop();</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;digitalWrite(VccDHT,&nbsp;LOW);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #999999;">//&nbsp;DHT12&nbsp;OFF</span></div>
                  <div style="line-height: 1.5;">&nbsp;</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;&nbsp;ESP.deepSleep(recordPeriod&nbsp;*&nbsp;1000000&nbsp;*&nbsp;1.05);</div>
                  <div style="line-height: 1.5;">}</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">&nbsp;</div>
                  <div style="line-height: 1.5;"><span style="color: #0033cc;">void</span>&nbsp;loop()&nbsp;{</div>
                  <div style="line-height: 1.5; background-color: #f7f7f7;">}</div>
                  </td>
               </tr>
            </tbody>
         </table>
      </div>
   </div>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">================&nbsp;<a href="http://prev.kr/app/ColorScripter" target="_blank" class="con_link" style="text-decoration-line: none; overflow-wrap: break-word; font-family: 나눔고딕, NanumGothic, 돋움, Dotum; color: #010101;">Colored By&nbsp;<b>Color Scripter</b>™</a></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 ThingSpeak에서 Data를 받고 있는 모습이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">현재 밖에 비가 계속 내리고 있고, 창문을 열어놔서 그런지&nbsp;</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">습도가 90%대로 매우 높다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">값들은 큰 변동 없이 안정적으로 받고 있음을 알 수 있다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><img src="https://postfiles.pstatic.net/MjAxNzA4MjBfMTgw/MDAxNTAzMjAzMDI1Njc5.hGj6NLhZFcZPR8Mj5cRPMUjhvaFe-iAlypasCRvq6Bog.DljM1gqDWINadC_EVGZiX0xN9zaP7AqzxuPLLbaRAAYg.JPEG.twophase/20170820_5.jpg?type=w2" width="640" height="361" id="MjAxNzA4MjBfMTgw/MDAxNTAzMjAzMDI1Njc5.hGj6NLhZFcZPR8Mj5cRPMUjhvaFe-iAlypasCRvq6Bog.DljM1gqDWINadC_EVGZiX0xN9zaP7AqzxuPLLbaRAAYg.JPEG.twophase/20170820_5.jpg" alt="" class="_photoImage" data-lazy-src="" style="border: none; cursor: pointer;" /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">아래는 내 스마트폰에서 위젯으로 현재의 값을을 모니터하고 있는 모습이다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">온습도 뿐만 아니라 전기 및 물 사용 현황 등을 실시간 파악하고 있다.<br style="clear: both;" /><br style="clear: both;" /><img src="https://postfiles.pstatic.net/MjAxNzA4MjBfMTMy/MDAxNTAzMjAzMDI1OTEw.V6NLegUlU8-Q2QnIwebUoNHLW2eqRMZv5pLl1xZkpuIg.ac6D77HYs1JJzXnsQh6GCgbySlFpgMw2XmD1jCzR0H4g.JPEG.twophase/20170820_6.jpg?type=w2" width="218" height="570" id="MjAxNzA4MjBfMTMy/MDAxNTAzMjAzMDI1OTEw.V6NLegUlU8-Q2QnIwebUoNHLW2eqRMZv5pLl1xZkpuIg.ac6D77HYs1JJzXnsQh6GCgbySlFpgMw2XmD1jCzR0H4g.JPEG.twophase/20170820_6.jpg" alt="" class="_photoImage" data-lazy-src="" style="border: none; cursor: pointer;" /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">*** 글 추가 (2017.8.22) *****</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">온도, 습도 뿐만아니라 총 6가지의 물성들을 나타내도록 수정했다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">1. 온도</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">2. 상대습도</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">3. 절대습도</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">4. 습구온도</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">5. 노점온도</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">6. 불쾌지수</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">하드웨어는 그대로니까 바꿀 필요가 없고,</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">스케치만 Upgrade하여 별도의 글로 소개하였다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><a href="http://blog.naver.com/twophase/221079836198" target="_blank" class="con_link" style="text-decoration-line: none; overflow-wrap: break-word;">http://blog.naver.com/twophase/221079836198</a></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">*** 글 추가 (2017.8.24) *****</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">WeMos D1 Mini로 다시 제작했다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;">이번엔 배터리 전압도 추가로 표시한다.</p>
<p style="padding: 0px; line-height: 1.5; color: #333333; font-family: 돋움; text-align: justify; background-color: #ffffff;"><br /></p>
<p><a href="http://blog.naver.com/twophase/221081593611" target="_blank" class="con_link" style="font-family: 돋움; text-align: justify; text-decoration-line: none; overflow-wrap: break-word;">http://blog.naver.com/twophase/221081593611</a>&nbsp;</p>