Each DS18B20 has a unique 64-bit serial code, which allows multiple DS18B20s to function on the same 1-Wire bus. Thus, it is simple to use one microprocessor to control many DS18B20s distributed over a large area.
Benefits and Features:
Unique 1-Wire® Interface Requires Only One Port Pin for Communication
Reduce Component Count with Integrated Temperature Sensor and EEPROM
Measures Temperatures from -55°C to +125°C (-67°F to +257°F)
±0.5°C Accuracy from -10°C to +85°C.
Programmable Resolution from 9 Bits to 12 Bits
Parasitic Power Mode Requires Only 2 Pins for Operation (DQ and GND)
Simplifies Distributed Temperature-Sensing Applications with Multidrop Capability
Each Device Has a Unique 64-Bit Serial Code Stored in On-Board ROM
Flexible User-Definable Nonvolatile (NV) Alarm Settings with Alarm Search Command Identifies Devices with Temperatures Outside Programmed Limits.
In this blog, we will learn how to interface the DS18b20 sensor with an ESP32 and also learn about Thingspeak. ThingSpeak™ is an IoT analytics platform service that allows you to aggregate, visualize, and analyze live data streams on the cloud. You can send data to ThingSpeak from your devices, create instant visualizations of live data, and send alerts using web services like Twitter® and Twilio®. With MATLAB® analytics inside ThingSpeak, you can write and execute MATLAB code to perform preprocessing, visualizations, and analyses. ThingSpeak enables engineers and scientists to prototype and build IoT systems without setting up servers or developing web software.
Key capabilities of ThingSpeak include:
Configure devices to send data to ThingSpeak using a REST API or MQTT.
Aggregate data on-demand from devices and third-party sources.
Get instant visualizations of live or historical sensor data.
Preprocess and analyze your collected data using integrated MATLAB.
Run your IoT analytics automatically based on schedules or events.
Act on your data and communicate using third-party services like Twilio or Twitter.
We start off by making a thingspeak account. Head over to https://thingspeak.com and create your account. A verification mail will be sent to your registered mail ID. Once you verify, thingspeak will redirect you to create a MathWorks account as well as thingspeak uses MATLAB for analysis. Once your MathWorks account is also created, you can log in to the thingspeak account and create a channel where the temperature data from the DS18b20 will be logged and can be accessed anytime.
After you log in, you can see a “Create New Channel” option pop up on the screen. You will have to fill out the following data about the channel.
Fill out the Channel Settings page and click on save channel at the bottom of the page to create the channel. You can refer to the below-mentioned points if you have a doubt regarding the details to be filled out.
Channel Name *: Enter a unique name for the ThingSpeak channel.
Description *: Enter a description of the ThingSpeak channel.
Field# *: Check the box to enable the field, and enter a field name. Each ThingSpeak channel can have up to 8 fields.
Metadata: Enter information about channel data, including JSON, XML, or CSV data.
Tags: Enter keywords that identify the channel. Separate tags with commas.
Link to External Site: If you have a website that contains information about your ThingSpeak channel, specify the URL.
Show Channel Location:
Latitude: Specify the latitude position in decimal degrees. For example, the latitude of the city of London is 51.5072.
Longitude: Specify the longitude position in decimal degrees. For example, the longitude of the city of London is -0.1275.
Elevation: Specify the elevation position meters. For example, the elevation of the city of London is 35.052.
Video URL: If you have a YouTube or Vimeo video that displays your channel information, specify the full path of the video URL.
Link to GitHub: If you store your ThingSpeak code on GitHub, specify the GitHub repository URL.
* - Mandatory fields to fill
Once the channel is created, click on the API Keys tab and make a note of the “Channel ID” and “Write API Key”. An interesting feature of thingspeak is that the data saved on the Cloud can be accessed by Android and IOS applications. One such application is called PocketIOT. Install this app from the play store and with the help of the channel details such as Channel ID and Read API Key, you can monitor the stored data on your phone anytime.