Sei sulla pagina 1di 48

SCHOOL OF ELECTRICAL

AND ELECTRONIC ENGINEERING

NAME: Amir Dillawar


STUDENT ID: 200930623
COURSE: ELEC5451M
ASSESMENT: Embedded Project Report

DATE: 13th December 2015

Table of Contents
Introduction ............................................................................................................................................ 1
Microcontrollers ................................................................................................................................. 1
The Temperature Logger Project ........................................................................................................ 3
Hardware Description ............................................................................................................................. 4
The mbed NXP LPC1768 ...................................................................................................................... 5
The TMP102 Temperature Sensor IC .................................................................................................. 7
The Nokia 5110 LCD ............................................................................................................................ 8
The Switches and Push Buttons ........................................................................................................ 11
Software Description ............................................................................................................................ 12
The User Interface............................................................................................................................. 12
Software Structure ............................................................................................................................ 14
Results and Testing ................................................................................................................................. 5
Conclusion ............................................................................................................................................. 13
References ............................................................................................................................................ 14
Appendix 1 ............................................................................................................................................ 15
Appendix 2 ............................................................................................................................................ 24

List of Figures
Figure 1 - The basic structure of an embedded system .......................................................................... 1
Figure 2 - The structure of a basic microcomputer (Source: [2] ) ........................................................... 2
Figure 3 - The structure of a basic microprocessor (Source: [3] ) ........................................................... 2
Figure 4 - The structure of a basic microcontroller (Source: [2] ) ........................................................... 3
Figure 5 - Completely assembled Temperature Logger Project ............................................................. 4
Figure 6 - The circuit diagram for the Temperature Logger Project ....................................................... 4
Figure 7 - Block diagram of the Temperature Logger Project ................................................................. 5
Figure 8 - The mbed NXP LPC1768 microcontroller ................................................................................ 5
Figure 9 - Block diagram of the mbed NXP LPX1768 microcontroller (Source: [5] )............................... 6
Figure 10 - The TMP102 temperature sensor IC ..................................................................................... 7
Figure 11 - Block diagram of the TMP102 IC (Source: [6]) ...................................................................... 7
Figure 12 - Nokia 5110 LCD ..................................................................................................................... 8
Figure 13 - The pinout of the Nokia 5110 LCD Assembly (Source: [7]) ................................................... 9
Figure 14 - Block diagram of the PCD8544 LCD driver (Source: [8] ) ...................................................... 9
Figure 15 - Mapping of the DDRAM to the LCD for the PCD8544 LCD Driver ...................................... 10
Figure 16 - Buttons and switches used in the project........................................................................... 11
Figure 17 - The Welcome Screen .......................................................................................................... 12
Figure 18 - Default Screens 1 and 2 ...................................................................................................... 12
Figure 19 - Menu Screens 1 to 4 ........................................................................................................... 13
Figure 20 - The Adjust Brightness Screen ............................................................................................. 13
Figure 21 - The Adjust Sample Time Screen.......................................................................................... 13

Figure 22 - The Erase File Screen and its sub-screens .......................................................................... 13


Figure 23 - The Temperature Plot Screen ............................................................................................. 13
Figure 24 - Part 1 of the Main Function Flowchart ................................................................................. 1
Figure 25 - Part 2 of the Main Function Flowchart ................................................................................. 1
Figure 26 - The Get Temperature Function flowchart ............................................................................ 1
Figure 27 - The Write to File Function flowchart .................................................................................... 1
Figure 28 - The LCD Update Function flowchart ..................................................................................... 1
Figure 29 - The Get Time Function flowchart ......................................................................................... 2
Figure 30 - The Display Error Function flowchart ................................................................................... 2
Figure 31 - The Write to Configuration File Function flowchart ............................................................. 3
Figure 32 - The LCD Display Function flowchart ..................................................................................... 4
Figure 33 - The Welcome Screen displayed on the LCD ......................................................................... 5
Figure 34 - Default Screen 1 displayed on the LCD ................................................................................. 5
Figure 35 - Default Screen 2 displayed on the LCD ................................................................................. 6
Figure 36 Menu Screen 1 displayed on the LCD ..................................................................................... 6
Figure 37 - Menu Screen 3 displayed on the LCD ................................................................................... 7
Figure 38 - The Adjust Brightness Screen displayed on the LCD............................................................. 7
Figure 39 - The Adjust Sample Time Screen displayed on the LCD ......................................................... 8
Figure 40 - The Delete File Screen displayed on the LCD........................................................................ 8
Figure 41 - Message Screen 1 displayed on the LCD............................................................................... 9
Figure 42 - Message Screen 2 displayed on the LCD............................................................................... 9
Figure 43 - Error Screen 1 displayed on the LCD................................................................................... 10
Figure 44 - The graph of the temperature displayed on the LCD ......................................................... 10
Figure 45 - A graph of the results obtained with a sample time of 60s ................................................ 11
Figure 46 - A graph of the results with sample time of 10s .................................................................. 12

List of Tables
Table 1 - List of peripherals of the mbed NXP LPC1768 microcontroller (Source: [5] ) .......................... 6
Table 2 - Connections of the PCD8544 LCD Driver (Source: [8] ) .......................................................... 10
Table 3 - Results of the Temperature Logger with sample time of 60s ................................................ 24
Table 4 - Results of the temperature logger with sample time of 10s ................................................. 28

Introduction
An embedded system is a computer system that is designed to perform only a specific task
using real-time parameters [1]. The system usually consists of a digital processing device or devices,
and mechanical and/or electrical input and output devices. The concept can be seen in Fig.1 below:

Figure 1 - The basic structure of an embedded system

An example of a typical, simple, embedded system is a programmable washing machine. The main
distinction between an embedded system and a general purpose computer system is the number of
tasks they are designed to perform. A general purpose computer system can perform several tasks,
for example a personal computer can browse the internet, do word processing, and play games;
however the embedded system is designed to perform only a single task a programmable washing
machine does not need to stream online videos! The brain of the embedded system is its digital
processing device. This device performs the processing/control operations for the system.
Depending on the application of the embedded system, this device can be a general purpose
microcontroller or a digital signal processor. Specifically, the digital signal processor is used for
embedded systems that deal with the processing of digital signals such as mixing of audio or video
signals, data encryption and decryption, data compression and decompression, and sound synthesis.
General purpose microcontrollers, on the other hand, are used for embedded systems that are not
based on the processing of digital signals, such as the one designed in this project.

Microcontrollers
To understand what a microcontroller is, we must first understand what a microcomputer is.
A microcomputer is essentially a computing device that has a central processing unit (CPU), memory,
input, output and peripheral devices each connected to each other by a series of data lines called
buses [2] as shown in the figure below:

Figure 2 - The structure of a basic microcomputer (Source: [2] )

An example of such a system is the typical personal computer (PC) which has the following
components:

CPU microprocessor
Memory Random Access Memory (RAM), Read-Only Memory (ROM), Hard-Drives
Input/Output/Peripherals Keyboard, Mouse, Webcam, Display, USB ports and devices, etc.

The CPU of a microcomputer system is usually a microprocessor. The basic microprocessor consists
of an Arithmetic and Logic Unit (ALU), a Control Unit, and Registers. The function of the
microprocessor is to execute the commands that are stored in the memory of the microcomputer,
the order in which these commands are executed is dictated by the CU and any calculations, logical
or arithmetic, is done by the ALU. The registers are used to store data or instructions for faster
retrieval than that offered by the memory. The basic structure of a microprocessor is shown in Fig.3.

Figure 3 - The structure of a basic microprocessor (Source: [3] )

A microcontroller is essentially a single integrated circuit that incorporates all the features of a
microcomputer in a low cost, low power, small scale chip. Even though the basic structure of the
microcontroller is similar to that of the microcomputer, the former is not designed to replicate the
range of functionality of the latter the microcontroller is designed to be configured to execute the
single task of an embedded system. The structure of a basic microcontroller can be seen in Fig.4.
2

Figure 4 - The structure of a basic microcontroller (Source: [2] )

As can be see, the microcontroller has a CPU that executes its programmes and perform its logical
and arithmetic operations. There are usually several registers in the CPU some for general use and
some that have specific uses called special purpose registers, for example [1]:

The status register used to store information on the different characteristics of operations
carried out by the ALU.
The programme counter contains the address of the next instruction to be executed by
the CPU
The instruction register stores the instruction that is currently being executed by the CPU

The CPU uses an oscillator, normal a quartz crystal, to generate a clock signal that is used to keep the
internal operations of the CPU in sync. The memory of a microcontroller usually consists of RAM,
ROM and in most recent cases FLASH memory. The input and output peripherals attached to a
microcontroller are usually Timers, Interrupt controllers, Parallel I/O, Serial I/O and Analogue I/O.
The watchdog is a counter that continuously increments (or decrements) unless it is reset by a
programme or rolls over on its own. When a programme runs it should complete before the
watchdog rolls over, if it does it resets the watchdog when it is done, however, if it doesnt it then it
means the program has hanged and when the watchdog rolls over the microcontroller is reset and
the programme is restarted. Thus, the watchdog ensures that the programme is executed correctly
by restarting the microcontroller if the programme does not execute correctly much like a user
rebooting a PC when it freezes [4].

The Temperature Logger Project


This project uses the mbed NXP LPC1768 microcontroller development board and the Texas
Instruments TMP102 temperature sensor to create an embedded system that can:
1.
2.
3.
4.
5.
6.

Measure and display the current temperature, and the date and time
Upon instruction from user, store the measured temperature, date and time to a .csv file
Upon instruction from user, display the temperature measured as a graph
Allow the user to adjust the time between temperature reads
Allow the user to delete the log file stored in the FLASH memory of the microcontroller
Provide an easy to use menu interface that allows user input.

A system such as this can be used for a wide array of applications such as thermostats, industrial
temperature loggers, cold storage temperature monitors, and other applications that use the
monitoring and logging of temperature.

Hardware Description
The Temperature Logger Project was built on a PCB. The finally assembly is shown below:

Figure 5 - Completely assembled Temperature Logger Project

The circuit configuration for the Temperature Logger Project can be seen in Fig. 6 below:

Figure 6 - The circuit diagram for the Temperature Logger Project

As can be seen, the project uses the mbed NXP LPC1768 microcontroller development board, the
Nokia 5110 liquid crystal display (LCD), the Texas Instruments TMP102 temperature sensor
integrated circuit (IC), two switches and two buttons. A block diagram of the project is given in Fig.
7.

Figure 7 - Block diagram of the Temperature Logger Project

The mbed NXP LPC1768


The project uses the mbed NXP LPC1768 microcontroller board, which is shown in Fig.8.

Figure 8 - The mbed NXP LPC1768 microcontroller

The mbed NXP LPC1768 microcontroller development board uses a 100MHz ARM Cortex-M3
processor with 64kB of Static Random Access Memory (SRAM) and 512kB of Flash memory [5]. A list
of its peripherals are given in Table 1 [5]:

Serial Peripherals
10/100 Ethernet Media
Access Controller (MAC)
USB 2.0

Analogue Peripherals
12-bit Analogue to Digital Converter
(8 channels)
10-bit Digital to Analogue Converter

Four universal asynchronous


receivers/transmitters
(UARTs)
Two Controller Area Network
(CAN) 2.0B Controllers
Three Synchronous Serial
Port/Synchronous Peripheral
Interface (SSP/SPI)
Controllers
Three I2C bus interfaces
Inter-Interface Sound (I2S)
interface

Other Peripherals
Real Time Clock (RTC)
General Purpose Direct
Memory Access (DMA)
controller (8 channels)
26 GIPOs

Motor Control PWM and


Quadrature Encoder Interface
(Supports 3-phase motors)
Four 32-bit general-purpose
timer/counters

Table 1 - List of peripherals of the mbed NXP LPC1768 microcontroller (Source: [5] )

The block diagram of this microcontroller is shown below:

Figure 9 - Block diagram of the mbed NXP LPX1768 microcontroller (Source: [5] )

As can be seen the Microprocessor, Core, SRAM Controller, FLASH accelerator, Ethernet MAC, USB
and General Purpose DMA are all connected to ARMs multi-layer Advanced High Performance Bus
(AHB) matrix and the other peripherals are connected to an Advanced Peripheral Bus.
As can be seen in Fig.7, the Temperature Logger project uses the I2C peripheral for
communication with the TMP102 IC and the SPI peripheral for communication with the Nokia 5110
LCD. The Nokia 5110 LCD also uses the PWM peripheral to control the brightness level of the LCD
6

backlight and the GPIO peripherals for the VCC (power on the LCD), SCE, RST and D/C inputs. Also,
because the project requires data and time functionality, a backup battery is connected to the
microcontroller (pin 3) to ensure that the RTC does not lose power. The controller is powered by a
battery pack connected to pins 2 (VIN) and 1 (GND).

The TMP102 Temperature Sensor IC


The TMP102 temperature sensor IC used in the project is shown below:

Figure 10 - The TMP102 temperature sensor IC

Its block diagram is given by Figure 11.

Figure 11 - Block diagram of the TMP102 IC (Source: [6])

The TMP102 uses a diode temperature sensor to measure the temperature. The analogue output of
the temperature sensor is then converted to digital format by the on-board ADC and stored in the
temperature register of the IC. This value can be 12-bit or 13-bit depending on whether the IC is
configured in regular mode or extended mode respectively [6]. The IC is designed with maximum
absolute operating temperatures of -55C to 150C and a recommended operating range of -40C to
125C [6]. The TMP102 can be configured with fixed sample frequencies of 0.25Hz, 1Hz, 4Hz
(default) and 8Hz or it can be configured to take a temperature sample when instructed and then go
7

to a low power state called shutdown mode, this is called taking a one-shot reading [6]. These
instructions are provided by a master device using I2C communication via the serial interface of the
IC.
For the project, the TMP102 is connected to the mbed microcontroller to facilitate I2C
operation with the TMP102 being a slave and the microcontroller being the master. As such, the SCL
pin of the TMP102 is connected to a SCL pin of the microcontroller (pin 27) and the SDA pin of the
TMP102 is connected to the corresponding SDA pin of the microcontroller (pin 28). This I2C interface
is used to configure the TMP102 to measure the temperature when instructed by the mbed
microcontroller (one shot mode) to then return to its shut down state. This temperature sample is
stored in the register as a 12-bit value because the TMP102 is configured in normal operating mode
as well. The TMP102 is powered using the regulated 3.3v output of the microcontroller (pin 40) and
the same GND (pin 1).

The Nokia 5110 LCD


The Nokia 5110 LCD, shown in Fig. 12, is a 48x84 matrix LCD controlled by the Phillips
PCD8544 driver [7].

Figure 12 - Nokia 5110 LCD

The matrix LCD and the drive IC come in a single integrated package, as shown above, with pinout
shown in Fig.13 below.

Figure 13 - The pinout of the Nokia 5110 LCD Assembly (Source: [7])

The block diagram of the LCD driver is show in Fig. 14 below:

Figure 14 - Block diagram of the PCD8544 LCD driver (Source: [8] )

The following table explains the pin connections of the driver [8]:
Pin
R0 to R47
C0 to C83
VSS1, VSS2
VDD1, VDD2
VLCD1, VLCD2
T1 test 1 input
T2 test 2 output
T3 test 3 input/output

Connections
LCD row driver outputs, connected to LCD
LCD column driver outputs, connected to LCD
Ground, connected to GND pin of LCD Assembly (pin 2)
Supply voltage, connected to VCC pin of LCD Assembly (pin 1)
LCD supply voltage powers the LCD backlight, connected to VLED pin of
the LCD Assembly (pin 8)
Not connected

T4 test 4 input
SDIN
SCLK
D/C
SCE
OSC
RES

Serial data input, connected to MOSI pin of LCD Assembly (pin 6)


Serial clock input, connected to SCLK pin of LCD (pin 7)
Data/Command connected to D/C pin of LCD Assembly (pin 5)
Chip enable, connected to SCE pin of LCD Assembly (pin 4)
Oscillator, connected to VDD
External reset input , connected to RST pin of LCD Assembly (pin 3)
Table 2 - Connections of the PCD8544 LCD Driver (Source: [8] )

The LCD driver receives the data being sent though the SPI data link, and uses the D/C state to
determine if the data is a command or data to be displayed. If it is a command, the driver processes
the command, if it is data to be displayed then the data is stored in the buffer (DDRAM) and then
used to turn on or off the necessary dots on the display. The relationship between the data stored
in the buffer and the LCD is shown below:

Figure 15 - Mapping of the DDRAM to the LCD for the PCD8544 LCD Driver

The LCD Assembly is connected to one of the SPI peripherals of the microcontroller for the
project via its MOSI pin (pin 6) and its SCLK pin (pin 7). These are connected to pins 11 and 13 of the
microcontroller respectively. The LCD Assemblys VLED pin is connected to one of the PWM pins of
the microcontroller (pin 21), this is done to use the PWM output to control the brightness of the LED
backlights of the LCD using the duty cycle of the PWM. The GND pin is connected to the same GND
as the microcontroller. The other pins of the LCD assembly are connected to GPIO pins of the
microcontroller, VCC to pin 7, SCE to pin 8, RST to pin 9 and D/C to pin 10. This allows the LCD to be
turned on or off or be reset the microcontroller, and to tell the LCD assembly that serial
communication will take place (SCE) and whether the data sent is a command or data to be
displayed (D/C).

10

The Switches and Push Buttons


The Temperature Logger Project uses two switches and two buttons, as shown in Fig, 16.

Figure 16 - Buttons and switches used in the project

The power switch is placed between the battery supply and the Vin pin of the microcontroller to turn
the controller on or off. The second switch, labelled SW, is connected to pin 18 of the
microcontroller (GPIO) as an input. This switch toggles between the 3.3v regulated output of the
microcontroller (logical high) and ground (logical low). Buttons A and B are connected to pins 16 and
17 (GPIO) of the microcontroller respectively, also as inputs. These two pins are configured as pull
up pins, as such their normal state is high, and when the buttons are pressed they drive the pins to a
logical low.

11

Software Description
The User Interface
Using the Nokia 5110 LCD assembly, the software around a simple user interface that
consists of several screens that are displayed at the appropriate time. These screens are:
1.
2.
3.
4.
5.
6.

The Welcome Screen


Default Screen 1
Default Screen 2
The Temperature Plot Screen
Menu Screen 1,2,3 and 4
The Sub-menu Screens:
a. The Adjust Brightness Screen
b. The Adjust Sample Time Screen
c. The Erase File Screen and its sub-screens:
i. Error Screen 1
ii. Message Screen 1
iii. Message Screen 2

The welcome screen, shown in Fig.17, is loaded when the Temperature Logger is first turned on.

Figure 17 - The Welcome Screen

The Default Screen 1 displays the Date, Time and Temperature, while Default Screen 2 displays the
same information plus indicates that the temperature is being logged to a .csv file, they are shown in
Fig. 18 below:

Figure 18 - Default Screens 1 and 2

When the menu is displayed, scrolling though moves you though Menu Screens 1 to 4, which are
shown below:

12

Figure 19 - Menu Screens 1 to 4

If one of the options on the menu screen are selected one of the sub-menu screen are displayed.
These are shown in Figures 20 to 22.

Figure 20 - The Adjust Brightness Screen

Figure 21 - The Adjust Sample Time Screen

Figure 22 - The Erase File Screen and its sub-screens

If the Exit option is selected, then the default screen is displayed. If the user selects the option of
plot the temperature in real time, then the Temperature Plot Screen, shown in Fig. 23, is displayed.

Figure 23 - The Temperature Plot Screen

13

