0% found this document useful (0 votes)
12 views14 pages

Arduino Temperature Sensor Project

The document outlines a project focused on designing a temperature sensor using an Arduino board and an LCD screen, aiming to measure and display temperature in both Celsius and Fahrenheit. It details the components used, including the TMP36 temperature sensor, Arduino Uno R3, and LCD 16x2, along with their specifications and functionalities. The project also includes an assembly diagram and programming instructions for implementing the sensor and displaying the readings on the LCD.

Translated by

ScribdTranslations
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)
12 views14 pages

Arduino Temperature Sensor Project

The document outlines a project focused on designing a temperature sensor using an Arduino board and an LCD screen, aiming to measure and display temperature in both Celsius and Fahrenheit. It details the components used, including the TMP36 temperature sensor, Arduino Uno R3, and LCD 16x2, along with their specifications and functionalities. The project also includes an assembly diagram and programming instructions for implementing the sensor and displaying the readings on the LCD.

Translated by

ScribdTranslations
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

PRIVATE UNIVERSITY

DOMINGO SAVIO

Temperature Sensor

Estudiante:Giancarlo Terrazas Carrasco

Subject: Digital Systems II


Careers: Engineering in Networks and Telecommunications

Semester: 4th Semester


Temperature Sensor with Arduino

Specific Objectives:

Design a device capable of measuring the temperature of a specific environment by applying


the Arduino board and the LCD screen.
Usar la plataforma Arduino para obtener latemperatura en Celsius y Fahrenheit.
Gain experimental knowledge in the assembly of electronic projects.
Understanding the programming codes of the Arduino platform.

General Objective:

This project will present the development of a temperature measurement circuit.


using an analog temperature sensor TMP36 that allows us to know the temperature that
register the sensor, we will also be able to display the temperature value in degrees Celsius and
Using an LCD screen, this will be possible thanks to the Arduino platform.
The main objective of this project is to know, characterize, and apply one of the platforms of
the most widely used open source hardware and software in the field of development
programming.

List of Components:
1 Temperature sensor [TMP36]
1 Arduino Uno R3
1 LCD 16 x 2
3 220 Ω Resistor
1 Red LED
1 Blue LED
1 Breadboard 1/2 cookie

TMP36 Temperature Sensor

The TMP36 is a temperature sensor in degrees Celsius with precision and low voltage. The output
The voltage provided is linearly proportional to the temperature in degrees Celsius. No
requires no external calibration to provide a typical accuracy of ± 1°C at +25°C and ±
2°C above the temperature range of -40°C to +125°C. This sensor is very easy to use,
just connect it to ground and to a voltage of 2.7 to 5.5 VDC and you can start taking measurements
readings through the Vout pin. The output voltage can be easily converted to temperature
using the scale factor of 10mV/¼C.
Characteristics:

Input voltage: 2.7 to 5.5V DC


Scale factor 10mV/°C
Accuracy of ±2°C over temperature
Linearity of ±0.5°C
Rango de operación: -40°Ca +125 °C

2. Arduino:

What is Arduino?

Arduino is an open-source electronics platform whose principles are


to have easy-to-use software and hardware. That is, a simple way to carry out projects.
interactive for anyone.

Arduino can be used to develop autonomous elements, or connect to others.


devices or interact with other programs, to interact both with the hardware and with
the software. Serving to control an element, let’s take for example a motor that gives us
raise or lower a blind based on the light available thanks to a sensor connected to the Arduino, or
well to transform the information from a source, such as a keyboard, and convert it
information to something that understands, for example, a computer.

Model - Arduino Uno R3

This is the new Arduino Uno R3, it uses the ATmega328 microcontroller. In addition to all the
Characteristics of previous cards, the Arduino Uno uses the ATmega16U2 for management of
USB instead of the 8U2 (or the FTDI found in previous generations). This allows for rates of
faster transfers and more memory. No drivers are needed for Linux or Mac (the inf file
for Windows it is necessary and included in the Arduino IDE).

The Arduino Uno R3 board also adds SDA and SCL pins close to the AREF pin. Moreover, there are two
new pins near the RESET pin. One is the IOREF, which allows shields to adapt to the voltage.
provided by the card. The other pin is not connected and is reserved for purposes
future. Latarjet works with all existing shields and will be able to adapt to new ones.
shields using those additional pins.

Arduino is an open-source computing platform based on a simple board.


I/O and a development environment that implements the Processing/Wiring language. The Arduino Uno R3
it can be used to develop interactive objects or it can be connected to your software
computer (for example, Flash, Processing, MaxMSP). The open-source IDE can be downloaded
free of charge (currently for Mac OS X, Windows, and Linux).
Characteristics:
Microcontroller: ATmega328
Operating Voltage: 5v
Input Voltage (Recommended): 7 - 12 v
Digital Input/Output Pins: 14 (of which 6 are PWM outputs)
Analog Input Pins: 6
Flash Memory: 32 KB (ATmega328) of which 0.5 KB is used by the Bootloader.
SRAM:2 KB (ATmega328)
EEPROM: 1 KB (ATmega328)
Clock Speed: 16 MHz

