Arduino With the DS18b20

by anuragfulmali in Circuits > Arduino

71 Views, 0 Favorites, 0 Comments

Arduino With the DS18b20

Screenshot 2024-07-24 104524.png
Temprature sensor.jpg

This Temperature sensor is wired temperature sensor which do operate like other temperature sensors and it's advantage over other temperature sensor is that it is water proof means it can be put into the ice, water(hot and cold) which has no effect on its electronics hardware compared to other temperature sensor which are tender to operate inside water or moisture like condition.

The only most noticeable thing of this DS18b20 is that it operates on 3.3volts from Arduino power pin all the other components works on the 5v input but this is not.

This input sensor has 3 wires 3.3 vcc,ground,output.

This sensor also do require the Special libraries to operate in the IDE which are Onewire, Dallastempreture DS18b20.

Supplies

Screenshot 2024-07-24 112140.png
Screenshot 2024-07-15 135746.png
Screenshot 2024-07-16 120739.png
Screenshot 2024-07-26 093151.png
Screenshot 2024-07-15 140240.png
Screenshot 2024-07-15 140850.png

1.Arduino Uno

I learned that Hardware and Controlling it through using Arduino IDE Software are Separate parts in a Single Electronic Device that consists of a programable ATMEGA328p chip,

Hardware Consists of a Arduino Board which Particularly has Some Digital and Analog (Input/Output)It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header and a reset button.

and a USB type data transmitter and Reciever connecting jack.

let's get into the actual transmission and recieving of data which is done through the input of signal through the programme code which has been programed in the chip.

The Board has been built-up in such a way that it passes the (HIGH) Signal to the pin mentioned in the program as an input at the pin of 5 volts means for the program the pin is in ON State

So thus,The pins sends the message to output device using electrical signal of 5 volts in this way a data is transfered and recieved at the board output.

This is just the basic analogy of Transmission and Recieving of the data in form of Electrical Signal which is doing the actual work of communicating with the sensors,motors,devices connected on the Board.

2.Connecting Wires

3.100 Ohm Resistor

4.DS18b20 temprature sensor

5.Arduino IDE

DS18b20 Temperature Sensor

Screenshot 2024-07-24 104524.png

The DS18B20 is a digital thermometer sensor renowned for its high accuracy and ease of use. It is widely utilized in applications such as weather stations, industrial systems, and home automation projects due to its reliable performance. One of its standout features is the digital output, which eliminates the need for an analog-to-digital converter when interfacing with microcontrollers. Additionally, the DS18B20 employs a unique one-wire interface, allowing multiple sensors to share the same data line, thereby simplifying wiring and reducing the number of pins required on the microcontroller.

https://cdn.sparkfun.com/datasheets/Sensors/Temp/DS18B20.pdf

Programme

#include <OneWire.h>

#include <DallasTemperature.h>

 

// Data wire is plugged into digital pin 2 on the Arduino

#define ONE_WIRE_BUS 2

 

// Setup a oneWire instance to communicate with any OneWire device

OneWire oneWire(ONE_WIRE_BUS);  

 

// Pass oneWire reference to DallasTemperature library

DallasTemperature sensors(&oneWire);

 

void setup(void)

{

 sensors.begin(); // Start up the library

 Serial.begin(9600);

}

 

void loop(void)

 // Send the command to get temperatures

 sensors.requestTemperatures(); 

 

 //print the temperature in Celsius

 Serial.print("Temperature: ");

 Serial.print(sensors.getTempCByIndex(0));

 Serial.print((char)176);//shows degrees character

 Serial.print("C | ");

  

 //print the temperature in Fahrenheit

 Serial.print((sensors.getTempCByIndex(0) * 9.0) / 5.0 + 32.0);

 Serial.print((char)176);//shows degrees character

 Serial.println("F");

  

 delay(500);

}

Hardware Connection

Temprature sensor.jpg

The Operation of this sensor is easy,you only will have to connect the jumper wires as mentioned in the Programme and you will be able to pair the sensor and get the desired output as a Result.

I have attached the video of the Result Output of Temperature Sensor on the Serial Monitor Of Arduino IDE.

Downloads