<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to connect DS18B20 - Which pins are available?]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I'm trying to connect a DS18B20 (onewire) temperature sensor on my M5Stack board, but I don't know which pins to use.</p>
<p dir="auto">Could you tell me which pins are available (not connected) on the board? I use the headers on the side of the M5Stack box.</p>
<p dir="auto">Here are my connections so far :</p>
<ul>
<li>VCC on the sensor =&gt; 3.3V on M5Stack</li>
<li>GND =&gt; GND</li>
<li>DATA on the sensor =&gt; ???</li>
<li>A 4.7K resistor between VCC and DATA</li>
</ul>
<p dir="auto">Thanks!</p>
]]></description><link>https://community.m5stack.com/topic/169/how-to-connect-ds18b20-which-pins-are-available</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 03:53:08 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/169.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Apr 2018 19:54:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Sat, 28 Nov 2020 08:43:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2379">@efried</a> Found solution here : <a href="https://community.m5stack.com/post/1394">https://community.m5stack.com/post/1394</a></p>
<p dir="auto">Add dacWrite (25,0); into the void loop</p>
]]></description><link>https://community.m5stack.com/post/10909</link><guid isPermaLink="true">https://community.m5stack.com/post/10909</guid><dc:creator><![CDATA[Leo05]]></dc:creator><pubDate>Sat, 28 Nov 2020 08:43:44 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Fri, 20 Nov 2020 20:28:13 GMT]]></title><description><![CDATA[<p dir="auto">After years it still birps, but does not work.<br />
Any new hints?</p>
]]></description><link>https://community.m5stack.com/post/10811</link><guid isPermaLink="true">https://community.m5stack.com/post/10811</guid><dc:creator><![CDATA[Efried]]></dc:creator><pubDate>Fri, 20 Nov 2020 20:28:13 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Wed, 18 Apr 2018 19:02:14 GMT]]></title><description><![CDATA[<p dir="auto">Here is a little report on my progression. In short : it still doesn't work!</p>
<p dir="auto">I checked that the pin "works" correctly by connecting a relay to test in OUTPUT mode, and a push button (to test in INPUT) : it works!<br />
I checked, double checked and triple checked the setup (wires, connections,...), everything is good.<br />
I ran the same code on a Wemos D1 Mini (ESP8266) : it works.</p>
<p dir="auto">At this point, I'm lost? The pin and the code seem good, but it can't detect the sensor.</p>
<p dir="auto">One thing I notice is that this weird whistling sound coming out of the board (not sure if it comes from the speaker or not) when the OneWire lib bitbangs the OneWire protocol on the pin.<br />
So, I made another test program that toggles the pin rapidely (at the speed of the onewire lib - ~50µs) : I hear the sound!</p>
<p dir="auto">I'll try to find an oscilloscope to check the signal on the pin, as I suspect that "something" is going wrong when the pin is driven at "high" speed.</p>
<p dir="auto">In the meantime, I hope that someone with more electronical knowledge will help me find a solution!</p>
]]></description><link>https://community.m5stack.com/post/864</link><guid isPermaLink="true">https://community.m5stack.com/post/864</guid><dc:creator><![CDATA[JF002]]></dc:creator><pubDate>Wed, 18 Apr 2018 19:02:14 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Tue, 17 Apr 2018 20:10:13 GMT]]></title><description><![CDATA[<p dir="auto">@zazar 在 <a href="/post/842">How to connect DS18B20 - Which pins are available?</a> 中说：</p>
<blockquote>
<p dir="auto">OneWire version 2.3.4<br />
DallasTemperature version 3.79</p>
</blockquote>
<p dir="auto">Thanks, @zazar!</p>
<p dir="auto">I use exactly the same lib, and similar code without any result for now, unfortunately.</p>
]]></description><link>https://community.m5stack.com/post/852</link><guid isPermaLink="true">https://community.m5stack.com/post/852</guid><dc:creator><![CDATA[JF002]]></dc:creator><pubDate>Tue, 17 Apr 2018 20:10:13 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Sat, 14 Apr 2018 09:51:20 GMT]]></title><description><![CDATA[<p dir="auto">OneWire version 2.3.4<br />
DallasTemperature version 3.79</p>
]]></description><link>https://community.m5stack.com/post/842</link><guid isPermaLink="true">https://community.m5stack.com/post/842</guid><dc:creator><![CDATA[suremicro]]></dc:creator><pubDate>Sat, 14 Apr 2018 09:51:20 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Sat, 14 Apr 2018 09:43:55 GMT]]></title><description><![CDATA[<p dir="auto">This is what I used just to test read multiple sensors on the M5Stack:</p>
<pre><code>	#include &lt;M5Stack.h&gt;
	#include &lt;OneWire.h&gt;
	#include &lt;DallasTemperature.h&gt;

	#define ONE_WIRE_BUS 5  // DS18B20 on arduino pin2 corresponds to D4 on physical board

	OneWire oneWire(ONE_WIRE_BUS);
	DallasTemperature DS18B20(&amp;oneWire);

	void setup() {
	  M5.begin();
	  M5.Lcd.setTextColor(TFT_WHITE,TFT_BLACK);  
	  M5.Lcd.setTextSize(2);

	}

	void loop() {
	  float celsius;
	  float fahrenheit;

	  DS18B20.begin();
	  int count = DS18B20.getDS18Count();

	  //M5.Lcd.clear();
	  M5.Lcd.setCursor(0,0);
	  M5.Lcd.print("Devices found: ");
	  M5.Lcd.println(count);

	  if (count &gt; 0) {

		DS18B20.requestTemperatures();

		for (int i=0; i &lt; count; i++) {

		  celsius = DS18B20.getTempCByIndex(i);
		  fahrenheit = celsius * 1.8 + 32.0;
  
		  celsius = round(celsius);
		  fahrenheit = round(fahrenheit);
  
		  M5.Lcd.print("Device ");
		  M5.Lcd.print(i);
		  M5.Lcd.print(": ");
		  M5.Lcd.print(celsius,0);
		  M5.Lcd.print( "C / ");
		  M5.Lcd.print(fahrenheit,0);
		  M5.Lcd.println("F");
  
		}

	  }

	  delay(2000);
	}
</code></pre>
]]></description><link>https://community.m5stack.com/post/841</link><guid isPermaLink="true">https://community.m5stack.com/post/841</guid><dc:creator><![CDATA[suremicro]]></dc:creator><pubDate>Sat, 14 Apr 2018 09:43:55 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Thu, 12 Apr 2018 19:17:49 GMT]]></title><description><![CDATA[<p dir="auto">New information : I tried the exact same code than the one provided by <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/290">@X-Dron</a> (<a href="https://github.com/G6EJD/ESP32-DS18B20-Sensor-Reading" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/G6EJD/ESP32-DS18B20-Sensor-Reading</a>) on an ESP8266 (using pin D3) and... it works perfectly (I tried with 1, then 2 and 3 sensors)!</p>
<p dir="auto">Is there something I'm missing, or is there an hardware issue with my board?</p>
]]></description><link>https://community.m5stack.com/post/829</link><guid isPermaLink="true">https://community.m5stack.com/post/829</guid><dc:creator><![CDATA[JF002]]></dc:creator><pubDate>Thu, 12 Apr 2018 19:17:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Thu, 12 Apr 2018 19:01:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/290">@x-dron</a> 在 <a href="/post/827">How to connect DS18B20 - Which pins are available?</a> 中说：</p>
<blockquote>
<p dir="auto">Try it.<br />
GPIO2 fully free<br />
<a href="https://github.com/G6EJD/ESP32-DS18B20-Sensor-Reading" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/G6EJD/ESP32-DS18B20-Sensor-Reading</a></p>
</blockquote>
<p dir="auto">I've already tried, and I can't find why it doesn't work, that's why I'm asking.</p>
<p dir="auto">I've tried your example, I've just set the define ONE_WIRE_BUS to 2:</p>
<pre><code>#define ONE_WIRE_BUS 2 
</code></pre>
<p dir="auto">The sensor is still not detected. Moreover, the board make a little piercing sound when it probes for the sensor and the temperature. I don't understand where it comes from, as GPIO2 should not be connected to the speaker...</p>
<p dir="auto">Any ideas?</p>
]]></description><link>https://community.m5stack.com/post/828</link><guid isPermaLink="true">https://community.m5stack.com/post/828</guid><dc:creator><![CDATA[JF002]]></dc:creator><pubDate>Thu, 12 Apr 2018 19:01:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Thu, 12 Apr 2018 17:14:44 GMT]]></title><description><![CDATA[<p dir="auto">Try it.<br />
GPIO2 fully free<br />
<a href="https://github.com/G6EJD/ESP32-DS18B20-Sensor-Reading" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/G6EJD/ESP32-DS18B20-Sensor-Reading</a></p>
]]></description><link>https://community.m5stack.com/post/827</link><guid isPermaLink="true">https://community.m5stack.com/post/827</guid><dc:creator><![CDATA[X-Dron]]></dc:creator><pubDate>Thu, 12 Apr 2018 17:14:44 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Thu, 12 Apr 2018 16:43:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/187">@world101</a> 在 <a href="/post/814">How to connect DS18B20 - Which pins are available?</a> 中说：</p>
<blockquote>
<p dir="auto">@zazar  has already done it.</p>
<p dir="auto"><a href="http://forum.m5stack.com/topic/95/custom-prototype-board/11" target="_blank" rel="noopener noreferrer nofollow ugc">http://forum.m5stack.com/topic/95/custom-prototype-board/11</a></p>
</blockquote>
<p dir="auto">@zazar, if you come by, could you provide us with some information about your project? How did you connect the DS18B20 sensors (wich pins did you use)? Which Onewire/ds18b20 lib did you use, if any ?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://community.m5stack.com/post/825</link><guid isPermaLink="true">https://community.m5stack.com/post/825</guid><dc:creator><![CDATA[JF002]]></dc:creator><pubDate>Thu, 12 Apr 2018 16:43:59 GMT</pubDate></item><item><title><![CDATA[Reply to How to connect DS18B20 - Which pins are available? on Wed, 11 Apr 2018 20:36:21 GMT]]></title><description><![CDATA[<p dir="auto">@zazar  has already done it.</p>
<p dir="auto"><a href="http://forum.m5stack.com/topic/95/custom-prototype-board/11" target="_blank" rel="noopener noreferrer nofollow ugc">http://forum.m5stack.com/topic/95/custom-prototype-board/11</a></p>
]]></description><link>https://community.m5stack.com/post/814</link><guid isPermaLink="true">https://community.m5stack.com/post/814</guid><dc:creator><![CDATA[world101]]></dc:creator><pubDate>Wed, 11 Apr 2018 20:36:21 GMT</pubDate></item></channel></rss>