Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Arduino Et AM35

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

Ministère de L’Enseignement Supérieur et de la Recherche

Scientifique

Université Mohamed KHIDER de Biskra Faculté


Des Sciences et de la Technologie :

TP01: Resume of
ARDUINO &
Sensor(LM35)

STUDENT: CHENAFI
MUHAMMED SIEF EL ISLAM
PROFESSEUR: R.SAADI
3 ème année Licence Electromécanique
2023/2022
Contents

INTRODUCTION :..................................................................................1
ARDUINO UNO :....................................................................................
SENSORS LM35:................................................................................9

Interfacing LM35 Temperature Sensor with Arduino :....................13


Working Principle:..........................................................................14
Testing the LM35 Sensor:...................................................................
Connecting the LM35 Temperature Sensor to an Arduino:..........18
The Arduino Programming
Arduino sketch basics……………………………………

CONCLUSION:....................................................................................19

RESSOURCES:.........................................................................................

2
INTRODUCTION :
:

Arduino Is an open -source electronics platform based on easy-to-


_use hardware and software. It’s intended for anyone making
interactive projects.

2
ARDUINO UNO
is a : microcontroller board based on the
ATmega328P,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.

Bord components:

2
1. Microcontroller - this is the brain of an Arduino and is the
component that we load programs into. Think of it as a tiny
computer, designed to execute only a specific number of
things.

2. USB port - used to connect your Arduino board to a


computer.

3. USB to Serial chip - the USB to Serial is an important


component, as it helps translating data that comes from e.g.,
a computer to the on-board microcontroller. This is what
makes it possible to program the Arduino board from your
computer.

4. Digital pins - pins that use digital logic (0,1 or LOW/HIGH).


Commonly used for switches and to turn on/off an LED.

5. Analog pins - pins that can read analog values in a 10 bit


resolution (0-1023).

2
6. 5V / 3.3V pins- these pins are used to power external
components.

7. GND - also known as ground, negative or simply -, is used to


complete a circuit, where the electrical level is at 0 volt.

8. VIN - stands for Voltage In, where you can connect external
power supplies.

the LM35 Temperature Sensor

LM35 Temperature Sensor is a high precision temperature sensor. It has


a analog output, which is linearly proportional to the surrounding
temperature.

2
Interfacing LM35 Temperature Sensor with
Arduino:

One of the easiest and inexpensive ways to add temperature sensing


in your Arduino project is to use LM35 Temperature Sensor. These
sensors are precise and needs no external components to work. So,
with just a few connections and some Arduino code you’ll be sensing
temperature in no time!
The LM35 is a low voltage, precision centigrade temperature sensor
manufactured by Texas Instruments. It is a chip that provides a voltage

2
output that is linearly proportional to the temperature in °C and is,
therefore, very easy to use with an Arduino.
The LM35 temperature sensor is fairly precise, never wears out, works
under many environmental conditions and requires no external
components to work. In addition, the LM35 sensor does not require
calibration and provides a typical accuracy of ±0.5°C at room
temperature and ±1°C over a full −55°C to +155°C temperature range.
- The sensor can be powered with a 4V to 30V power supply and
consumes less than 60µA during active temperature
conversions, providing very low self-heating (less than 0.08°C
in still air).
Here are the complete specifications:
Power supply 4V to 30V
Current draw 60µA
Temperature range −55°C to +155°C
Accuracy ±0.5°C
Output scale factor 10mV/°C
Output at 25°C 250mV

The only disadvantage of the LM35 sensor is that it requires a negative


bias voltage to measure negative temperature. So, if you are planning to
use the sensor to measure negative temperature, it is recommended
that you use TMP36 temperature sensor. The TMP36 by Analog Devices
is fairly accurate (-40°C to 125°C) and has the advantage of being able to
measure negative temperatures without the need for negative bias
voltage.
Working Principle:

