computer science and engineering 1884 prifysgol bangor university ice
Search for question
Question
COMPUTER SCIENCE & ENGINEERING
1884
PRIFYSGOL
BANGOR
UNIVERSITY
ICE-3501
Internet of Things
Laboratory Exercise 5:
Downlinks and Data Storage
Noel Bristow
THE THINGS
NETWORK
AREF
DACO/AO ICE-3501
Module:
ICE-3501 - Internet of Things
Computer Science and Engineering
Dr Noel Bristow
Department:
Module credit:
20
Organiser:
Deadline:
see Blackboard
Laboratory Exercises
Assessment: Laboratory Exercise 5
Description
In these weekly laboratory sessions you will be provided with a range of exercises designed to help
you master some of the concepts and tools required to develop and build loT systems. There are five
laboratory sessions that are assessed and each piece of work must be completed and submitted for
marking. Note that these exercises make up 75% of your final mark for this course (15% each), so it is
important that you submit all of them.
Generally you should be able to complete laboratory exercises within the 2 hours that have been
timetabled for that laboratory. If you have been unable to complete the work in this period, you
should finish it in your own time.
The laboratory exercises will consist of the following:
1. Node Creation 101 – An introduction to the Arduino 1310 and Grove sensors.
-
2. Local Communications - Experimenting with Serial and I2C communications.
-
3. TTN Setup – Setting up an application on TTN and formatting payloads.
4. Integrations & Dashboards - Building dashboards in Node-RED and using MQTT.
5. Downlinks & Data Storage - Setting up downlink messages to control an end device
from your dashboard and storing data for later use.
Output Requirements
You will be required to produce a short report for each laboratory explaining your results and
findings. Include any code (copy/paste) as required in the report (do NOT screendump). Other
outputs (e.g. TTN screens) can be included as screendumps. Also note that to obtain a mark you
must attend a laboratory session and be prepared to demonstrate your program and answer
questions about the coding. Non-attendance at labs will result in your work not being marked.
Submission Procedure
Use Blackboard to submit report (no emails). As you work through the exercises you will be
expected to demonstrate a working prototype to the lecturer/lab demonstrator. This will be done
at a lecture/workshop at most one week after the submission deadline.
Deadlines
The deadline for submitting each exercise will be at 9pm on the Sunday two weeks after each
exercise is posted. The exact date will be posted on Blackboard. This will allow you to get help
and/or feedback at lecture/workshops before submission.
Contribution of this assessment
This assessment contributes to 15% of the overall module mark.
Module Learning Outcomes
• Prototype simple loT devices using common development boards.
• Construct a server to act as a conduit between an loT device and its user.
• Illustrate the processing flow of information from loT devices to an end-user.
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Lab 5 v2.0 (2023-24) ICE-3501
Plagiarism and Unfair Practice
Laboratory Exercises
Plagiarised work will be given a mark of zero. Remember when you submit you agree to the standard
agreement:
This piece of work is a result of my own work except where it is a group assignment for
which approved collaboration has been granted. Material from the work of others
(from a book, a journal or the Web) used in this assignment has been acknowledged
and quotations and paraphrasing suitably indicated. I appreciate that to imply that
such work is mine, could lead to a nil mark, failing the module or being excluded from
the University. I also testify that no substantial part of this work has been previously
submitted for assessment.
Late Submission
Work submitted within one week of the stated deadline will be marked but the mark will be capped
at 40%. A mark of 0% will be awarded for any work submitted 1 week after the deadline.
Acceptable reasons for submitting work late include: Serious personal illness with a doctor's certificate
(a self-certified medical note should not be accepted); The death of a relative or close friend; Serious
family problems such as divorce, separation, and eviction. Examples of unacceptable reasons for
failing to submit work on time include: Having exams; Having other work to do; Not having access to
a computer; Having computer related problems; Being on holiday; Not being able to find information
about a subject. Contact the request centre on MyBangor if you need an extension.
Marking Scheme
Please remember that marks are provisional until they are confirmed by a board of examiners. The
marking scheme will be detailed in the requirements document for each exercise.
Mark ranges
>70%, excellent. Assemble critically evaluated, relevant areas of knowledge and theory to construct
professional-level solutions to tasks and questions presented. Is able to cross-link themes and aspects
to draw considered conclusions. Presents outputs a cohesive, accurate, and efficient manner..
>60%, good. Is able to analyse a task or problem to decide which aspects of theory and knowledge to
apply. Solutions are of a workable quality, demonstrating understanding of underlying principles.
Major themes can be linked appropriately but may not be able to extend this to individual aspects.
Outputs are readily understood, with an appropriate structure but may lack sophistication.
>40%, threshold performance. Uses key areas of theory or knowledge to meet the Learning Outcomes
of the module. Is able to formulate an appropriate solution to accurately solve tasks and questions.
Can identify individual aspects, but lacks an awareness of links between them and the wider contexts.
Outputs can be understood, but lack structure and/or coherence.
<40%, below threshold performance. An attempt has been made yet does not address
considerable areas of the criteria.
Feedback details
Formative
(On-going)
Description
Verbal Feedback - Verbal feedback will be available by request at
each lecture/workshop. It is suggested that you keep a written note
of this feedback to aid in your personal development. You will also
have a short meeting to discuss your design after you have submitted
it.
Summative Written Feedback - Written feedback will be made available through
(Post
blackboard after an assignment is submitted. To access your written
Assessment) feedback see the comments section of your assignment submission.
Timeframe
Instant
1-2 weeks
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Lab 5 v2.0 (2023-24) ICE-3501
-
Laboratory Exercise 4 – The Things Network (TTN) Setup
Laboratory Exercises
Welcome to the fourth laboratory session for ICE-3501 Internet of Things (IoT). In these weekly
sessions you will be provided with a range of exercises designed to help you master some of the
concepts and tools required to develop and build loT systems.
The main objective of this lab is to forward the temperature and light sensor data that appeared in
the TTN console (Lab 3) to Node-RED via MQTT, from here you can create an IoT dashboard to view
the data. Node-RED is a free, JavaScript-based development tool for visual programming, developed
to ease the process of wiring together hardware devices, APIs and online services. The MQTT server
that is exposed by The Things Stack can be connected to Node-RED. This integration allows setting up
a Node-RED flow that listens to events and uplink messages, and it is also possible to schedule
downlink messages.
Devices
Gateways
THE THINGS
NETWORK
Integration
Plugin
Thinger.io
Platform
Data buckets
Dashboards
Endpoints
Overview
The marks for the exercise are given in square braces as well as what is required e.g. photo & code:
[10%], please put all answers into a single pdf report.
Code: copy/paste so it can be tested if required - please do not screendump code as an image.
Photos are used to show that you have built the circuit.
You will need to demo your programmes to a member of staff.
This lab is split into 5 areas for you to explore they are:
1. Prepare device and flow
2. Configure for downlink
Dashboard Control
3.
4.
Data Storage
5. Visualise live data
You can get more information and help at https://www.arduino.cc for general Arduino help, look
under the documentation section. You can also find more information about the Grove Starter kit
here
https://www.seeedstudio.com/Grove-Starter-Kit-for-Arduino-p-1855.html. There is also some
good advice here https://wiki.seeedstudio.com/Grove_Starter Kit_v3/. For help with the Things
Network there is a wealth of documentation here https://www.thethingsindustries.com/docs. For
Node Red info: https://flows.nodered.org/.
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Lab 5 v2.0 (2023-24) ICE-3501
Laboratory Exercises
Lab Exercises
Exercise 1 - Prepare device and flow [15%]
(a) Change your Arduino Code from the last lab so that you are just transmitting a payload
consisting of temperature. Additionally change your Node-RED flow and dashboard to get rid
of the light and RSS objects, so you are just left with temperature.
NOTE: you can save a flow by right-clicking and selecting Export - on the dialog box you can
then select what you want to export (selected nodes, current flow, or all flows) and then
when you click Download a flows.json file will be created – this can be imported (CTRL+I)
(b) Now add a relay module to the Arduino MKR 1310
(connected to a digital input) and update your code
accordingly. In setup() get the Relay to turn ON, wait
1 second, and then turn OFF (this will confirm that the
relay is working).
Submit your Arduino code, and screenshot of the node-red IDE. [15%]
HELI SHON
HLSBL-DC3V-S-C
CE AW
10A 250V-15A 120VAC
Exercise 2 - Downlink [30%]
In order to receive a downlink message from TTN to control the relay we need to change the
Arduino code to listen for incoming data as follows:
(a) Add a new function receive_message():
void receive_message() {
// receive message:
// x00:
//
Relay OFF
otherwise: Relay ON
byte incomingData;
bool messageFlag
=
false;
while (modem.available()) {
// store the last received byte (in case multiple messages downloaded)
incomingData = (byte) modem.read();
messageFlag
= true;
}
if (messageFlag) {
Serial.print("Received: ");
Serial.print(incomingData);
if (incomingData
==
0) {
Serial.println(" Turning relay OFF");
// **** enter code here to turn Relay OFF
} else {
Serial.println(" Turning relay ON");
// **** enter code here to turn Relay ON
}
}
| }
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Lab 5 v2.0 (2023-24)/n COMPUTER SCIENCE & ENGINEERING
1884
PRIFYSGOL
BANGOR
UNIVERSITY
ICE-3501
Internet of Things
Mini-Project
Noel Bristow
THE THINGS
NETWORK
AREF
DACO/AO ICE-3501
Module:
Department:
Module credit:
Organiser:
Deadline:
ICE-3501 - Internet of Things
Computer Science and Engineering
20
Dr Noel Bristow
see Blackboard
Laboratory Exercises
Assessment : Mini Project
Description
The Mini project is an opportunity for you to demonstrate your abilities and understanding of
Internet of Things. The opportunity here is for you to conceive and implement a working
prototype for a 'product' that is both relevant and well executed. Your idea must meet the
needs of the module but also be exciting and fresh.
Note that as part of this activity you will be required to submit two formal pieces of work AND
evidence of the development and implementation phase of the project, see section marked
Submission.
၈)
Devices
C
Gateways
THE THINGS
NETWORK
Integration
Plugin
Thinger.io
Platform
Data buckets
Dashboards
Endpoints
Output Requirements
You will be required to produce a short report for each laboratory explaining your results and
findings. Include any code (copy/paste) as required in the report (do NOT screendump). Other
outputs (e.g. TTN screens) can be included as screendumps. Also note that to obtain a mark you
must attend a laboratory session and be prepared to demonstrate your program and answer
questions about the coding. Non-attendance at labs will result in your work not being marked.
Submission Procedure
Use Blackboard to submit your Film, A4 Infographic and Evidence. So below is a list if the items
required.
1.
A film – submitted via Panopto in Blackboard.
2.
-
An A4 Infographic (poster) – submitted through Blackboard
3. An evidence Portfolio via Blackboard - this will be a zip folder
Deadlines
The deadline for submitting your Mini-Project is on Blackboard. Late submissions will be penalised
in line with School policy.
Contribution of this assessment
This assessment contributes to 25% of the overall module mark. The assessment will be marked
out of 100 marks - marks for each section shown as e.g. [25 marks].
Module Learning Outcomes Covered
• Prototype simple loT devices using common development boards.
• Construct a server to act as a conduit between an IoT device and its user.
• Illustrate the processing flow of information from IoT devices to an end-user.
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Mini-Project v2.0 (2023-24) ICE-3501
Plagiarism and Unfair Practice
Laboratory Exercises
Plagiarised work will be given a mark of zero. Remember when you submit you agree to the standard
agreement:
This piece of work is a result of my own work except where it is a group assignment for
which approved collaboration has been granted. Material from the work of others
(from a book, a journal or the Web) used in this assignment has been acknowledged
and quotations and paraphrasing suitably indicated. I appreciate that to imply that
such work is mine, could lead to a nil mark, failing the module or being excluded from
the University. I also testify that no substantial part of this work has been previously
submitted for assessment.
Late Submission
Work submitted within one week of the stated deadline will be marked but the mark will be capped
at 40%. A mark of 0% will be awarded for any work submitted 1 week after the deadline.
Acceptable reasons for submitting work late include: Serious personal illness with a doctor's certificate
(a self-certified medical note should not be accepted); The death of a relative or close friend; Serious
family problems such as divorce, separation, and eviction. Examples of unacceptable reasons for
failing to submit work on time include: Having exams; Having other work to do; Not having access to
a computer; Having computer related problems; Being on holiday; Not being able to find information
about a subject. Contact the request centre on MyBangor if you need an extension.
Marking Scheme
Please remember that marks are provisional until they are confirmed by a board of examiners. The
marking scheme will be detailed in the requirements document for each exercise.
Mark ranges
>70%, excellent. Assemble critically evaluated, relevant areas of knowledge and theory to construct
professional-level solutions to tasks and questions presented. Is able to cross-link themes and aspects
to draw considered conclusions. Presents outputs in a cohesive, accurate, and efficient manner..
>60%, good. Is able to analyse a task or problem to decide which aspects of theory and knowledge to
apply. Solutions are of a workable quality, demonstrating understanding of underlying principles.
Major themes can be linked appropriately but may not be able to extend this to individual aspects.
Outputs are readily understood, with an appropriate structure but may lack sophistication.
>40%, threshold performance. Uses key areas of theory or knowledge to meet the Learning Outcomes
of the module. Is able to formulate an appropriate solution to accurately solve tasks and questions.
Can identify individual aspects, but lacks an awareness of links between them and the wider contexts.
Outputs can be understood, but lack structure and/or coherence.
<40%, below threshold performance. An attempt has been made yet does not address
considerable areas of the criteria.
Feedback details
Formative
(On-going)
Summative
(Post
Description
Verbal Feedback - Verbal feedback will be available by request at
each lecture/workshop. It is suggested that you keep a written note
of this feedback to aid in your personal development. You will also
have a short meeting to discuss your design after you have submitted
it.
Written Feedback - Written feedback will be made available through
blackboard after an assignment is submitted. To access your written
Assessment) feedback see the comments section of your assignment submission.
Timeframe
Instant
1-2 weeks
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Mini-Project v2.0 (2023-24) ICE-3501
Mini-Project: Tasks & Requirements
Laboratory Exercises
The modern world has recently started to adopt the concept of the Internet of Things (IoT).
This idea has led to many wonderful and exciting innovations, these include central heating
control from your phone, smelly tweets, smart lights, fridges that do your online shopping
automatically when you run out of food. Other examples are home security, location tracking,
activity tracking, pet monitors/feeders, environmental monitoring, smart agriculture,
healthcare monitors, smart appliances, wearables.
Your job is to produce an IoT system (as a minimum this is an end device, two-way
communications via LoRaWAN and a Dashboard using NodeRED). You are to design and build
a prototype that can then be used to demonstrate your concept (so for instance an automatic
curtain control system could just use a relay in place of the actual curtain control motor).
There are number of things that you must consider:
1. You will be using the Arduino MKR1310 (or agreed alternative) as your base for the
device.
2. You must keep evidence of the design process as you go - this can be concept drawings
and other sketches, screen grabs, videos and photos - software and hardware.
3. You should use sensors other than those already used in the lab - you are welcome to
use the light and temp as well, but you must use at least one additional sensor in your
project. If you require a sensor that is not included in the kit you can ask at a lab and
we might be able to provide it.
4. You will need to set up an application on The Things Network
5. You will need to connect a NodeRED (or agreed alternative to NodeRED) dashboard to
the TTN Application to display the data.
6. You will need to configure the dashboard to act as the system controller.
7. You will need to setup actuator(s) to respond to data or user input on the dashboard.
8. Tour system will send data both ways – from end device to dashboard, and from
dashboard to end device – two way communication.
-
9. You should store the collected data and also log the actuation invocation.
You will be required to produce three outputs from you work, as detailed below.
Output 1: A short video (1-2 minutes) – this must promote the concept of your loT device
and show the final product by demonstrating how it works. You should think of it as being a
video to put on a crowd-sourcing site for investment money. You need to think of the video
as a promotional film, look at kickstarter.com etc for examples of what other people have
done. Below are things you must include in the film [30 marks].
• Show the working device
• Explain the origins of the idea
•
Show the wider concept
•
Explaining the algorithm is important, explaining the process rather than the code
● Put a title screen on - this could be a piece of paper or a fully multimedia production
•
Put the credits to the work done and any references at the end.
You are welcome to use any resource available to you; this could be your laptop, smartphone
etc.
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Mini-Project v2.0 (2023-24) ICE-3501
Laboratory Exercises
Output 2: A single (or double) page A4 Infographic with technical details of the
implementation. It must give important details of the device: how the device is connected,
include components and their component codes (if they have one). Think of it as a diagram
and highlight any important features. Almost like a mini poster, it could be a handout that you
use to promote the idea at an exhibition [20 marks].
Output 3 - Evidence Portfolio: Collect evidence as you go of the work that you have
undertaken, this could be in the form of scraps of paper with notes on, photos/videos of the
activity, a journal if you prefer, you must also include your source code for the Arduino and
any datasheets that you use. Collect all these things together and zip them into an archive
that you can submit on Blackboard [50 marks].
Computer Science and Engineering, Bangor University
THE THINGS
NETWORK
Mini-Project v2.0 (2023-24)