You are on page 1of 6

2016 IEEE Symposium on Service-Oriented System Engineering

Internet of Things Application using Tethered


MSP430 to Thingspeak Cloud
Ahmed I. Abdul-Rahman Corey A. Graves, Ph.D.
Department of Electrical and Computer Engineering Department of Electrical and Computer Engineering
North Carolina A & T State University North Carolina A & T State University
NC, USA NC, USA
aiabdulr@aggies.ncat.edu cag@ncat.edu

Abstract—Internet of Things (IoT) has evolved from being a The Internet is the platform that leverages the functionality
vision for the future to being an increasing market reality. and usefulness of the smart object. Cloud computing provides
Technology companies have dedicated resources and personnel the environment and infrastructure for integrating monitoring
to research into IoT and machine-to-machine (M2M) devices, storage devices, analytical tools, platforms for
communication. Internet of Things really involves primarily visualization and client delivery [4]. With the extensive
incorporating sensors to machines and everyday objects. The coverage of Wi-Fi and Mobile Internet access, access to the
data from the sensors need to be leveraged by analyzing the data smart objects can be achieved from virtually anywhere using
in real time. Cloud applications are tools that help us leverage pre-existing tools and technologies. In this research, we would
this acquired data. The objects, tools and environments that we
be creating a smart object and monitor the data being generated
constantly monitor in our daily lives can be made smart and
over the internet. This paper discusses an implementation of a
connected to the cloud. This paper is focused on implementing a
typical IoT application using a Texas Instrument based MSP430 typical IoT for an embedded system course project using a
microprocessor and a cloud based Thingspeak Application. This microcontroller MSP430 and a cloud data platform and API
paper was required as part of a course project at North Carolina call at (http://www.mathworks.com/help/thingspeak/getting-
A &T State University for an embedded system course. started-with-thingspeak.html). This paper first discusses the
background of the research. The Methodology and design
Index Terms - Internet of Things, machine-to-machine, thing, setup is discussed afterwards before we delve into the
cloud computing, big data, smart object, embedded system, sensors, experimental setup and results. The conclusion and future work
Universal Asynchronous Receiver Transmitter. completes the paper.

I. INTRODUCTION
ITU and IERC defines the Internet of Things (IoT) as “a II. BACKGROUND
dynamic global network infrastructure with self-configuring The definition of Internet of Things has changed
capabilities based on standard and interoperable continuously with technology evolution. The term was
communication protocols where physical and virtual “things” originally used by Kevin Ashton in 1999 in the context of
have identities, physical attributes and virtual personalities, use supply chain management and evolved to include applications
intelligent interfaces and are seamlessly integrated into the like healthcare, utilities, and bio-sensing etc. [2]. The definition
information network.”. It should be noted that as IoT implied the use of computers to detect information without the
continues to develop, other technologies such as Cloud use of human beings. The definition today is not only targeted
Computing, Big Data, robotics, and the internet help in at sensing information from the environment, but also using
leveraging its capabilities. The interconnection of physical internet standards to provide services for transfer of
things to the internet has made it possible to access remote information, information analysis, applications and
sensor data and use this information to control the physical communications. Various technologies have blossomed and
world remotely [1]. taken hold in our daily lives such as Bluetooth, radio frequency
Smart things or smart objects are the building blocks of identification, and Wi-Fi, which are technologies that IoT
IoT’s. Smart objects is all about transforming everyday objects relies upon to function effectively [5]. According to Gubbi,
into objects with improved sensing and processing capabilities only in 2011 did the number of interconnected devices on the
that can understand and react to their environment using planet overtake the actual number of people. It is expected that
embedded sensors. These objects can generate enormous by the year 2020, there will be approximately 24billion devices
amount of data which can be stored, processed, and formatted which amounts to $1.3 trillion revenue for mobile network
into an efficient, seamless and useful form. The combination of operators. These revenue projections have motivated
various emerging technologies such as near-field technology industries to research into IoT compatible devices.
communications, real-time localization, embedded sensors, and A lot of research has been done relating to the different
the internet enable us transform these everyday objects into independent technologies that must be integrated to form a
smart objects [2][3]. complete IoT System. These technologies range from
identification and tracking technologies, wired and wireless

978-1-5090-2253-3/16 $31.00 © 2016 IEEE 352


DOI 10.1109/SOSE.2016.42
sensor and actuator network technologies, and enhanced III. METHODOLOGY AND DESIGN SETUP
communication protocols [6]. Abaci et al presents a novel The goal of the embedded system course project is to create
method of employing “smart objects” for problem solving in an IoT application that involves interfacing the sensors on the
virtual environments [7]. Halfawy et al describes a Educational BoosterPack and MSP430 with the online IoT
methodology to implement integrated project systems through development environment Thingspeak. Fig 3 shows the level 0
the use of a model-based approach that involves developing Block diagram of the system. The input to the system is the
integrated “smart objects” [8]. analog signals captured by the system. The signals captured in
The MSP430 Launchpad from TI, along with its this project are temperature, sound, potentiometer readings and
Educational Booster Pack together forms our “thing”. The accelerometer readings. The output of the system is the sensor
MSP430G2553 microcontroller (MCU) as shown in Fig1 is information presented and displayed by the online application.
from the MSP Ultra-Low-Power MCU series and offers low
power and performance of 16-bit MSP microcontrollers. It has
five power-saving modes. It has clock module and a 16- Bit
Timer_A with 3 capture/compare registers. It has a Universal
serial communication Interface which possesses UART, IrDA
Encoder/ Decoder, Synchronous SPI, and I2C modules. It has
an on-chip comparator and Analog-to-Digital Convertor.