3. LCD 16 x 2:

The LCD (Liquid Crystal Display) or liquid crystal screen is a device used for the
visualization of contents or information in a graphic way, through characters, symbols or
small drawings depending on the model. It is controlled by a microcontroller that directs
its entire operation.

In this case, we are going to use a 16x2 LCD, which means it has 2 rows of 16.
characters each. The pixels of each symbol or character vary depending on each model.

16x2 LCD screen 1602 controller compatible HD44780. 2-line LCD display with 16 characters
with HD44780 compatible controller, green background and black letters, backlit. Thanks to its
backlighting, messages are clearly visible even in total darkness. Ideal for everyone
your electronics projects where you need to see information on screen. You will be able to control it
easily with Arduino with theLiquidCrys librarytal.
Characteristics:

16 characters x 2 lines
5x8 point characters
Character size: 5.23 x 3 mm
It can display letters, numbers, special characters, and up to 8 characters created by the
user
Blue LED backlight
White characters
Parallel interface. It can operate in 8-bit mode or 4-bit mode to save pins.
microcontroller
It has KS0066U controller or equivalent on-board (compatible with Hitachi HD44780)
Supply voltage: 5 V

LCD Connections
Power pins:
Vss:Gnd.
Vdd: +5 volts
Vee: corresponds to the contrast pin, we will regulate it with a 10K potentiometer.
connected to Vdd.

Control pins:
RS: Corresponds to the data control register selection pin (0) or register of
data(1). That is, the RS pin operates parallel to the data bus pins. When RS
The data present on the bus is 0, belonging to a control/instruction register. And when RS
1 is the data present on the data bus belongs to a data register or a character.
RW:Corresponds to the Write pin (0) or the Read pin (1). It allows us to write a data in the
screen or read a data from the screen.
E: Corresponds to the Enable or activation pin. If E(0) it means that the LCD is not
activated to receive data, but if E(1) is active and we can write or read
from the LCD.

Data Bus Pins:

The bidirectional data bus includes pins D0 to D7. To perform the communication
With the LCD we can do it using the 8 bits of the data bus (D0 to D7) or by using the 4 bits.
most significant of the data bus (D4 to D7). In this case, we will explain the communication with the
4-bit bus.

4. Resistors (220 ):

A resistor is an electrical element that possesses


two poles or terminals that allow it to be inserted into a
circuit with the objective of offering some opposition
to the flow of electric current. A resistor is
additionally a symmetric and linear dipole. What is it?
symmetric means that its operation does not
depends on your connection speed, it can be
invert the polarity producing the same effect
in the circuit in which it is interposed. What is it?
Linear means that it follows Ohm's law.

A resistor can consist of a long metallic wire, made of a material not excessively good.
conductor, wrapped around a dielectric. For years, these types were used, but nowadays,
Ceramic resistors are commonly used.

Resistance Formula:
p∗L
R=
S
Where from:

R = Resistance of the material in ohms (Ω).


p = Coefficient of resistivity or specific resistance of the material at a temperature
daddy.
l = Length of the material in meters.
s = Surface or cross-sectional area of the material in mm2.

Characteristics

Electrical Resistance: 220 Ω


Dissipation power: 0.25 watts.
Through-hole insertion technology.
Manufacturer: Generic.
Arrangement: Axial Type.
Tolerance: 5%.

Color Code for Resistors

To know the value of a resistor, we have to look that it has 3 consecutive color bands.
and a fourth one more separated. The first 3 bands tell us their value, the fourth band indicates
tolerance, that is to say the value ± the value that you can have above or below the value that
mark the first 3 bands. To learn how to calculate the value of a resistor, visit the
next link:Resistor Color Codetensembles.
5. LED:
The LED, acronym for 'Light Emitting Diode', or diode
solid state light emitter, constitutes a
special type of semiconductor, whose characteristic
The main goal is to convert low electrical current into light.
voltage that passes through its chip. From the point of view
a common LED is presented as a bulb
miniaturized, lacking filament or any other
type of hazardous element or material, with the advantage
about other technologies that do not pollute the environment
environment.

Structure of a Led

LEDs are made of semiconductor material that is wrapped in a translucent plastic.


transparent according to the models. In the figure, we can observe the internal distribution.

The smaller internal electrode is the anode and the larger one is the cathode.

The first LEDs were designed to allow the passage of the maximum amount of light in one direction.
perpendicular to the mounting surface, later designed to diffuse light over an area
wider thanks to the increase in light production by LEDs.

Selection criteria:
1. Dimensions and color of the diode

