Vous êtes sur la page 1sur 13

Temperature and light sensor

01. INTRODUCTION
Temperature sensors are vital to a variety of everyday products. For example,
household ovens, refrigerators, and thermostats all rely on temperature maintenance
and control in order to function properly. Temperature control also has applications in
chemical engineering. Examples of this include maintaining the temperature of a
chemical reactor at the ideal set-point, monitoring the temperature of a possible
runaway reaction to ensure the safety of employees, and maintaining the temperature
of streams released to the environment to minimize harmful environmental impact.

While temperature is generally sensed by humans as “hot”, “neutral”, or “cold”,


chemical engineering requires precise, quantitative measurements of temperature in
order to accurately control a process. This is achieved through the use of temperature
sensors, and temperature regulators which process the signals they receive from
sensors.

From a thermodynamics perspective, temperature changes as a function of the average


energy of molecular movement. As heat is added to a system, molecular motion
increases and the system experiences an increase in temperature. It is difficult, however,
to directly measure the energy of molecular movement, so temperature sensors are
generally designed to measure a property which changes in response to temperature.
The devices are then calibrated to traditional temperature scales using a standard (i.e.
the boiling point of water at known pressure). The following sections discuss the
various types of sensors and regulators.

A Light Detector or a Light Sensor is a device or circuit that detects the intensity of the
light incident on it. Different types of light detectors are LDRs (or Light Dependent
Resistors), Photo Diodes, Photo Transistors, etc.

All these devices are called as Photoelectric Devices as they convert light energy to
electric energy. These Light Detectors or Sensors can detect different types of light like
visible light, ultraviolet light, infrared light etc.

In this project, we have designed a simple Light Detector using LDR. When the light
falls on the LDR, the light stays off and when the light stops falling on LDR, the LED
glows.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


1
Temperature and light sensor

02. COMPONENTS REQUIRED

 PIC18F4550
 16*2 LCD
 5V POWER SUPPLY
 TEMPERATURE SENSOR(LM35)
 CONNECTING WIRES
 LDR(Light Dependent Resistor)

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


2
Temperature and light sensor

03. INFORMATION ABOUT COMPONENTS

3.1 PIC18F4550

• Alternate Run Modes:


By clocking the controller from the Timer1 source or the internal oscillator block, power
consumption during code execution
can be reduced by as much as 90%.
• Multiple Idle Modes:
The controller can also run with its CPU core disabled but the peripherals still active. In
these states, power consumption can be reduced even further, to as little as 4%, of normal
operation requirements.
• On-the-Fly Mode Switching:
The power-managed modes are invoked by user code
during operation, allowing the user to incorporate power-saving ideas into their
application’s software design.
• Low Consumption in Key Modules:
The power requirements for both Timer1 and the Watchdog Timer are minimized.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


3
Temperature and light sensor

3.2 16*2 LCD

A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated


optical device that uses the light-modulating properties of liquid crystals. Liquid
crystals do not emit light directly, instead using a backlight or reflector to produce
images in color or monochrome.[1] LCDs are available to display arbitrary images (as
in a general-purpose computer display) or fixed images with low information content,
which can be displayed or hidden, such as preset words, digits, and seven-segment
displays, as in a digital clock.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


4
Temperature and light sensor

3.3 LM35

LM35 series are precision integrated-circuit temperature plastic TO-92 transistor


package. The LM35D is also avail sensors, whose output voltage is linearly
proportional to the able in an 8-lead surface mount small outline package and a Celsius
(Centigrade) temperature. The LM35 thus has an plastic TO-220 package. advantage
over linear temperature sensors calibrated in ˚ Kelvin, as the user is not required to
subtract a large constant voltage.

The LM35 does not require any external n Calibrated directly in ˚ Celsius (Centigrade)
calibration or trimming to provide typical accuracies of ±1⁄4˚C n Linear + 10.0 mV/˚C
scale factor at room temperature and ±3⁄4˚C over a full −55 to +150˚C n 0.5˚C accuracy
guaranteeable (at +25˚C) temperature range.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


5
Temperature and light sensor

Typical Applications

FIGURE 1. Basic Centigrade Temperature Sensor

(+2˚C to +150˚C)

FIGURE 2. Full-Range Centigrade Temperature Sensor

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


6
Temperature and light sensor

3.4 LDR

Light Dependent Resistor - LDR

Two cadmium sulphide(cds) photoconductive cells with spectral responses similar to


that of the human eye. The cell resistance falls with increasing light intensity.
Applications include smoke detection, automatic lighting control, batch counting and
burglar alarm systems.

Applications

Photoconductive cells are used in many different types of circuits and applications.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


7
Temperature and light sensor

04. CIRCUIT DIAGRAM

The following image shows the circuit diagram of the using


PIC18f4550.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


8
Temperature and light sensor

05. CONSTRUCTION
You will need a PIC18F4520 chip running at 20MHz attached with a standard 16×2
LCD Module and LM35 on AN0 pin. LM35 is a 3 pin device as show above.

connect the +Vs Pin to 5v and GND to GND. The output must be connected to the
analog input pin 0 of the PIC18F4550 MCU.

The extra part required for this project like LCD and the LM35 temperature sensor are
installed in the expansion board.

Turn on the power supply, the screen should show the current temperature readings.
Bring a Hot soldering iron tip near the LM35’s pins, don’t touch it keep it 1 or 2mm
away.

The screen should update with the rising temperature. Now finally touch the pins of
LM35 with the tip of iron, the temperature should rise quickly. Keep it there until
temperature rise to 80 degrees, then remove the iron.

You can now blow some air by your mouth on the sensor to cool it down

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


9
Temperature and light sensor

06. GENERAL NOTES.


 For proper working use the components of exact values as shown above.
 Wherever possible use new components.
 Solder everything in a clean way. Major problems arises due to improper soldering
,solder jumps and loose joints.
 Use the exact value crystal shown in schematic.
 Only burning the HEX file to the MCU is NOT enough. PIC18 devices are fairly
complex MCU and can be configured in various ways. Chip is configured using
the CONFIG Bytes. Although all hex file given in our site comes with embedded
CONFIG bytes. But the user must ensure they are programmed to the chip.
 Any good programmer has the capability to read the configuration information
from the hex file and transfer it to the MCU. Programs will not run without proper
configuration byte programming. One major job of configuration is to setup proper
oscillator and PLL modes without which the MCU won’t execute a single
instruction.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


10
Temperature and light sensor

07. CODE
#include <stdio.h>
#include <string.h>
#include <p18f4550.h>
#include "Configuration_Header_File.h" /* Header File for Configuration bits
*/
#include "LCD_16x2_8-bit_Header_File.h" /* Header File for LCD
Functions */
#include "PIC18F4550_ADC_Header_File.h"

void main()
{
char Temperature[10];
float celsius;
int i;
OSCCON=0x72; /* set internal Oscillator frequency to 8 MHz*/
LCD_Init(); /* initialize 16x2 LCD*/
ADC_Init(); /* initialize 10-bit ADC*/

while(1)
{
LCD_String_xy(0,0,"Temperature");
/* convert digital value to temperature */
celsius = (ADC_Read(0)*4.88);
celsius = (celsius/10.00);
/*convert integer value to ASCII string */
sprintf(Temperature,"%d%cC ",(int)celsius,0xdf);
LCD_String_xy(1,0,Temperature); /* send string data for
printing */
MSdelay(1000);
memset(Temperature,0,10

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


11
Temperature and light sensor

08. FEATURES

• Very simple circuit.

• Uses very small amount of electricity.

• Ultimately helps in better temperature control .

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


12
Temperature and light sensor

09. CONCLUSION

A simple but useful project called temperature and light sensor using Arduino is
designed and developed here. Using this project, the proper control over temperature
can be obtained and controlled.

MECHANICAL DEPARTMENT, SINHGAD ACADEMY OF ENGINEERING


13

Vous aimerez peut-être aussi