2
The LM35 uses a solid-state technique to measure the temperature. It
makes use of the fact that the voltage drop between the base and
emitter (forward voltage – Vbe) of the Diode-connected transistor
decreases at a known rate as the temperature increases. By precisely
amplifying this voltage change, it is easy to generate an analog signal
that is directly proportional to temperature.
How to Measure Temperature:
The LM35 is easy to use; just connect the left pin to power (4V to 30V)
and the right pin to ground (assuming the flat side of the sensor is facing
you). Then the middle pin will have an analog voltage that is directly
proportional (linear) to the temperature in °C. This can be easily seen in
the output voltage vs temperature characteristic. Note that the analog
output voltage is independent of the power supply.
Testing the LM35 Sensor:
Testing the LM35 is pretty easy, just connect the left pin to 4V to 30V power
supply (Four AA batteries work great) and the right pin to ground (assuming the
flat side of the sensor is facing you). Now connect your multimeter in DC voltage
mode to ground and the middle pin. At the room temperature (25°C), the voltage
should be about 0.25V.
Try squeezing the plastic case of the sensor gently to see a rise in temperature.
try squeezing lm35 to see rise in temperature.

2
LM35 Sensor Pinout
The LM35 comes in three different form factors, but the most common type is the
3-pin TO-92 package, which looks just like a transistor. Let’s take a look at its
pinout.

lm35 temperature sensor pinout


+Vs is the power supply for the sensor which can be anywhere between 4V to
30V.

Vout pin produces an analog voltage that is directly proportional (linear) to the
temperature. It should be connected to an Analog (ADC) input.

GND is a ground pin.

2
Connecting the LM35 Temperature Sensor to an Arduino:
Hooking up the LM35 to an Arduino is super simple. You only need to connect
three pins: two for power and one for reading the sensor value.

The sensor can be powered from 5V. The positive voltage connects to ‘+Vs’ and
ground connects to ‘GND‘. The middle pin ‘Vout’ is the analog signal output from
the sensor and connects to the A0 analog input of an Arduino.

Below is the hookup for the experiments with the LM35:

To measure air temperature leave the sensor in the open air or attach it to an
object you want to measure the temperature of, such as a heat sink.
-The following diagram shows you how to wire everything :

2
There is no capacit but it is there this figue incorrect.

ARDUINO PROGRAMMING

1-Language is:
C++, It was chosen because it is the language closest to the machine, in
addition to providing the machine with the most important features of
programming languages such as object-oriented programming. functional
programming, in addition to the ease of learning and many other
features.
Arduino programming language can be divided in three main parts:
functions, values (variables and constants), and structure
2- Arduino sketch basics (The structure of an Arduino sketch):

Header scoop:
for declaring a variables, functions, including libraries ..
etc.
2
Setup scoop: for setting up the Arduino board to determine
the inputs and outputs, in addition to how to deal with them
or to running and initializing software libraries, in addition
to how to communicate with the computer.
Loop scoop: To deal with sensors and electronic circuits
and implement commands on them.
There are two special functions that are a part of every Arduino
sketch: setup() and loop().

The setup() is called once, when the sketch starts. It's a good place
to do setup tasks like setting pin modes or initializing libraries.

The loop() function is called over and over and is heart of most
sketches.

You need to include both functions in your sketch, even if you don't
need them for anything.

2
3-Content of arduino sketch:

2
Arduino IDE: is an open-source software, designed by Arduino.cc
and mainly used for writing, compiling & uploading code to almost
all Arduino Modules.

2
FUNCTIONS:

2
Variabels

Structure

2
CONCLUSION:

The advantage of Arduino is its compatibility with dozens of sensors


and electrical circuits, which makes the process of building an
Arduino project very simple. It does not require making your own
circuits and sensors. You only have to purchase ready-made
components dedicated to compatibility and work with most
Arduino boards.

2
RESSOURCES:
- Debug Club- DBC Arduino.pptx of monsafe kaha
- https://docs.arduino.cc/learn/starting-guide/getting-started-
arduino
- https://www.arduiplanet.ma/comparatif-des-differentes-
cartes-arduino/
- https://store.arduino.cc/products/arduino-mega-2560-rev3

- https://rootsaid.com/arduino-temperature-sensor/
- https://lastminuteengineers.com/lm35-temperature-sensor-
arduino-tutorial/

You might also like