220.127.116.11 Lab – Draw a Flowchart for Your Project (Instructor Version)
- List the project steps
- Draw the flowchart
Background / Scenario
Flowcharts are diagrams used to represent processes or workflows. Taking advantage of different shapes, boxes and connecting arrows, a flowchart represents the solution flow to a given problem. Flowcharts are commonly used to represent programs, algorithms, or any ordered process in various disciplines. Flowcharts are typically created prior to starting a process or writing an application in order to catch potential logic problems before they are implemented.
Flowcharts can be hand drawn or created using a number of packages including Microsoft Office applications, LibreOffice, GoogleDocs, and various web applications such as draw.io.
Some of the most common flowchart symbols are shown in the diagram along with the intended purpose for the symbol. Lines with arrows show the flow of the process.
Part 1: List the project steps
In a future lab activity, we will use the IoT components to record the sunrise and sunset as an event on Google Calendar. To restate the problem: Build a device that can sense the amount of light outside and decide if the sunset or the sunrise has happened. This device will take a specific action when sunrise or sunset is detected.
The basic steps to create the IoT project need to be determined in order to create a flowchart of the process.
Step 1: List the steps to complete the project.
a. Set up IFTTT (If This Then That) recipes.
b. Determine if an account exists.
c. Create an account if none exists.
d. Log into the IFTTT account.
e. Create the SunRise and SunSet recipes to record an event in Google Calendar.
f. Design and Build the Electronic Circuit to detect the light levels.
g. Create and run an application to read light levels.
h. Read the current light level.
i. Check to see if the light level exceeds the predefined threshold.
j. Trigger SunRise if the threshold is exceeded and not already triggered.
k. Wait 1 second for next reading.
l. Trigger SunSet if the previous reading detected light and not already triggered.
m. Wait 1 second for next reading.
n. Continue the loop as long as the application is running.
Part 2: Draw the Flowchart
Step 1: Create a new flowchart diagram
a. Navigate to https://www.draw.io.
b. Choose a preferred method for saving the diagram.
c. Click Create a new diagram.
d. Choose an appropriate name for the diagram.
Step 2: Select the appropriate symbols and label them on the first page.
a. From the flowchart menu, choose a Terminator symbol and set the text to Start.
c. Choose a Process symbol centering it below the Start symbol and set the text to Set up IFTTT Recipes.
d. Choose a Decision symbol centering it below the previous Process. Change the text to “Does Account Exist?”
e. Choose a Process symbol centering it below the Decision symbol. Change the text to “Log into IFTTT Account”.
f. Choose another Process symbol and center it to the left of Decision symbol. Change the text to “Create IFTTT Account”
g. Choose a Process symbol and center it below the Process to log into the IFTTT Account. Change the text to “Create SunRise/SunSet Recipes”.
h. Connect the symbols with arrows to look similar to the flowchart shown and add the text for the yes/no decisions.
i. Choose two more Process symbols changing the text to “Design & Build Circuit” and “Create & Run Application”.
j. In order to keep things readable choose an Off Page Connector and center it below the last Process symbol added and connect arrows as in the graphic.
Step 3: Complete the second page of the flowchart.
a. Start a new page with another Off Page Connector, center a Connector directly below it. The Connector will be used to start a loop within the flowchart.
b. Choose a Data symbol centering it below the previous Connector. Change the text to “Read Light Level”.
c. Choose a Decision symbol centering it below the previous Data symbol. Change the text to “Is level > Threshold?”
d. Choose two more Decision symbols centering one directly below previous Decision and the other one centered to the right. Change the text to what is shown in the diagram.
e. Choose a Predefined Process symbol and center it to the right of the Previous light detected decision symbol. Change the text as shown.
Note: The Predefined Process was selected since the recipes are already configured within IFTTT.
f. Choose a Predefined Process symbol and center it below the Same as previous reading decision symbol. Change the text as shown.
g. Choose a Process symbol and place it to the right of the Same as previous reading decision symbol. Change the text “Wait 1 second”.
h. Choose a Connector centering it below the previous Process symbol.
i. Connect all of the symbols with arrow lines as shown in the diagram and label the decisions as indicated.
Note: The Connectors are a common junction point when more than one process or decision creates the same flow. In the case of the connector above the Read Light Level data symbol it provides a starting/return point for the continuous loop. Typically processes have both a start and an end however this process will only terminate when the application is terminated or the equipment is turned off.
What is the purpose of diagraming IoT interactions?
Most people understand diagrams better than the individual steps required to solve a problem. Creating a diagram can also help people spot flaws in logic.