DS18B20 Temperature sensor

DS18B20 Temperature sensor

TSOP Infrared Sensor Module

TSOP Infrared Sensor Module

MAX9812L Microphone sensor

MAX9812L Microphone sensor

DS18B20 Temperature sensor

DS18B20 Temperature sensor

₹69.62
SKU
IWP-00147
DS18B20 Temperature sensor is available to buy in increments of 1

DS18B20 / DS18B20 /18B20 Temperature sensor


//Include libraries
#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 8 on the Arduino
#define ONE_WIRE_BUS 8
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

void setup(void)
{
Serial.begin(9600); //Begin serial communication
Serial.println("Serial Monitor Version"); //Print message
sensors.begin();
}

void loop(void)
{
// command to get temperatures
sensors.requestTemperatures();
Serial.print("Temperature is: ");
Serial.println(sensors.getTempCByIndex(0)); // 0 refers to the first IC on the wire
//Update value time
delay(1000);
}




More Information
HSN: 85423100
Compatible with Arduino, Raspberry Pi, Node MCU , Others
Write Your Own Review
Only registered users can write reviews. Please Sign in or create an account