Currently, LEDs come in different sizes, shapes, and colors. We have round LEDs,
squares, rectangular, triangular and with various shapes.
The basic colors are red, green, and blue, although we can find oranges and yellows.
There is even a white light LED.
The dimensions of round LEDs are 3mm, 5mm, 10mm, and a giant one of 20mm.
Polyhedral shapes usually have approximate dimensions of 5x5mm.

2. Angle of view

This characteristic is important, as it determines the mode of observation of the Led, that is,
the practical use of the device carried out.
When the LED is point-like, the light emission follows Lambert's law, allowing for an angle of
Relatively large view and the bright spot can be seen from all angles.

3. Luminosity

The luminous intensity on the axis and the brightness are intensely related. Whether the LED is
punctual or diffuser, the brightness is proportional to the emission surface.
If the Led is point-like, the point will be brighter, as it is too small a surface. In one
The intensity of the diffuser along the axis is higher than the point model.

4. Consumption

The consumption depends a lot on the type of LED we choose:

6. Half breadboard:

Breadboard is the English name for the board


of insertion or test board, which is
basically a small board that includes
various openings that follow a pattern
determined, which, internally, are
they are electrically connected to each other.

Basically, the purpose of the protoboard is to


allow us to insert all types of components
electronics and cables, achieving this
how to assemble an electronic circuit or a
system for different uses.
Thanks to this small board, we are going to be able to
create and check all types of electronic circuit prototypes, something essential first
a place to practice, that is, if you are learning electronics you will need a protoboard to
learning, and of course it also concerns the model that we are going to create before making the
mechanical printing of the circuit in commercial production systems.
Features:

Color: Blanco
Breadboard (experimental board) also known as cookie
1/2 Cookie with 400 contact points
2 power lines on each side
With adhesive to attach it to other surfaces
Possibility of connecting other protoboards (half a breadboard)
Tools for assembling prototypes or electronic circuit projects
Compatible with protoboard wire and connection cables
Dimensions: 8.2 x 5.5 x 0.85 cm

7. Assembly diagram:

The circuit assembly with our Arduino board is as follows:


Code:

First we will import the LCD and servo libraries, then we will proceed to declare all the
variables and naming the pins.

LiquidCrystal Library: This library contains everything necessary to manage an LCD display with
Arduino. The library allows us to create an object that represents the LCD display and contains
todas las operaciones “de bajo nivel” para que a nosotros nos resulte fácil la programación de este
device.

We configure the pins for the LCD:

Configuration instruction where: (2, 3, 4, 5) are the data buses of the LCD, pin 11 is the
Anabol and pin 12 is the register selection pin.

We use a float variable, which adds decimals.

We declare the variables to define the pins for the maximum and minimum temperature:

Then we create a Void Setup

What is the Void Setup? The setup is the first function to be executed within a program in
Arduino. It is essentially where the functions that the microcontroller will carry out are 'set.'

This is where we establish some criteria that require a unique execution. For example, if
our program will use serial communication, in the setup we establish the command [Link]
to indicate to the program that we are going to start the serial communication.
Then in the void setup we will make each necessary configuration of the output pins, the size of
the LCD on its startup and how messages will be displayed on the LCD.

We left some spaces for the corresponding temperature variables that will be printed and
we close the void setup.

Then we create a Void Loop:

What is the Void Loop? Loop in English means loop or cycle. The loop function in Arduino is the one that
it runs an infinite number of times. When the Arduino is turned on, the setup code is executed and
then you enter the loop, which repeats indefinitely until it is turned off or restarted
microcontroller.

Function of the Void Loop:

In the void loop, we are going to store the value read by the sensor, we will convert it to degrees.
degrees Celsius and degrees Fahrenheit, then we will configure the LCD to print the message of
last temperatures and then print the value in degrees C and F from the sensor, once finished
Let's continue with the conditions for the ranges of our Smartsensor. We are waiting to
continuation:
First, we will import the libraries for the LCD and the servos, then we will proceed to declare them all.
the variables and to name the pins.

We call the variable that stores the value obtained by the sensor and set it equal to
AnalogRead, which measures its results between 0 and 1023, so that we get a voltage between 0 and 5.
We are going to multiply the analogRead by 5/1024.

With this operation, what we do is convert the value returned by analogRead(0) that
it will be between 0 and 1023 at a value between 0.0 and 5.0 volts

With this formula we transform volts into degrees

We declare these float variables to store the sensor reading values, as well as the
conversions to be made to convert voltage to degrees Celsius, and with the degrees Celsius
we convert it to degrees Fahrenheit

Then we will make each necessary configuration of the output pins, the size of the LCD so that
show the messages in their respective positions.
Finally, we created a loop with an If statement, when the read value is greater than or equal to 40 degrees.
Celsius then the red LED will light up and if the value read is less than or equal to 15 degrees
At centigrade the blue LED will light up. If none is met, the LEDs will remain off.
what it means to be at room temperature.

The if loop performs an action if a particular condition is met.

At the end we upload the program to the Arduino and we will see how our sensor works.
temperature.

You might also like