개발자/Raspberry Pi3

온도 습도 센서 DHT11 에러. raspberry pi DHT11 센서 data not good skip error 해결

지구빵집 2018. 5. 20. 20:59
반응형


온도 습도 센서 DHT11 에러. raspberry pi DHT11 센서 data not good skip error 해결방법


라즈베리 파이의 버전이 올라가면서 바뀐 내용이니, 기존에 잘 되다가 라즈베리파이를 변경하고 안되시는 분들 참고.


온도 습도 센서 DHT11 에러. raspberry pi DHT11 센서 data not good skip error 해결


검색해서 찾은 내용


Re: DHT11 : C program not working but python program OK

Thu Nov 16, 2017 4:19 am

try this.
change `counter > 16` => `counter > 50`

Code: Select all

		/* ignore first 3 transitions */
		if ( (i >= 4) && (i % 2 == 0) )
		{
			/* shove each bit into the storage bytes */
			dht11_dat[j / 8] <<= 1;
			/* if ( counter > 50 ) */
			if ( counter > 50 )		/* <- !! here !! */
				dht11_dat[j / 8] |= 1;
			j++;
		}
This page was very helpful:
http://www.rpiblog.com/2012/11/interfac ... idity.html

#I am sorry that my English is not good.



그러니까 위의 빨간 링크를 타고 가서 찾은 내용을 아래에 정리합니다. 링크의 정확한 주소는 

여기입니다. =>   http://www.rpiblog.com/2012/11/interfacing-temperature-and-humidity.html


이건 그냥 참고하시라고 http://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-the-raspberry-pi/


이미지 출처(기사내용이 좋음) : https://www.techcoil.com/blog/how-to-read-temperature-and-humidity-from-a-dht11-sensor-that-is-connected-to-a-raspberry-pi-3/


반응형