0% found this document useful (0 votes)
24 views21 pages

Iot Programming

Uploaded by

funnymine04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views21 pages

Iot Programming

Uploaded by

funnymine04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Outlines

• What is Programming?
• Where Programming is Needed?
• Programming
– Blockly Games
– Programming Languages
– Programming for IoT
– Programming a Simple Sensor – Actuator

• Data and Big Data


– What is IoT Data?
– Digital Data
– Data Types
– Playing with Data

Le The Dung, Ph.D. Programming IoT 1/19


What is Programming?
• Programming is the process of creating a set of instructions that tell a
computer how to perform a task or sequence of tasks.

• The engineering practice of computer programming is primarily


concerned with discovering and implementing the most efficient
algorithms to address a specific class of problem.
• Computer programming entails the use of a variety of programming
languages.

Le The Dung, Ph.D. Programming IoT 2/19


Where Programming is Needed?
• The Foot Drop project has three devices which provided a comparison of
movement in different parts of the leg to identify the incidence of foot
drop.

– All these devices need


programming so they know
what to capture, where to
send the data, how to process
the data, how to relay the
data, etc.

• At an application level, the programming allows the devices to talk to


other devices or machines and to respond to the data with actions.

Le The Dung, Ph.D. Programming IoT 3/19


What Programming Where?
• In the table below we look at where programming is required in a smart
sprinkler system.

Le The Dung, Ph.D. Programming IoT 4/19


What Programming Where? (cont.)

Le The Dung, Ph.D. Programming IoT 5/19


Programming
• If you have no experience of programming the following activity provides
an opportunity to learn to program at an elementary level.
• Blockly Games is a Google project and is a series of educational games
that teach programming. Click on the following link to access Blockly
Games.

Le The Dung, Ph.D. Programming IoT 6/19


Programming Languages
• A programming language is the way of communicating with a computer. It
is a set of vocabulary and grammar rules that can be used to instruct the
computer.

• There are a multitude of programming languages and more created all


the time.
• Choosing a programming language for IoT will likely be influenced by
personal preference and the needs of your project.

Le The Dung, Ph.D. Programming IoT 7/19


Programming for IoT
• The main consideration for programming for IoT is that the small devices
generally have:
– Limited power supply
– Limited computational power
– Limited memory

• Zola describes 12 languages and each has something that differentiates it


from other languages that might contribute to choosing it for an IoT
project.

Language Key funtionality


Assembly Useful for compact applications
C Useful for embedded devices
B# Used for small applications
C++ Required when you need processing power
Allows devices to work together to send and receive data in many
Go
channels simultaneously

Le The Dung, Ph.D. Programming IoT 8/19


Programming for IoT

Language Key funtionality


Java Write it once, run it anywhere
Javascript Omnipresent in Web applications and websites
Parasail Useful for parallel processing
PHP Juggle micro-services on the server
Python Easy language to understand and utilise in IoT projects
Rust Can share information among different channels automatically
Swift Common language for developing iOS apps (Apple)

• This is just one view on the programming languages suitable for IoT. Other
languages include; R, Form, Hive QL, Pig Latin, and Julia.

Le The Dung, Ph.D. Programming IoT 9/19


Programming a Simple Sensor - Actuator

• In this video an IoT model is set up using an Arduino microprocessor.


• The demonstration shows the programming required to automate the use
of a cooling fan, and then to disable this functionality.

Le The Dung, Ph.D. Programming IoT 10/19


Programming a Simple Sensor – Actuator (cont.)

• If you looked at the Blockly Games earlier, you will recognize the
similarities in the programming structure and language shown below.

Le The Dung, Ph.D. Programming IoT 11/19


What is IoT Data?
• Traditionally, information has come into our homes (and offices) in
different ways:
– Television uses a connection to either aerial or satellite dish
– Telephone (voice) comes through the telephone connection
– Internet and email come through an internet connection

Source: http://www.ciscopress.com/articles/article.asp?p=2164577&seqNum=6

Le The Dung, Ph.D. Programming IoT 12/19


What is IoT Data? (cont.)
• More and more, these routes are converging so that we will expect our TV,
phone, internet and IoT devices to send and receive data through the
same common connection.

Source: http://www.ciscopress.com/articles/article.asp?p=2164577&seqNum=6

• The information itself is all becoming digital data.


data
Le The Dung, Ph.D. Programming IoT 13/19
Digital Data
• Data can be a telephone conversation, a television program, a web page,
an email, an online theatre booking, or a series of readings from a sensor
or instructions to a machine.

Source: By João Batista Neto - Data types - pt br.svg, CC BY 3.0,

Le The Dung, Ph.D. Programming IoT 14/19


Digital Data (cont.)
• Digital data is data that is represented using a binary system of zeros (0)
and ones (1).
• Visual images, speech, text, sensor readings and so on all get converted to
this binary system. The data is packaged into bytes - bite-sized pieces that
can be moved through the network from one address to another using
various protocols. Bytes are sometimes split further into Nibbles (half the
size) or Bits (one eighth the size of a Byte).

Length Name Example


1 Bit 0
4 Nibble 1011
8 Byte 10110101

Le The Dung, Ph.D. Programming IoT 15/19


Big Data
• Big data is data sets that have become so large and so complex that
advanced programming and processing is required to capture the data,
and then appropriately store, analyze, search, share, transfer, and visualize
it.

• Big data is significantly impacted by the growth of information-


information-sensing
Internet of Things devices.
devices.

Le The Dung, Ph.D. Programming IoT 16/19


Big Data (cont.)

Le The Dung, Ph.D. Programming IoT 17/19


Data Types
• IBM describes the 4 V's of Big Data as:
– Volume (quantity – big data observes and tracks what happens without
sampling)
– Velocity (speed – big data is generally available in real-time)
– Variety (big data extracts from multiple sources such as text, images, audio,
video)
– Veracity (data quality – whether it stays true, or some is lost or damaged)

Le The Dung, Ph.D. Programming IoT 18/19


Playing with Data
• Try playing the data-sorting game Color Step on a mobile device (though
you may use a computer to drag and drop colors if you don't have a
touch-screen device) to start to understand this concept.
• Let’s consider what was happening when you were playing that game.

The processor in this system - your brain - was undertaking several tasks
in dealing with the data.
1. Receiving data (color information from the eyes).
2. Comparing data (color bands).
3. Directing the eyes where to look.
4. Directing the hands to interact with the image on the screen.

Le The Dung, Ph.D. Programming IoT 19/19


THANK YOU ALL FOR LISTENING
QUESTIONS AND ANSWERS

You might also like