Open Source, Real-Time Temperature Monitoring & Control Using Scilab & Arduino
Open Source, Real-Time Temperature Monitoring & Control Using Scilab & Arduino
Open Source, Real-Time Temperature Monitoring & Control Using Scilab & Arduino
A PROJECT REPORT
Submitted by
At
Place:
Date:
2
CERTIFICATE
(External)
3
ACKNOWLEDGEMENT
4
ABSTRACT
5
Table of Contents
Title
Page………………………….……………1
Declaration……………………….…….….2
Certificate……………...................................3
Acknowledgement....……………………...4
Abstract…………………………………....6
1. INTRODUCTION ----------------------------------------------------------------------------------------------------8
i. BLOCK DIAGRAM ---------------------------------------------------------------------------------9
ii. SOFTWARE ENVIRONMENT -----------------------------------------------------------------10
i. ARDUINO --------------------------------------------------------------------------------------------12
ii. SCILAB ARDUINO TOOLBOX ----------------------------------------------------------------14
4. HARDWARE ---------------------------------------------------------------------------------------------------------23
i. LM35-----------------------------------------------------------------------------------------------------------24
iii. POTENTIOMETER----------------------------------------------------------------------------------------31
5. WORKING -----------------------------------------------------------------------------------------------------------32
APPENDIX
i. FUTURE SCOPE-------------------------------------------------------------------------38
ii. REFERENCE------------------------------------------------------------------------------39
6
List of Figures
Fig 1.1: Proposed block diagram --------------------------------------------------------------------------9
Fig 1.2: Arduino UNO board-------------------------------------------------------------------------------12
Fig 1.3: GUI sample---------------------------------------------------------------------------------------------16
Fig 1.4: Radio buttons in MATLAB--------------------------------------------------------------------18
Fig 1.5: Check box in scilab--------------------------------------------------------------------------------19
Fig 1.6: Front-End for monitoring & control purpose-----------------------------------------21
Fig 1.7: LM35------------------------------------------------------------------------------------------------------24
Fig 1.8: LCD display---------------------------------------------------------------------27
Fig 1.9: LCD module interface---------------------------------------------------------30
Fig 2.0: potentiometer-------------------------------------------------------------------31
Fig 2.1: GUI front-end-----------------------------------------------------------------------------------------32
Fig 2.2: Graph on monitor ----------------------------------------------------------------------------------33
Fig 2.3: Pin connection for LCD with arduino----------------------------------------------------34
Fig 2.4: Message displayed on LCD---------------------------------------------------35
LIST OF TABLES
Table 2.1: Arduino Uno hardware specifications------------------------------------13
Table 2.2: Pin description of LM35----------------------------------------------------25
7
CHAPTER – 1
INTRODUCTION
8
i- BLOCK DIAGRAM
9
ii- Software Environment
Scilab:
10
As the syntax of scilab is similar to MATLAB, scilab includes a
source code translator for assisting the conversion of code from MATLAB to
scilab. Scilab is available free of cost under an open source license. Due to
the open source nature of the software, some user contributions have been
integrated into the main program.
11
iii-ARDUINO
12
ARDUINO UNO SPECIFICATIONS:
parameter value
Microcontroller 2
Operating voltage 5V
Input voltage(recommended) 7-12V
Digital I/O pins 14(of which 6 provide PWM o/p)
Analog I/O pins 6
DC current per I/O pin 40mA
DC current for 3.3V pin 50mA
Flash memory 32 KB (ATmega328)
SRAM 2KB (ATmega328)
EEPROM 1KB (ATmega328)
Clock speed 16 Mhz
Length 68.6mm
Width 53.4mm
Weight 25g
13
iv- SCILAB ARDUINO TOOLBOX
14
15
CHAPTER-2
17
i. SCILAB AS A SUBSTITUTE OF MATLAB
In MATLAB, the user can click the run button, or a slider control
multiple times. This calls multiple instances of the function, with bizarre
results. In a couple cases enough functions are called to crash MATLAB.
Also, if user presses any one button or selects any option, then user is
restricted to that option only. User cannot press other radio button
simultaneously.
MATLAB is paid software which would make our project pretty much
expensive.
18
On the other hand if we use scilab, then there will not be any issues
regarding radio buttons. Because in scilab there exists CHECK BOX instead
of radio buttons. If user wants to select more than one option then he is free
for that.
19
ii. ARDUINO & SCILAB FIRMWARE
ARDUINO FIRMWARE:
SCILAB FIRMWARE:
Scilab firmware is for user test purpose. User can confirm by using
this firmware that the program has been successfully executed and it is
ready for further use. Basically, scilab and arduino firmwares are used as
language converter which are very much essential while serial
communication of arduino and scilab and also while interfacing these
functionalities with hardware. This is used only for checking whether the
connection between arduino and scilab is established or not
mode(0)
h=open_serial(1,2,115200);
for i=1:3
write_serial(1,"v",1);
read_serial(1,3)
endclose_serial(1)
20
CHAPTER-3
22
CHAPTER –4
HARDWARE
This part explains about the hardware design and construction involves
in this system.
Arduino ARK
Potentiometer (10k)
Jumper wires
23
LM35
24
PIN DISCRIPTION:
Pin Function Name
No
FEATURES:
Calibrated directly in ˚ Celsius (Centigrade)
Linear + 10.0 mV/˚C scale factor n 0.5˚C accuracy (at +25˚C)
Rated for full −55˚ to +150˚C range
Suitable for remote applications
Low cost due to wafer-level trimming
Operates from 4 to 30 volts n Less than 60 µA current drain
Low self-heating, 0.08˚C in still air
Nonlinearity only ±1⁄4˚C typical
Low impedance output, 0.1 Ω for 1 mA load
APPLICATIONS:
The LM35 can be applied easily in the same way as other integrated-
circuit temperature sensors. It can be glued or cemented to a surface and its
temperature will be within about 0.01˚C of the surface temperature. This
presumes that the ambient air temperature is almost the same as the surface
25
temperature; if the air temperature were much higher or lower than the
surface temperature, the actual temperature of the LM35 die would be at an
intermediate temperature between the surface temperature and the air
temperature. This is especially true for the TO-92 plastic package, where the
copper leads are the principal thermal path to carry heat into the device, so
its temperature might be closer to the air temperature than to the surface
temperature. To minimize this problem, be sure that the wiring to the LM35,
as it leaves the device, is held at the same temperature as the surface of
interest. The easiest way to do this is to cover up these wires with a bead of
epoxy which will insure that the leads and wires are all at the same
temperature as the surface, and that the LM35 die’s temperature will not be
affected by the air temperature.
The TO-46 metal package can also be soldered to a metal surface or
pipe without damage. Of course, in that case the V− terminal of the circuit
will be grounded to that metal. Alternatively, the LM35 can be mounted
inside a sealed-end metal tube, and can then be dipped into a bath or screwed
into a threaded hole in a tank. As with any IC, the LM35 and accompanying
wiring and circuits must be kept insulated and dry, to avoid leakage and
corrosion. This is especially true if the circuit may operate at cold
temperatures where condensation can occur. Printed-circuit coatings and
varnishes such as Humiseal and epoxy paints or dips are often used to insure
that moisture cannot corrode the LM35 or its connections. These devices are
sometimes soldered to a small light-weight heat fin, to decrease the thermal
time constant and speed up the response in slowly-moving air. On the other
hand, a small thermal mass may be added to the sensor, to give the steadiest
reading despite small deviations in the air temperature.
26
LCD (LIQUID CRYSTAL DISPLAY)
Part to be Required:
1. LCD
2. Arduino board
3. Potentiometer
4. Jumper wires
What is LCD?
LCD (liquid crystal display) is the technology used for displays
in notebook and other smaller computers. Like light-emitting diode
(LED) and gas-plasma technologies, LCDs allow displays to be much
thinner than cathode ray tube (CRT) technology. LCDs consume much
27
less power than LED and gas-display displays because they work on
the principle of blocking light rather than emitting it.
Pin4 (RS): Register select pin. The JHD162A has two registers
namely command register and data register. Logic HIGH at RS pin
selects data register and logic LOW at RS pin will select command
28
register. If we make the RS pin HIGH and put a data on the data lines
(DB0 to DB7) it will be recognized as a data. If we make the RS pin
LOW and put a data on the data lines, then it will be taken as a
command.
Pin6 (E): This pin is meant for enabling the LCD module. A HIGH
to LOW signal at this pin will enable the module.
Pin7 (DB0) to Pin14 (DB7): These are data pins. The commands
and data are put on these pins.
Pin15 (LED+): Anode of the back light LED. When operated on 5V,
a 560 ohm resistor should be connected in series to this pin. In arduino
based projects the back light LED can be powered from the 3.3V
source on the arduino board.
29
Steps to be followed:
30
Potentiometer (10k):
WORKING
LM35 is connected to arduino uno. Fan and motor drivers are also
connected to arduino uno. Arduino uno will serially communicate with GUI,
which is programmed in scilab. First arduino is connected to second arduino
ARK. LCD screen is connected via Arduino ARK. Also the program for graph
is done in arduino ARK itself. As the temperature will increase and reach to
its threshold value, the fan will automatically switched on. We can see the
current temperature value in front-end.
33
LCD is connected via arduino 2. The temperature value will be displayed on
the LCD screen. The pin connection for LCD with arduino is:
Pin 1 to GND
Pin 2 to 5V
Pin 3 to wiper
Pin 4 to Arduino pin 12
Pin 5 to GND
Pin 6 to Arduino pin 11
Pin 11 to Arduino pin 5
Pin 12 to pin 4
Pin 13 to pin 3
Pin 14 to pin 2
35
CHAPTER – 6
APPLICATION
36
CONCLUSION
Thus when the temperature crosses the set temperature value, the fan
will be automatically switch on. The scilab and arduino software will be
used in monitoring & controlling the temperature. We can have the
current value of temperature. We can change threshold value any time we
wish or whenever require. We can analyze variation in temperature via
graph which will be obtained in new pop-up window. If the temperature
will cross its threshold, it will be displayed on the LCD screen connected
via arduino ARK. It is the simple and efficient in maintaining the
temperature irrespective of the outside temperature. It is the low cost
solution for monitoring and controlling temperature as scilab and arduino
both are open source platform and hardware part is not so complex as
well.
37
APPENDIX
i- FUTURE SCOPE
Humidity
Moisture content
Connecting Bluetooth
Connecting GSM
38
ii- REFERENCES
39