Ks0124 keyestudio EASY plug DS18B20 Temperature Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
==EASY plug DS18B20 Temperature Sensor==
[[image:ks0124图.jpg|thumb|600px|right|EASY plug DS18B20 Temperature Sensor]]
<br>[[File:ks0124-1.png|500px|frameless|thumb]]<br>


==Introduction==
==Introduction==
This DS18B20 Temperature Sensor Module can be used to quantify environmental temperature testing. The temperature range is -55 ~ +125 ℃, inherent temperature resolution 0.5 ℃. It also support multi-point mesh networking.<br>
The DS18B20 temperature sensor is exactly what it sounds like - a sensor used to measure ambient temperature.<br>
Note: this module needs to be used together with EASY plug control board.<br>
The usable temperature ranges from -55°C to +125°C. It also supports multi-point mesh networking. <br>


While there are many types of temperature sensors available in the market, the DS18B20 temperature sensor is the best choice in applications which require high accuracy and high reliability.<br>
For electronic enthusiasts and hobbyists, the DS18B20 is a good start for learning and developing temperature-dependent prototypes.  <br>
This module should be used together with EASY plug control board.
<span style=color:red> '''Special Note:''' <br>
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface. <br> If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module. </span><br>
<br>


==Specification==
==Specification==
* Interface: Easy plug
* Connector: Easy plug
* Supply Voltage: 3.3V to 5V
* Supply Voltage: 3.3V to 5V
* Temperature range: -55 °C ~ +125 °C
* Temperature range: -55°C to +125°C
* Interface: Digital
* Interface: Digital
* Size: 40*20mm
* Weight: 5g


<br>
==Technical Details==
* Dimensions: 38mm*20mm*18mm
* Weight: 4.4g
<br>
==Connect It Up ==
Connect the EASY Plug DS18B20 temperature sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
<br>[[File:ks0124.jpg|500px|frameless|thumb]]<br>
<br>
==Upload the Code==
Below is an example code. Open or drag below code to [https://wiki.keyestudio.com/Getting_Started_with_Mixly  Mixly Blocks] and upload. <br>
<br>[[File:ks0398 20.1.png|500px|frameless|thumb]]<br>
<br>
==What You Should See==
<br>[[File:ks0398 20-1.png|500px|frameless|thumb]]<br>
<br>
Done uploading the code, open the serial monitor, on the window will print out the Celsius and Fahrenheit value.
<br>[[File:ks0398 20-2.png|500px|frameless|thumb]]<br>


==Connection Diagram ==
<br>
<br>[[File:ks0124-2.png|500px|frameless|thumb]]<br>
== Adding OLED Display ==
<br>
'''Hookup Guide'''<br>
<br>[[File:18B20 OLED.jpg|500px|frameless|thumb]]<br>


<br>
'''Test Code'''<br>
<br>[[File:ks0398 20.2.png|500px|frameless|thumb]]<br>


==Sample Code==
<br>
http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip
'''What You Should See'''<br>
<pre>
Upload success, you should be able to see the Celsius and Fahrenheit value are printed out on the OLED screen.  
#include <OneWire.h>
<br>[[File:ks0398 20-6.png|500px|frameless|thumb]]<br>
int DS18S20_Pin = 2; //DS18S20 Signal pin on digital pin 2
//Temperature chip i/o
OneWire ds(DS18S20_Pin);  // on digital pin 2
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
float temperature = getTemp();
Serial.println(temperature);
delay(100); //to slow down the output so it is easier to read
}
float getTemp(){
//returns the temperature from one DS18S20 in DEG Celsius
byte data[12];
byte addr[8];
if ( !ds.search(addr)) {
    //no more sensors on chain, reset search
    ds.reset_search();
    return -1000;
}
if ( OneWire::crc8( addr, 7) != addr[7]) {
    Serial.println("CRC is not valid!");
    return -1000;
}
if ( addr[0] != 0x10 && addr[0] != 0x28) {
    Serial.print("Device is not recognized");
    return -1000;
}
ds.reset();
ds.select(addr);
ds.write(0x44,1); // start conversion, with parasite power on at the end
byte present = ds.reset();
ds.select(addr);   
ds.write(0xBE); // Read Scratchpad
for (int i = 0; i < 9; i++) { // we need 9 bytes
  data[i] = ds.read();
}
ds.reset_search();
byte MSB = data[1];
byte LSB = data[0];
float tempRead = ((MSB << 8) | LSB); //using two's compliment
float TemperatureSum = tempRead / 16;
return TemperatureSum;
}
</pre>