Software Structure
The entire programme is broken up into several functions, based on different operations.
These are:
1. The Main Function this allows the user to navigate through the screens, and displays the
appropriate screen and allows the user to adjust the brightness or temperature sample time.
2. The TMP102 Initialization Function this initializes the TMP102 temperature IC, in Shut
Down mode, which enables it to read the temperature only when instructed to by the
microcontroller.
3. The Get Temperature Function this performs a temperature conversion to get the
temperature, and if File Writing is enabled calls the Write to File Function to log the date,
time and temperature in .csv format. This function is attached to a timer that calls it, via
interrupt, depending on the value of the sample time.
4. The Write To File Function this writes the data described in 3 to a .csv file.
5. The LCD Update Function this enables the LCD to be updated every second, to update the
time, if the Logger is on the Default Screen (1 or 2).
6. The Get Time Function the gets the current date and time from the RTC and formats it.
7. The Display Error Function this function displays an error code by blinking the LEDs a fixed
number of times based on where the error occurs, this function is an extended version of
the function given to the student by Dr Craig Evans in the lab sessions. The function displays
an error if there were read or write errors between the microcontroller and the TMP102.
8. The Write to Configuration File Function this function stores the users settings in a binary
file.
9. The LCD Display Function this function updates the LCD based on which screen needs to be
displayed. It evaluates a switch case to determine the appropriate screen to display, and
then configures the LCD accordingly.
Each of these functions are described by their flowcharts in the figures that follow. The code for the
entire programme can be found in Appendix 1.

14

Figure 24 - Part 1 of the Main Function Flowchart

Figure 25 - Part 2 of the Main Function Flowchart

Figure 26 - The Get Temperature Function flowchart

Figure 27 - The Write to File Function flowchart

Figure 28 - The LCD Update Function flowchart

Figure 29 - The Get Time Function flowchart

Figure 30 - The Display Error Function flowchart

Figure 31 - The Write to Configuration File Function flowchart

Figure 32 - The LCD Display Function flowchart

Results and Testing


After the software was compiled and copied to the mbed microcontroller, the user interface
was tested. The Welcome Screen loaded correctly, as shown in Fig. 33.

Figure 33 - The Welcome Screen displayed on the LCD

After the Welcome Screen loaded, the Default Screen was shown, with the Temperature and Time
updating accordingly. This is shown below:

Figure 34 - Default Screen 1 displayed on the LCD

If the Temperature Logging was turned on through switch SW, the default screen changed and
indicated that file writing is taking place. This can be seen in Fig. 34.

Figure 35 - Default Screen 2 displayed on the LCD

The Menu was displayed correctly and navigation was done in accordance to the software, two of
the Menu screens are shown in Figures 36 and 37 respectively.

Figure 36 Menu Screen 1 displayed on the LCD

Figure 37 - Menu Screen 3 displayed on the LCD

The sub-menus were also displayed corrected and allowed the user to adjust the brightness (Fig. 38)
and adjust the sample time (Fig. 39).

Figure 38 - The Adjust Brightness Screen displayed on the LCD

Figure 39 - The Adjust Sample Time Screen displayed on the LCD

The file deletion function also worked as expected. The sub-menu screen was displayed (Fig. 39),
and if the file existed and writing was not being done it was deleted (Fig. 40). If the file did not exist,
then it couldnt be deleted (Fig. 41) and if the file writing was on, the error screen was displayed
(Fig.42).

Figure 40 - The Delete File Screen displayed on the LCD

Figure 41 - Message Screen 1 displayed on the LCD

Figure 42 - Message Screen 2 displayed on the LCD

Figure 43 - Error Screen 1 displayed on the LCD

Also, if the user choses the temperature plot option the temperature is plotted on the LCD. This can
be seen below:

Figure 44 - The graph of the temperature displayed on the LCD

The data logging function was tested using a sample time of 60s, a graph of the results can be seen
in Fig. 44. A table of the results are in Appendix 2.

10

21.52

21.5

21.48

Temoerature

21.46

21.44

21.42

21.4

21.38

21.36
16:55:12

17:02:24

17:09:36

17:16:48

17:24:00

17:31:12

17:38:24

Time
Figure 45 - A graph of the results obtained with a sample time of 60s

The sample time was adjusted to 10 seconds, and the device was placed in a much colder location to
test if it can read a negative temperature. A graph of the results are shown in Fig. 46 below, and a
table of the results can be found Appendix 2.

11

12

10

Temperature

0
15:53:17

15:56:10

15:59:02

16:01:55

16:04:48

16:07:41

16:10:34

-2

-4

Time
Figure 46 - A graph of the results with sample time of 10s

12

Conclusion
The temperature logger project provides an easy to use interface, which is navigated
through using the two buttons on the project. It displays the date, time and temperature on the
LCD. The temperature is sampled at an interval that can be set by the user, with a default sample
time of sixty seconds. The user can also choose to have a real time graph of the temperature
displayed on the LCD, though the options in the user interface. The brightness of the LCD can also
be adjusted from its default value of 50%, this and the sample time are stored in a binary file in the
FLASH memory of the microcontroller to ensure that the user settings are saved if the
microcontroller is turned off. The project can log the temperature, date and time by writing that
information to a comma separated value (csv) file stored in the FLASH memory of the
microcontroller, this logging can be controlled by the user though the switch SW. The user also has
the option of deleting this file from the FLASH memory of the microcontroller. With these features,
the project successfully met all the aims set out in the Introduction.
The project has scope of expansion. The TMP102 has the ability to trigger an alarm if a
maximum or minimum temperature is passed [6]. This feature allows the TMP102 to function as a
thermostat, which can be used to regulate the temperature that is being measured. This can done
by using the microcontroller to turn on a cooling device, such as a fan, if needed. Also the user
interface can be improved, but the number of input devices such as buttons needs to be increased
and a larger LCD display would lead to more space for the information displayed by the interface.
One of the main drawbacks of the project is the dependence on the RTC to be configured manually.
The two buttons make it hard to set the current time just using the inputs currently configured, thus
the only way to set the RTC is by serial interface with a PC.

13

References
[1] M. P. .. Canton, Embedded Systems Circuits and Programming, CRC Press, 2012.
[2] F. E. Valdez-Perez and R. Pallas-Areny, Microcontrollers - Fundamentals and Applications with
PIC, CRC Press, 2009.
[3] M. Eastaugh, Microprocessor Tutorial, 2004. [Online]. Available:
http://www.eastaughs.fsnet.co.uk/cpu/structure-index.htm. [Accessed 1 December 2015].
[4] M. Barr, Introduction to Watchdog Timers, 1 October 2001. [Online]. Available:
http://www.embedded.com/electronics-blogs/beginner-s-corner/4023849/Introduction-toWatchdog-Timers. [Accessed 1 December 2015].
[5] NXP B.V, mbed NXP LPC1768 prototyping board (flyer), ARM mbed (R), Neatherlands, 2009.
[6] Texas Instruments Incorporated, TMP102 Low-Power Digital Temperature Sensor With SMBus
and Two-Wire Serial Interface in SOT563 (datasheet), Dallas, 2015.
[7] Sparkfun Electronics Inc., Graphic LCD 84x48 - Nokia 5110 - LCD-10168 - SparkFun Electronics,
[Online]. Available: https://www.sparkfun.com/products/10168. [Accessed 1 December 2015].
[8] Phillips Semiconductors Inc., PCD8544 Datasheet, 1999.

14

Appendix 1

15

16

17

18

19

20

21

22

23

Appendix 2
Date
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15

Time
Temperature
17:00:07
21.44
17:01:07
21.44
17:02:07
21.44
17:03:07
21.38
17:04:07
21.38
17:05:07
21.38
17:06:07
21.38
17:07:07
21.38
17:08:07
21.38
17:09:07
21.38
17:10:07
21.38
17:11:07
21.38
17:12:07
21.38
17:13:07
21.38
17:14:07
21.38
17:15:07
21.38
17:16:07
21.44
17:17:07
21.44
17:18:07
21.44
17:19:07
21.44
17:20:07
21.38
17:21:07
21.44
17:22:07
21.44
17:23:07
21.5
17:24:07
21.5
17:25:07
21.5
17:26:07
21.5
17:27:07
21.5
17:28:07
21.5
17:29:07
21.5
17:30:07
21.5

Table 3 - Results of the Temperature Logger with sample time of 60s

24

Date
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15

