Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
S1m30n
Published

DS18B20 temperature sensor with Android and Seeeduino XIAO

Read DS18B20 sensor data using Android mobile phone and Seeeduino XIAO microcontroller.

BeginnerProtip3 hours1,475
DS18B20 temperature sensor with Android and Seeeduino XIAO

Things used in this project

Hardware components

Seeed Studio Seeeduino XIAO
×1
DS18B20 Programmable Resolution 1-Wire Digital Thermometer
Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer
×1
Resistor 4.75k ohm
Resistor 4.75k ohm
×1
Type-C to USB 3.1
×1

Software apps and online services

Serial USB Terminal

Story

Read more

Schematics

Schematic

Code

Temperature data

Arduino
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE 2

OneWire oneWire(ONE_WIRE);
DallasTemperature sensors(&oneWire);

void setup() {
    Serial.begin(9600);
    sensors.begin();
}

void loop() {
    sensors.requestTemperatures();
    Serial.println(sensors.getTempCByIndex(0));
    delay(1000);
}

Credits

S1m30n
1 project • 0 followers
Thanks to TheGadgetBoy.

Comments