Fig3. Level 0 Block Diagram of IoT system

Fig1. MSP430g2553

Fig4. Level 1 Block Diagram of IoT System


These signals are processed and transmitted over a serial
interface to a PC application as shown in Fig 4. The PC
application receives the data and updates an online Thingspeak
channel

Fig2. Educational Booster Pack


The Educational Booster Pack in Fig2 extends the
peripherals of the MSP430 by including additional sensors.
This additional piece of hardware extends the limited
capabilities of the MSP430 with the inclusion of sensors such
as RGB LED, microphone, buzzer, LCD display,
potentiometer, accelerometer, temperature sensor and more.
Thingspeak is an open data platform and API for the
Internet of Things that enables you to collect, store, analyze,
visualize, and act on the data from sensors or actuators from an
internet based cloud application [9]. The primary element of
Thingspeak activity is the channel which contains data fields,
location fields, and status fields. Fig5. UML Diagram of Main IoT System

353
Fig 5, Fig 6, and Fig 7 shows the various modules of the communication is used to transmit the data serially. A byte of
IoT System. The various modules consist of the MSP430 data is transmitted along with the sensor information. The
Application, the PC Application and the Thingspeak purpose of this byte of data is to serve as a datum. The datum
Application. These modules are parallel processes and makes it possible to identify all the transmitted data values and
exchange information simultaneously. When the System starts, most importantly be able to match the values to their
all three modules also start at the same time. Each individual appropriate sensors.
module can start and stop independently of the other modules.
Therefore all modules must start for the entire system to be
correctly synchronized. The tools and techniques used were
dependent on each individual module. The tool used in
developing the MSP430 application was code composer and
the language of choice was C. The tool used in developing the
PC application is Microsoft Visual Studio and the language of
choice is C-sharp.

Fig7. UML Diagram of the PC Application

In the implementation of the PC application, an interface


Fig6. UML Diagram of the MSP430 Application was created to start and stop the conversion. The interface also
has a textbox that displays the received data. An important
In the implementation of the MSP430 app, we first aspect of this application is matching the received data to the
initialize the different sub-modules. These are the Analog to appropriate sensor. To accomplish this task, the datum byte is
Digital Converter (ADC) module, Universal Asynchronous utilized to detect the position of the data in the stream of sensor
Receiver/Transmitter (UART) module, and the Timing values shown in Fig 8. The values are displayed on the PC
module. Analog Discovery oscilloscope and logic analyzer was application interface. The values are simultaneously
used to test the transfer of sensor information to the appropriate transmitted to the thingspeak channel created.
pin on the MSP430. The ADC conversion it applied to all the
input channels for the sensors being monitored. A timing
scheme is setup to perform the ADC conversion repeatedly for
all the sensors. Once the ADC is performed, two parallel
processes are invoked. One process is to transmit serially the
captured sensor value to the PC serially and the other is to
display the transmitted data on an LCD screen. UART Fig8. Order of Serial Transmission of samples

354
The setup was done in accordance with Fig 10. The
MSP430 and Boosterpack, which together comprise our
“thing”, were connected to the PC via a serial connection. A
USB cable was used for the connection. The baud rate for the
transmission was 9600 due to fact that the Launchpad USB
connector was used. The baud rate could have been higher if a
different serial cable was used. The PC was connected to the
internet to access the thingspeak application.
The smart object was exposed to different conditions over
a 30 minute interval while changing its external conditions.
The results obtained from the sensor readings were taken.
Table I shows the readings as they were output from the LCD
of the smart object for intervals of 30 minutes. Fig 11 shows
how the sensor values are displayed on the smart object’s LCD.

TABLE I. Readings from the LCD of the smart object


Sensor Readings 30 minutes interval
Sensor
Reading 1 Reading 2 Reading 3

Temperature 77 78 76

Fig9. UML Diagram of Thingspeak App Microphone 774 776 779

Potentiomter 797 800 824


The implementation of the Thingspeak cloud API service
involved signing-up as a user. After creating an account, a
Accelerometer 1023 800 864
channel was created to monitor our sensors. The channel was
made public to allow others to access it and view the sensor
values recorded. The channel accesses the PC application for
current values and displays the data visually as shown in fig 9.
The complete setup of the entire IoT System is shown in fig 10.

IV. EXPERIMENTAL SETUP AND RESULTS

Fig10. Setup of IoT System Fig11. MSP430 Temperature Display

355
TABLE II. Comparison of MSP430 LCD and the PC App
Sensor Data

Sensor MSP430 LCD PC APP Delay(s)

