1

I am having a hard time troubleshooting this project build of mine. I am trying to utilize a DS18B20 temperature sensor in conjunction with an ESP8266 to create a temperature beacon.

The problem I'm running into pertains to the data interpreted by the ESP8266. I am using the Arduino IDE to program the HUZZAH ESP8266 breakout.

The WiFi client is behaving as supposed to, but the temperature sensing is not. When I upload the same sketch to an Arduino Mega2560 (recompiled obviously), and plug the data line into a digital pin of the 2560, the probe temps come in perfectly, changing according to the temp. If I unplug the data lead, I get -196.80, what I assume is a ground value.

Simply moving the data line into the ESP8266 pin, I receive a temp of 262.29 and this does not change in between reads, regardless of sensor temperature.

I have ensured all of the cables are wired properly, there is no weird grounding or anything. I have tried changing the baud rate of the serial interface maybe thinking the clock had something to do with it, but that seems to have affected nothing.

Any idea/direction is always appreciated!


I have wired the circuit according to a diagram located at this link here.

Here is a Gist to the code that I have been uploading to the ESPs. The code is designed to setup a WiFi Client (attached to a local AP, which works totally fine), request the temps, and submit up to a host that has a listening server. The pin (2) refers to GPIO2 on ESP8266 [i think]


So I found A solution to this. I'm not sure if this particular problem has been replicated for everyone, however, in my situation, the parasitic power on the data line was not charging the IC enough to finish the proper calculation.

All I had to do was unground the VDD pin and hook it up to the 5V rail. Leave the 4.7kOhm resistor on the data line also pulled up to the 5V rail. After doing so, the program reports PARASITIC POWER: OFF, and reports temperatures as I hoped!

4

1 回答 1

1

我更改了上面的帖子以包含一个可行的解决方案!

DS18B20 器件可以在 2 种功耗模式(正常和寄生)下工作。在寄生电源的情况下,VDD 引脚跳到 GND,IC 从连接回微控制器的数据线接收电源。

DS18B20 的一个有趣品质是温度感应期间的功耗。在寄生模式下工作时,主机设备需要能够为 IC 提供足够的功率来完成计算,否则设备将返回错误的答案。

我的解决方案(使用 Adafruit HUZZAH ESP8266 微控制器)是不使用寄生电源。我不能确定这个设置的问题是什么,但是,在正常模式下配置电路时,探头按预期工作。我想数据线没有得到足够的电力。

要从上面链接的图表中更改电路:

  • 移除 VDD 和 GND 引脚之间的跳线
  • 将 VDD 连接到 5V 电源轨
  • 保持 GND 到 GND 导轨
  • 保持 4.7kOhm 电阻将数据线拉到 5v 轨
于 2016-10-30T19:04:20.030 回答