==Resources ==
<br>
<span style="color: red"><big>'''Troubleshooting:'''</big> </span> <br>
* '''OLED Not Lighting Up?'''<br>
If upload the code successfully, but LED still not lights up. Make sure your board and OLED module are connected correctly. <br>
<br>
* '''Upload Failed ?'''<br>
This happens sometimes, the most likely case is a confused Board and serial port, you should firstly select your proper board and port. <br>
Or check whether add the library or not.<br>
<br>[[File:ks0398 20-3.png|500px|frameless|thumb]]<br>
<br>[[File:Ks0398 9-4.png|500px|frameless|thumb]]<br>
<br>[[File:ks0398 9-5.png|500px|frameless|thumb]]<br>


'''PDF'''
<br>
<br>


https://drive.google.com/open?id=1thhRA_Qcgri0Z0hs8L2zu6FqEyOiLvi3
==Resources ==


'''Libraries'''
https://fs.keyestudio.com/KS0124


https://drive.google.com/open?id=14ikf_FgLyNAIecA9zvV2A1b3Lmr24hPm
<br>
<br>


==Buy from ==
==Buy from ==
'''Official Website'''
*[https://www.keyestudio.com/new-keyestudio-easy-plug-ds18b20-temperature-sensor-for-arduino-steam-p0068-p0068.html  '''Official Website''' ]
 
*[https://www.aliexpress.com/store/product/New-Keyestudio-EASY-Plug-DS18B20-Temperature-Sensor-for-Arduino/1452162_32642758650.html?spm=2114.12010612.8148356.18.7da057f6bcAapG  Shop on aliexpress ]


http://www.keyestudio.com/keyestudio-easy-plug-ds18b20-temperature-sensor-for-arduino.html


[[category:EASY Plug]]
[[category:EASY Plug]]

Latest revision as of 16:27, 7 January 2021

EASY plug DS18B20 Temperature Sensor

Introduction

The DS18B20 temperature sensor is exactly what it sounds like - a sensor used to measure ambient temperature.
The usable temperature ranges from -55°C to +125°C. It also supports multi-point mesh networking.

While there are many types of temperature sensors available in the market, the DS18B20 temperature sensor is the best choice in applications which require high accuracy and high reliability.
For electronic enthusiasts and hobbyists, the DS18B20 is a good start for learning and developing temperature-dependent prototypes.
This module should be used together with EASY plug control board.

Special Note:
The sensor/module is equipped with the RJ11 6P6C interface, compatible with our keyestudio EASY plug Control Board with RJ11 6P6C interface.
If you have the control board of other brands, it is also equipped with the RJ11 6P6C interface but has different internal line sequence, can’t be used compatibly with our sensor/module.


Specification

  • Connector: Easy plug
  • Supply Voltage: 3.3V to 5V
  • Temperature range: -55°C to +125°C
  • Interface: Digital


Technical Details

  • Dimensions: 38mm*20mm*18mm
  • Weight: 4.4g


Connect It Up

Connect the EASY Plug DS18B20 temperature sensor to control board using an RJ11 cable. Then connect the control board to your PC with a USB cable.
thumb


Upload the Code

Below is an example code. Open or drag below code to Mixly Blocks and upload.

thumb


What You Should See


thumb

Done uploading the code, open the serial monitor, on the window will print out the Celsius and Fahrenheit value.
thumb


Adding OLED Display


Hookup Guide

thumb


Test Code

thumb


What You Should See
Upload success, you should be able to see the Celsius and Fahrenheit value are printed out on the OLED screen.
thumb


Troubleshooting:

  • OLED Not Lighting Up?

If upload the code successfully, but LED still not lights up. Make sure your board and OLED module are connected correctly.

  • Upload Failed ?

This happens sometimes, the most likely case is a confused Board and serial port, you should firstly select your proper board and port.
Or check whether add the library or not.

thumb

thumb

thumb



Resources

https://fs.keyestudio.com/KS0124



Buy from