Temperature 77 77 10s

Microphone 774 774 10s

Potentiometer 797 797 10s

Accelerometer 1023 1023 10s

The channel was set up to contain four fields each


monitoring the sensor information of each sensor. The channel
receives information from the PC application every 20s and
updates the fields accordingly. The Thingspeak channel
received the data correctly and consistently. The results show a
consistent display of readings as seen in Table III below.
Fig12. PC Application Interface
The PC Application has 3 Buttons as shown in Fig12. The
“Serial Start” button which starts the reading of the data from TABLE III. Sensor Information displayed in all 3 modules
the serial port. This action monitors the serial port for incoming
data. The system processes the incoming data bits and displays MSP430 Thingspeak
Sensor PC APP Delay(s)
the results on the PC interface. The information is LCD channel
simultaneously uploaded to the thingspeak channel. The
“Serial Stop” button stops the reading action. The “Read Temperature 76 76 76 20s
channel 70329” Button reads data from the Thingspeak
channel 70329. We refer to this channel as a “Request
Microphone 779 779 779 20s
Channel”. This channel was created to enable remote request
for specific sensor information from our “thing”. The channel
is made up of two fields. The first field displays the channel ID Potentiometer 824 824 824 20s
of the “thing” whose sensor information we seek. The second
field displays an ID (i.e. 1 to 4) which corresponds to a
Accelerometer 864 864 864 20s
particular sensor. The PC application monitors the fields from
the channel. Whenever the Request Channel specifies the
Channel ID that our “thing” transmits to, the application
updates the sensor value requested. Assuming we have 10 The time interval between each successive sample
different channels which monitor 10 different “things”, we can appearing at the channel is approximately 20s which is the
request information from a particular “thing” by specifying the delay incorporated in the program. This delay could be affected
Channel ID and Sensor ID of the object and sensor by the stability of the internet connection and the inherent
respectively. The smart object’s PC interface receives the sampling delay. The visual display of the channel fields as
request and updates the channel. The application continuously shown in Fig13 allows for faster data analysis. It also allows
updates the channel fields. for trend analysis to be conducted visually. The date and time
the signal was recorded is plotted against the value of the
The user can also read the current Channel ID from the signal data. This information can be exported into spreadsheet
channel 70329 which is the “Request Channel” by simply format if desired.
clicking the Read Channel 70329 Button. If the channel ID
used by the application is broadcasted by the Request Channel,
the application displays a prompt that lets the user know the
event has occurred. It displays a SUCCESS indicator as shown
and also displays the sensor id from its second field. The
application then updates the channel with the appropriate
information. The application repeatedly polls the channel every
20s. There is also a textbox that displays the current sensor
readings in real time. The results show that these values are
consistent with the values presented on the LCD display of the
MSP430 device as shown in Table II.

356
V. CONCLUSION AND FUTURE WORK
We were able to create an Internet of things system by
successfully connecting our thing (MSP430 and BoosterPack)
to the cloud and monitoring the operation of the device
remotely. The sensor data was updated correctly and
consistently with an accuracy of 99.99%. The error was
primarily due to internet connectivity issues. This project was
successful as the primary aim of the class project was to allow
students to gain practical experience with IoT.
Future work would entail introducing multi-connectivity
between the MSP430 and PC application. Wireless
technologies such as Bluetooth and infra-red could be used to
interface the PC application. The PC application would need to
be modified to include a graphical monitoring interface. The
PC application would also need to be packaged for distribution
across multiple platforms.

VI. REFERENCES

[1] Kopetz Hermann. “Internet of things,” Real-time systems. Springer US,


2011. 307-323
[2] Kortuem, Gerd, et al, “Smart objects as building blocks for the internet
of things,” Internet Computing, IEEE 14.1 (2010): 44-51
[3] Mattern, Friedemann, and Christian Floerkemeier, “From the Internet of
Computers to the Internet of Things.” From active data management to
event-based systems and more(pp. 242-259). Springer Berlin Heidelberg
[4] Gubbi, Jayavardhana, et al, “Internet of Things (IoT): A vision,
architectural elements, and future directions,” Future Generation
Computer Systems 29.7 (2013): 1645-1660
[5] J. Buckley (Ed), “The Internet of things: From RFID to the Next-
Generation Pervasive Networked systems,” Auerbach Publications, NY
(2006)
[6] Atzori, Luigi, Antonio Lera, and Giacomo Morabito.”The internet of
things: A survey.” Computer networks 54.15 (2010): 2787-2805
[7] Abaci, Tolga, Jan Ciger, and Daniel Thalmann. “Planning with smart
objects.” (2005)
[8] Halfawy, Mahmoud, and Thomas Froese. “Building Integrated
Architecture/Engineering/Construction Systems Using Smart Objects:
Methodology and Implementation 1.” Journal of Computing in Civil
Engineering 19.2 (2005): 172-181
[9] Mathworks.Inc (2016) Getting started with Thingspeak. Available
“http://www.mathworks.com/help/thingspeak/getting-started-with-
thingspeak.html”

Fig13. Thingspeak Channel with Sensor Fields

357

You might also like