SIT123: Data Capture Technologies Lab Report 1
Arduino Blink Activity Sheet
1. Let’s get familiar with the Arduino programming environment (IDE). This is a free software you can download and install on your computer from: https://www.arduino.cc/en/Main/Software
2. Open Arduino by double clicking (or clicking if on a Mac) the “infinity symbol.” This should bring you to a blank “sketch”.
3. Connect your Arduino board to your computer using the USB cable.
4. In Arduino, select File->Examples->Basic->Blink
5. Now you have the example ‘Blink’ loaded. This code simply switches the built-in LED light on your Arduino board on and off to give a blinking effect. Check to see if the loaded ‘Blink’ code compiles. Press the play icon named “Verify.” This will check for errors and compile your code.
6. Use the “tools” menu to check the port to which the Arduino board is connected. Once the right port is selected, it is possible to upload sketches to Arduino.
7. Now click the upload icon to upload the code to the Arduino board. If you get an error, check to be sure you’ve selected the correct device and port.
References : https://www.arduino.cc/en/tutorial/blink
Lab Report 1: Arduino Blink
Welcome to Arduino!
Arduino is an electronic prototyping platform. Different types of sensors & actuators can be attached to Arduino boards to create our own sensing-thinking-acting systems.
Throughout this unit, we will use Arduino to create different sensing devices, and to retrieve the collected sensor data.
In this task, we will try out an introductory exercise, to learn the basic concepts of Arduino.
- Arduino Board with in-built LED
- USB cable
Arduino programming environment
Here are the pre-lab materials for our first task:
- Watch TED Talk: https://www.ted.com/talks/massimo_banzi_how_arduino_is_open_sourcing_imagination#t-1114 (~15 minutes)
- Watch https://www.lynda.com/Arduino-tutorials/Exploring-your-first-sketch-Blink/197594/413709-4.html?org=deakin.edu.au (~2 minutes)
- Read this task sheet from beginning to end.
- “We have an Arduino board with an in-built LED light. We need the LED light to be turned on and off continuously, every one second.”
Task Submission Details
There are six questions in this task. Answer all of them in this word document itself and submit to unit site.
Q1: The TED talk given under the Pre-Lab materials, shows how Arduino is being used for interesting projects to capture data from the environment, process it, and use it carry out useful actions.
Fill the given table below to answer the following:
What are three projects that use captured data as given in the TED talk? What data do they capture? What sensors do you think they could use to capture this data?
Sensors to capture the data
Q2: Consider the given Task Objective. Think about how this simple system can be decomposed to ‘Sense-Think-Act’ as discussed in class (lecture).
- What is the ‘sensing’ requirement in this system, if any?
- What is the ‘thinking’ requirement in this system, if any?
- What is the ‘acting’ requirement in this system, if any?
Q3: Please refer to the provided ‘Arduino Blink Activity Sheet’ and follow the steps.
- In Arduino-speak, what is a “sketch”?
- setup() and loop() are key Arduino constructs. These are required in every Arduino sketch.
- i) Which of the above two, runs once at the very beginning of your program and never again (unless you reset or upload new code)?
- ii) Which of the above two, is used to continuously run code over and over again?
- What does pinMode() do?
- What is a comment?
- What does the following line of code do:
- There is something you need to check before uploading your sketch. What is this?
Q4: How can you test the Blink program to make sure it is working as given in the Task Objective?
Q5: Now that you have built and tested your Blink program, it is time to deliver it (hand it it over). Take a five second video of your Arduino board with the LED blinking (use your phone to record) and upload it to youtube. Include the link here. Alternatively, if you are on campus, show your working project to your tutor in the lab and get it marked.
Q6: The Morse code is a method of transmitting text information as a series of on-off lights, or clicks.
- Create a new Arduino project named ‘BlinkSOS’. Copy and paste your code from the Blink example to the newly created project. Modify the code in the new project, to send an SOS signal in Morse Code via turning the LED on and off.
Upload the ‘BlinkSOS.ino’ file with this document to cloud Deakin.
- How did you test your code to make sure it is working correctly?
- Take a video of your Arduino board running ‘BlinkSOS’ program and upload it to youtube. Include the link here. Alternatively, if you are on campus, show your working project to your lecturer/tutor in the lab and get it marked.
Hints for Q6:
SOS signal in Morse Code: https://www.youtube.com/watch?v=GnHv7h_5P9M
Use the International Morse code given here: https://en.wikipedia.org/wiki/Morse_code#/media/File:International_Morse_Code.svg
More information about Morse Code: https://en.wikipedia.org/wiki/Morse_code
Here is a sample code snippet signalling the letter ‘S’ below:
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for half a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for half a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for half a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second
Use your knowledge from the first task, and lecture to decide where the above should go in your code. You now have ‘S’. Next you must write for letters ‘O’ and again ‘S’.