Time
Temperature
15:55:02
10.25
15:55:07
9.94
15:55:12
9.62
15:55:17
9.5
15:55:22
9.25
15:55:27
8.94
15:55:32
8.81
15:55:37
8.56
15:55:42
8.38
15:55:47
8.19
15:55:52
8.06
15:55:57
7.81
15:56:02
7.69
15:56:07
7.44
15:56:12
7.19
15:56:17
7.06
15:56:22
6.88
15:56:27
6.75
15:56:32
6.56
15:56:37
6.44
15:56:42
6.38
15:56:47
6.19
15:56:52
6.12
15:56:57
6
15:57:02
5.88
15:57:07
5.75
15:57:12
5.5
15:57:17
5.5
15:57:22
5.38
15:57:27
5.19
15:57:32
5.06
15:57:37
4.94
15:57:42
4.81
15:57:47
4.69
15:57:52
4.44
15:57:57
4.44
15:58:02
4.38
15:58:07
4.25
15:58:12
4.12
15:58:17
3.94
15:58:22
3.81
15:58:27
3.69
15:58:32
3.69
15:58:37
3.62
15:58:42
3.5
25

12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15

15:58:47
15:58:52
15:58:57
15:59:02
15:59:07
15:59:12
15:59:17
15:59:22
15:59:27
15:59:32
15:59:37
15:59:42
15:59:47
15:59:52
15:59:57
16:00:02
16:00:07
16:00:12
16:00:22
16:00:27
16:00:32
16:00:37
16:00:42
16:00:47
16:00:52
16:00:57
16:01:02
16:01:07
16:01:12
16:01:17
16:01:22
16:01:27
16:01:32
16:01:37
16:01:42
16:01:47
16:01:52
16:01:57
16:02:02
16:02:07
16:02:12
16:02:17
16:02:22
16:02:27
16:02:32
16:02:37

3.31
3.31
3.19
3.06
2.94
2.88
2.81
2.75
2.62
2.56
2.5
2.38
2.31
2.25
2.19
2.12
2.12
2.06
1.88
1.88
1.81
1.69
1.62
1.56
1.5
1.44
1.38
1.25
1.12
1.12
1.06
1.06
0.94
0.88
0.88
0.81
0.81
0.75
0.62
0.62
0.5
0.44
0.38
0.38
0.31
0.31
26

12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15

16:02:42
16:02:47
16:02:52
16:02:57
16:03:02
16:03:07
16:03:12
16:03:17
16:03:22
16:03:27
16:03:32
16:03:37
16:03:42
16:03:47
16:03:52
16:03:57
16:04:02
16:04:07
16:04:12
16:04:17
16:04:22
16:04:27
16:04:32
16:04:37
16:04:42
16:04:47
16:04:52
16:04:57
16:05:02
16:05:07
16:05:12
16:05:17
16:05:22
16:05:27
16:05:32
16:05:37
16:05:42
16:05:47
16:05:52
16:05:57
16:06:02
16:06:07
16:06:12
16:06:17
16:06:22
16:06:27

0.25
0.19
0.12
0.12
0.06
0
-0.06
-0.06
-0.12
-0.12
-0.19
-0.25
-0.31
-0.38
-0.44
-0.5
-0.56
-0.62
-0.69
-0.75
-0.75
-0.81
-0.81
-0.88
-0.88
-0.94
-0.94
-0.94
-1
-1
-1
-1.06
-1.12
-1.12
-1.19
-1.19
-1.25
-1.25
-1.31
-1.38
-1.38
-1.44
-1.44
-1.44
-1.44
-1.44
27

12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15
12/15/15

16:06:32
16:06:37
16:06:42
16:06:47
16:06:52
16:06:57
16:07:02
16:07:07
16:07:12
16:07:17
16:07:22
16:07:27
16:07:32
16:07:37
16:07:42
16:07:47
16:07:52
16:07:57
16:08:02
16:08:07
16:08:12
16:08:17
16:08:22
16:08:27
16:08:32
16:08:37

-1.56
0.5
2.5
3.62
4.5
4.94
5.44
5.94
6.38
6.75
7.12
7.44
7.75
8.25
8.5
8.81
9.06
9.38
9.62
9.81
9.94
10.06
10.25
10.44
10.5
10.62

Table 4 - Results of the temperature logger with sample time of 10s

28

Potrebbero piacerti anche