0% found this document useful (0 votes)
145 views8 pages

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD

This document describes how to create a temperature sensor system using an Arduino Nano, two DS18B20 temperature sensors, and an I2C LCD display. It involves connecting the components in a circuit, finding the addresses of the sensors and display using code, and writing code to read temperatures from each sensor and display them on the LCD in separate rows. The code allows restricting decimal places and includes a custom character for displaying the temperature symbol. Overall it provides instructions for setting up a simple two-sensor temperature monitoring system with an LCD readout.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views8 pages

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD

This document describes how to create a temperature sensor system using an Arduino Nano, two DS18B20 temperature sensors, and an I2C LCD display. It involves connecting the components in a circuit, finding the addresses of the sensors and display using code, and writing code to read temperatures from each sensor and display them on the LCD in separate rows. The code allows restricting decimal places and includes a custom character for displaying the temperature symbol. Overall it provides instructions for setting up a simple two-sensor temperature monitoring system with an LCD readout.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

instructables

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD

by SirTonic

Today I want show to you how to make Two We need to measure two temperatures and see these
temperature sensors DS18B20 with Arduino Nano temperatures on display.
Clone and I2C LCD. As you can see, we have 16x2 I2C display, that
// Dnes bych vam chtel ukazat, jak zprovoznit dve means 1 row = 1 temperature.
teplotni cidla DS18B20 s Arduino Nano klonem a I2C
displejem. // Potrebujeme merit dve teploty a tyto teploty zobrazit
na displeji.
I use Arduino IDE 1.8.8 // Pouzivam Arduino ve verzi // Jak jste si vsimli, mame 16x2 displej v nasem
1.8.8 (toho casu aktualni verze) pripade to znamena 1 radek = 1 teplota.

In comment you can see // Czech language

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 1
Step 1: Prepare // Priprava

What we need // Co budeme potrebovat:

1x Arduino Nano or Clone (I have compatible clone with CH341)


1x I2C LCD (I have 16x2 with blue backlight)
2x Dallas temperature sensors DS18B20 (I have waterproof version)
1x 4,7k resistor

My recomended:

Arduino Nano terminal shield (with screws) // Doporucuji pro instalaci Arduino Nano terminal shield
For test assembly circuit we can use breadboard // pro otestovani pouzijeme nepajive pole

Info:

For Win10 64bit users, I had a big problem finding the right drivers. All recommended drivers did not work.
That's why I added the functional drivers to download. Also you can download actualy drivers here.

// Pro uzivatele Win10 64bit, mel jsem velike problemy najit funcni ovladace. Vsechny doporucovane ovladace
// (vcetne ovladacu na strankach obchodu) nefungovaly. Proto jsem pridal v mem pripade funkcni ovladace ke
// stazeni. Aktualni verzi ovladacu, muzete stahnout zde.

How to install drivers very briefly:

Download drivers.zip //Stahnete ovladace


Extract drivers.zip into folder
Install the drivers // Nainstalujte ovladace
Connect Arduino Nano // Pripojte Arduino Nano

Properly installed drivers you can check in the Windows Device Manager

// Spravne nainstalovane ovladace muzete zkontrolovat ve Spravci zarzeni Windows

Now we can run Arduino IDE // Nyni muzeme spustit Arduino IDE

We must choose correct options in the Arduino IDE in our case it is: // V Arduino IDE musite vybrat spravne
nastaveni

Right board Arduino Nano // Arduino desku


For Nano Clone (328P Old bootloader) // Pro klon vybereme (Old bootloader)
Communication Port // komunikacni port

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 2
1

1. 16x2 I2C

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 3
Step 2: Circuit Assembly // Zapojeni Obovdu

Temperature sensors allows parasitic wiring. This will not be described here.
For more information about parasitic wiring use google.com

// parazitni zapojeni teplotnich senzoru zde nebudu popisovat. Pokud chcete vice informaci o parazitickem
zapojeni cidel pouzijte google.com

Info:

PIN A4 - SDA
PIN A5 - SCL

Warning:

Solder and tin can be HOT! ;-) // Neopalit se, je zaklad ;-)

The second photo is a possible result.

1. Resistor 4,7k

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 4
Step 3: Arduino IDE Search the Address

Assuming everything works, we can run Arduino IDE


// Za predpokladu, ze vse funguje, muzeme spustit Arduino IDE

This step have three sub steps: // Tento krok ma tri dilci kroky

1. Find the address I2C LCD // Najdeme adresu I2C displeje


2. Find the ROM address temperature sensors // Najdeme adresu teplotnich cidel
3. Our thermometers code // nas vlastni kod

1. Find / Check I2C address


Easiest way to find address is use prepared I2C_scanner.ino
Copy to Arduino IDE
Upload to the Board
Show serial Monitor (copy the address, we will need it)

2. Find ROM address


Repeat first step with DS18B20_finder.ino
Show serial Monitor (copy the address, we will need it)

Our own code is next step...

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 5
Step 4: Arduino IDE Own Code and Features // Vlastni Kod Teplomeru a Funkce

We have all necessary information. Let's look at your B11111,


own code. B01110
// Mame vsechny potrebne informace, pojdme se };
podivat na nas kod.
-------------------------------------------------------------------------
Info:For sure, all important steps on the photos are ------------------
commented
// Vsechny dulezite kroky na fotografiich jsou If you want any another char, you can make on this si
komentovany. te

Specification resolution: // Specifikace rozliseni // Pokud chcete vytvorit jakykoli vlastni znak, muzete
teplotnich senzoru pouzit tento generator

Resolution / Increment / Time

9 bit / 0.5 degrees C / 93.75 mSec


10 bit / 0.25 degrees C / 187.5 mSec Celsius char (°)
11 bit / 0.125 degrees C / 375 mSec
12 bit / 0.0625 degrees C / 750 mSec lcd.print((char)223);

------------------------------------------------------------------------- Restriction of decimal places // Omezeni poctu


------------------ desetinnych mist

Thermometer char
If for some reason you only need one decimal place
byte teplomer[8] = // coding thermometer char
(vytvoreni znak teplomeru) // Pokud z nějakého důvodu potřebujete pouze jedno
{ desetinné místo
B00100,
B01010, lcd.print(read_temperature(),1); // 1 (the number 1
B01010, specifies the number of decimal places)
B01110,
B01110, // Cislo 1 udava pocet desetinnych mist
B11111,

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 6
Step 5: Finish - Gallery // Konec - Galerie

And few words in the end...?

I hope it was useful and helped us.

Many features can be more and better, but in my case it's all I need.

That's all friends!!

//

Par slov na zaver?

Doufam, ze jsem nam pomohl. Mnoho funkci muze byt pridano a mohou byt lepsi, ale v mem pripade to bylo vse
co potrebuji.

To je vse, pratele!!

Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 7
Arduino Nano and Two DS18B20 Temperature Sensors With I2C LCD: Page 8

You might also like