DS18B20 Temperature sensor

DS18B20 Temperature sensor

DS18B20 Temperature sensor

101.69

In stock

101.69

DS18B20 Temperature sensor

SKU: IWP-00147 Categories: , ,
  • Description
  • Additional information
  • Reviews (0)

Description

DS18B20 / DS18B20 /18B20 Temperature sensor

 

//Include libraries
#include
#include

// 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);
}

 

 

 

Additional information

Weight0.01 kg

Reviews

There are no reviews yet.


Only logged in customers who have purchased this product may leave a review.

You've just added this product to the cart: