<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39358/dht22-sensor-data-pin-reading-low</link><description>Hi Team Nordic, 
 
 According to the AM2302 (DHT22) datasheet, the data pin will be pulled to high state in idle state. But in my case, when i am reading the data pin before even sending any signal to the sensor, i am reading 0 on the data pin. I am using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Oct 2018 07:30:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39358/dht22-sensor-data-pin-reading-low" /><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152970?ContentTypeID=1</link><pubDate>Tue, 16 Oct 2018 07:30:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e00e470-1fb1-457d-8f4e-e0d1e6c5638c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have no experience with the DHT22, but I see your code is similar to&amp;nbsp;&lt;a href="http://www.uugear.com/portfolio/read-dht1122-temperature-humidity-sensor-from-raspberry-pi/"&gt;this example&lt;/a&gt;. Your code is missing some of the comments, but referring to the code I linked to it seems that what this is what is supposed to happen:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Configure pin as output.&lt;/li&gt;
&lt;li&gt;Pull pin down for some time (I have not read the DHT22 datasheet, but I assume this should tell it to send data).&lt;/li&gt;
&lt;li&gt;Configure pin as input&lt;/li&gt;
&lt;li&gt;Loop for reading each input bit
&lt;ol&gt;
&lt;li&gt;Read pin continuously to detect a transition (change in state)&lt;/li&gt;
&lt;li&gt;Ignore first 3 transitions (I guess this is for synchronization as there is no clock, but I have not checked 1-wire spec)&lt;/li&gt;
&lt;li&gt;shift received bit into correct position in RX buffer&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Check that the correct number of bits is received, and that the checksum is correct&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Have you verified the timing of your implementation? Is&amp;nbsp;duration of your waits sensible?&lt;span&gt;&amp;nbsp;&lt;/span&gt;I suggest&lt;span&gt;&amp;nbsp;&lt;/span&gt;you add a bit of logging along the way printing the data you read so that you can see what happens and that it matches what you would expect. You could also verify that the incoming signal is correct by using a logic analyzer that support the 1-Wire protocol (for instance&amp;nbsp;Saleae Logic Pro).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152769?ContentTypeID=1</link><pubDate>Sun, 14 Oct 2018 00:09:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aeacd3f7-44a3-43ed-b0e7-cbdb327510ba</guid><dc:creator>arshdeep</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Now this is strange.&lt;/p&gt;
&lt;p&gt;I am reading 2.94V voltage on oscilloscope from my data pin of sensor but my program is still reading 0.&lt;/p&gt;
&lt;p&gt;Am i&amp;nbsp; missing something in my code?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;sdk_common.h&amp;quot;
#include &amp;quot;dht22.h&amp;quot;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;


void read_dht11_dat()
 { 
	uint8_t laststate	= 1;
	uint8_t counter		= 0;
	uint8_t j		= 0, i;
	float	f; /* fahrenheit */
 
	
         nrf_gpio_cfg_input(DHTPIN,  NRF_GPIO_PIN_PULLUP) ;
         laststate = nrf_gpio_pin_read( DHTPIN );
         printf( &amp;quot;%d \n&amp;quot; ,laststate );
        
        
        
        dht11_dat[0] = dht11_dat[1] = dht11_dat[2] = dht11_dat[3] = dht11_dat[4] = 0;
        
           nrf_gpio_cfg_output(DHTPIN);
           nrf_gpio_pin_write(DHTPIN, 0);
           nrf_delay_ms(10);

        

         nrf_gpio_pin_write(DHTPIN, 1);
         nrf_delay_us(40);

         nrf_gpio_cfg_input(DHTPIN,  NRF_GPIO_PIN_PULLUP );

         for ( i = 0; i &amp;lt; MAXTIMINGS; i++ )
	{
		counter = 0;
		while ( nrf_gpio_pin_read(DHTPIN) == laststate)
		{
			counter++;
			nrf_delay_us(1);
			if ( counter == 255 )
			{
				break;
			}
		}
		laststate = nrf_gpio_pin_read( DHTPIN );
 
		if ( counter == 255 )
			break;
 
		/* ignore first 3 transitions */
		if ( (i &amp;gt;= 4) &amp;amp;&amp;amp; (i % 2 == 0) )
		{
			/* shove each bit into the storage bytes */
			dht11_dat[j / 8] &amp;lt;&amp;lt;= 1;
			if ( counter &amp;gt; 16 )
				dht11_dat[j / 8] |= 1;
			j++;
		}
	}

        if ( (j &amp;gt;= 40) &amp;amp;&amp;amp;
	     (dht11_dat[4] == ( (dht11_dat[0] + dht11_dat[1] + dht11_dat[2] + dht11_dat[3]) &amp;amp; 0xFF) ) )
	{
		f = dht11_dat[2] * 9. / 5. + 32;
		printf( &amp;quot;Humidity = %d.%d %% Temperature = %d.%d *C (%.1f *F)\n&amp;quot;,
			dht11_dat[0], dht11_dat[1], dht11_dat[2], dht11_dat[3], f );
	}else  {
		printf( &amp;quot;Data not good, skip\n&amp;quot; );
	}
    
    }&lt;/pre&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/software_5F00_reading.PNG" /&gt;&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/SENSOR_5F00_READING.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152558?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 19:07:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59ce60f0-54dd-481a-80e1-3bcbdba8ae31</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Well, if it needs a pull-up and you haven&amp;#39;t provided one, then it obviously won&amp;#39;t work!&lt;/p&gt;
