Boaz Lawnce
Published © GPL3+

Nano Waterproof Temperature Sensor @ 98.5*C

Testing DS18B20 @ 98*C Hot water

IntermediateProtip3,070
Nano Waterproof Temperature Sensor @ 98.5*C

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
DS18B20 Programmable Resolution 1-Wire Digital Thermometer
Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer
×1
Female/Female Jumper Wires
Female/Female Jumper Wires
×3
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Circuit Diagram

Code

Code

C/C++
#include <SoftwareSerial.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2
SoftwareSerial BzSerial(3,4);
const int LED = 13;
OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

 float Celcius=0;
 float Fahrenheit=0;
void setup(void)
{
  BzSerial.begin(9600);
  Serial.begin(9600);
  sensors.begin();
}

void loop(void)
{ 
  sensors.requestTemperatures(); 
  Celcius=sensors.getTempCByIndex(0);
  Fahrenheit=sensors.toFahrenheit(Celcius);
  BzSerial.print(Celcius);
  BzSerial.print(" *C   ");
  BzSerial.println(Fahrenheit);
  BzSerial.print(" F");
  int C = Celcius;
 if(C>30)
  {
    BzSerial.println("Temperature Exceeds above 30*C ");
  }
  else
  {
    BzSerial.println("Temperature is below 30*C ");
  }
  delay(1000);
}

Credits

Boaz Lawnce
11 projects • 38 followers
Electronics Engineer, Founder, Hobbyist....

Comments