# Connect ESP3266 to sensor

Connecting this ESP3266 to a temperature sensor is easy. All you need to do is a datasheet.&#x20;

![](https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MClo3nC-1US0rbK8Qau%2F-MDStn3IZ5J_c9dqi_2Z%2F-MDSzTKfmIclsngsuJ6f%2FNodeMCU-ESP8266-Pinout.jpg?alt=media\&token=21e945d8-a037-4717-8318-cdcc811de95f)

We will use DS18b20 temperature sensor. There are 3 pins for this sensor which are GND (Ground), VCC (Voltage Common Collector), and SIG (Signal). &#x20;

![VCC (Green), GND (Red), and SIG (Yellow)](https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MClo3nC-1US0rbK8Qau%2F-MDStn3IZ5J_c9dqi_2Z%2F-MDSurmGSOisJ5A8Xsme%2F20200729_132257.jpg?alt=media\&token=c5a407dd-481e-4642-a2f4-bde91169a56f)

How we connect the sensor to ESP3266:&#x20;

* GND (Red): To "G" pin of ESP3266
* VCC (Green): to 3V pin of ESP3266
* SIG (Yellow): to D4 pin of ESP3266

Oh, don't forget a resistor (330 ohms) between a 3V pin and D4 pin.&#x20;

![](https://1856353139-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MClo3nC-1US0rbK8Qau%2F-MDStn3IZ5J_c9dqi_2Z%2F-MDSuxracEFucwQiRO1y%2F20200729_132234.jpg?alt=media\&token=b823bdfe-1472-4cb7-aaed-11d4e91aea96)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aic-eec.com/general/hot-cloud/connect-esp3266-to-mqtt/connect-esp3266-to-sensor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