&lt;p&gt;In that case, would expect to always read zero from it!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152555?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 17:54:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d439808d-74e3-4769-95b8-22bfe4a4c25d</guid><dc:creator>arshdeep</dc:creator><description>&lt;p&gt;Yes that&amp;#39;s true. The sensor is indeed very popular and I am sure I will find out soon what is going wrong with it and will post the answer&amp;nbsp;here .&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152554?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 17:40:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a0895bf-5abf-4d04-a604-6836f0900289</guid><dc:creator>awneil</dc:creator><description>[quote userid="65515" url="~/f/nordic-q-a/39358/dht22-sensor-data-pin-reading-low/152553"]the DHT22 requires a pull-up[/quote]
&lt;p&gt;That&amp;#39;s kind of hinted-at in the datasheet, but there is no clear specification at all of the output characteristics:&amp;nbsp;&lt;a href="https://cdn-shop.adafruit.com/datasheets/DHT22.pdf"&gt;https://cdn-shop.adafruit.com/datasheets/DHT22.pdf&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sadly, that is typical of these cheap chinese components.&lt;/p&gt;
&lt;p&gt;However, these are widely used in the &amp;quot;maker&amp;quot; community - so there&amp;#39;s no shortage of tutorials and examples on using them.&lt;/p&gt;
&lt;p&gt;My first hit on googling &amp;quot;DHT22&amp;quot; is&amp;nbsp;&lt;a href="https://www.adafruit.com/product/385"&gt;https://www.adafruit.com/product/385&lt;/a&gt;&amp;nbsp;- which says,&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;Comes with a 4.7K - 10K resistor, which you will want to use as a pullup from the data pin to VCC&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Which is another clue!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152553?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 16:59:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c005cec-ff9a-47c3-9c71-dad0f35e8ee3</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;I answered this earlier but it seems it got lost .. the DHT22 requires a pull-up to nRF Vdd (note not 5 volt) on the Data line, as do all 1-wire devices. The nominal value is 1k, but you can try simply changing _NOPULL to _PULLUP to see if that works at low data rates. You might also use high Drive for &amp;#39;0&amp;#39; and &amp;#39;1&amp;#39; when in output mode if the is any significant parasitic capacitance or long leads to the DHT22.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152552?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 16:55:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c295aca-8329-4c36-90f5-6e8129494d10</guid><dc:creator>arshdeep</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I did not find anything about output voltage in datasheet, just that it sends 1/high signal . But I think the output voltage will be same as of supplied power. So, if I&amp;#39;m supplying 5V , It must be sending 5V output and the pins as you mentioned can only read up to 3.9V. This could be the problem.&lt;/p&gt;
&lt;p&gt;And my VDD pins read 2.8V which is not sufficient to drive the sensor. It needs at least 3.3V.&lt;/p&gt;
&lt;p&gt;I fired up an oscilloscope as well and can see a high signal as default.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152548?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 15:52:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e56dd0b7-ba12-424d-acf0-01bee4f2cc95</guid><dc:creator>awneil</dc:creator><description>[quote userid="71968" url="~/f/nordic-q-a/39358/dht22-sensor-data-pin-reading-low/152545"]I am using nrf52832 DK[/quote]
&lt;p&gt;So&amp;nbsp;&lt;span&gt;the&amp;nbsp;&lt;/span&gt;Absolute&lt;strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;Maximum&lt;span&gt;&amp;nbsp;voltage at any IO &lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt;is&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;3.9V,&lt;/strong&gt;&lt;span&gt;&amp;nbsp;then!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What does the DHT-22 &lt;strong&gt;datasheet&lt;/strong&gt; say about&amp;nbsp; the voltage it outputs to its DATA pin ... ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152545?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 15:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d56ab1e-8eff-459a-bcb1-d8a137c552f2</guid><dc:creator>arshdeep</dc:creator><description>&lt;p&gt;I am using nrf52832 DK .&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/dht22_5F00_sch.PNG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/dht22.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152539?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 15:02:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e83c2050-abdf-4e3e-8963-61ab599a2f54</guid><dc:creator>awneil</dc:creator><description>[quote userid="71968" url="~/f/nordic-q-a/39358/dht22-sensor-data-pin-reading-low"] I am using p0.07 (pin 9 ) as data pin. VCC -&amp;gt; 5V, GND -&amp;gt; GND.[/quote]
&lt;p&gt;Trying to describe circuit connections in words is a waste of time. Please post a &lt;strong&gt;schematic&lt;/strong&gt; (aka &amp;quot;circuit diagram&amp;quot;).&lt;/p&gt;
&lt;p&gt;You haven&amp;#39;t said what Nordic part you&amp;#39;re using, but the &lt;strong&gt;&lt;em&gt;Absolute&lt;/em&gt; Maximum&lt;/strong&gt; voltage at any IO pin on the nRF52832 is &lt;strong&gt;3.9V&lt;/strong&gt; -&amp;nbsp;I expect others are similar ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152531?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 13:57:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b6310c0-293c-4a4b-967c-b113c07fe498</guid><dc:creator>arshdeep</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am supplying on board 5V to the sensor. I will check what is going wrong with this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DHT22 sensor data pin reading low</title><link>https://devzone.nordicsemi.com/thread/152525?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 13:35:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:13dde16a-be07-442c-92a2-36286cd73eea</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I do not have any experience with the&amp;nbsp;DHT22, but I noticed that it needs a supply voltage of minimum 3.3 V. Which supply voltage do you use?&lt;/p&gt;
&lt;p&gt;It looks like you are reading the pin correctly (you cannot really go wrong with&amp;nbsp;nrf_gpio_pin_read() as all it does is read the state of the pin). Have you looked at the signal on the pin using an oscilloscope? That way you would know what signal is actually there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>