Unit 4A - (Option A) Creating Apps with Devices - Circuit Playground ('24-'25)
In the Creating Apps for Devices unit, students explore the role of physical devices in computing. Using App Lab and Adafruit’s Circuit Playground, students develop programs that utilize the same hardware inputs and outputs that you see in the smart devices, looking at how a simple rough prototype can lead to a finished product. Then, students explore how physical devices can be used to react to the world around them using a “maker” mindset to create prototypes with everyday materials.
⚠️ This unit uses the Circuit Playground to introduce physical computing and the "maker" mindset. You can also teach this content using micro:bit devices by assigning the (Option B) Creating Apps with Devices unit. Both units teach the same content and are equivalent - you do not need to buy both sets of devices or teach both units.
Chapter 1 Overview
Description: This unit emphasizes the interactions between inputs and outputs on the circuit playground and an app screen. On their circuit playground, students learn to control inputs like buttons or toggle switches and outputs like the buzzer or LED. Students also interact with inputs and outputs in App Lab, such as buttons and text inputs and dropdowns. By the end of the chapter, students will be able to create an app that controls a device, similar to many "smart" hardware they may experience in their day-to-day lives.
Goals:
- Design and build a physical computing device that integrates physical inputs and outputs with digital apps.
- Create app prototypes that use a physical device to control a digital app.
Big Questions:
- What inputs and outputs are available on a physical device?
- What inputs and outputs are available on an app?
- How can we create apps that use a physical device to control a digital app?
Chapter 2 Overview
Description: In this chapter, students focus on how their physical device can interact with the outside world. They learn how to use sensors and the accelerometer to react to the physical environment. They learn to attach external LEDs and buttons that extend the types of devices they can make. Throughout the unit, students use physical materials like paper or cardboard to extend the functionality of their devices. By the end of the unit, students will have created an interactive art project and developed a prototype for a physical device that solves a problem.
Goals:
- Design and build a physical computing device that integrates sensors with digital apps.
- Create app prototypes that use a physical device to solve real-world problems.
- Use physical computing to solve problems in fun and innovative ways.
Big Questions:
- How can a physical device use sensors to react to a physical environment?
- How can simple hardware be used to develop innovative new products?
Implementation Guidance for Creating Apps with Devices
- This unit requires students to have access to Circuit Playground's - click here for more information about using Circuit Playground's in your classroom
- Guidance for how to support students in programming levels and differentiate tasks are available in the Programming Levels Guide and Differentiation Guide
- You can view the Implementation Guide for more information about this unit
Professional Development
If you are interested in teaching this course, we recommend completing the free Creating Apps for Devices Self-Paced Professional Development Module. The module is designed to take 2 hours to complete. No previous experience with coding or devices is assumed.
Finished Teaching This Unit?
Answer this short survey to let the Code.org curriculum team know how the unit went.
Key | Instructional Lesson Assessment Unplugged Lesson |
Make all lessons in this Unit visible or hidden for your students.
Description
This unit assumes students are already familiar with App Lab, so we recommend starting with the App Lab Hour of Code which is included below. If your students are already familiar with App Lab, you may decide to skip this lesson. Click here to learn more about skipping this lesson, allowing your classes to start right away with Creating Apps for Devices.
This unit assumes students are already familiar with App Lab, so we recommend starting with the App Lab Hour of Code which is included in this lesson. If your students are already familiar with App Lab, you may decide to skip this lesson, which requires hiding it from students in the unit overview page. Click here to learn more about hiding this lesson, allowing your classes to start right away with Physical Computing
This tutorial is designed to quickly introduce the App Lab programming environment as a powerful tool for building and sharing apps. The tutorial itself teaches students to create and control buttons, text, images, sounds, and screens in JavaScript using either blocks or text. At the end of the tutorial, students are given time to either extend a project they started building into a "Choose Your Own Adventure", "Greeting Card", or "Personality Quiz" app. They can also continue on to build more projects featured on the code.org/applab page.
Description
This unit emphasizes the interactions between inputs and outputs on the circuit playground and an app screen. On their circuit playground, students learn to control inputs like buttons or toggle switches and outputs like the buzzer or LED. Students also interact with inputs and outputs in App Lab, such as buttons and text inputs and dropdowns. By the end of the chapter, students will be able to create an app that controls a device, similar to many "smart" hardware they may experience in their day-to-day lives.
Big questions
- What inputs and outputs are available on a physical device?
- What inputs and outputs are available on an app?
- How can we create apps that use a physical device to control a digital app?
To kick off a unit devoted to problem-solving and creating apps with devices, students begin by investigating the design of different physical devices and their apps. Students look at a variety of physical designs and attempt to match each design with a potential user. Then students choose a user and attempt to prototype a physical design for them on paper or in a digital template. To conclude the activity, students consider what it means to be a physical designer and create resources for other users.
Question of the Day: How can we design apps with devices based on the needs of a user?
In this lesson students get their first opportunity to write programs that use the Circuit Playground. After first inspecting the board visually and hypothesizing possible functionalities, students move online where they will learn to write applications that control an LED and use a buzzer to make sounds. By combining App Lab screens with the Circuit Playgrounds, students can gradually start to integrate elements of the board as an output device while relying on App Lab for user input.
Question of the Day: What outputs can I control on the circuit playground?
Students should already be familiar with programming in App Lab, specifically using Design Mode to create screen elements and using onEvent
blocks to create button click events. To expand the kinds of apps that students can make, and to encourage them to think in new ways about how users interact with apps, we introduce the setProperty()
and setText()
blocks that allow users to change the properties and content of various UI elements. In this lesson students explore how they can use events to update elements on the screen
Question of the Day: How can you update design elements of an app?
This lesson transitions students from considering the Circuit Playground as strictly an output device and instead introduces the buttons and toggle switches as tools for input. Starting with the hardware buttons and switch, students learn to use onBoardEvent()
, analogously to onEvent()
, in order to take input from their Circuit Playgrounds.
Question of the Day: How can the user interact with the circuit playground for input?
In this lesson, students are introduced to variables, the counter pattern, and if-statements. Students will use these concepts in the context of programming the circuit playground and creating more complex input/output behaviors, such as counting the number of button presses before having the circuit playground make a noise. The concepts in this lesson are used to make more complex and fulfilling apps in future lessons, and students may need to refer back to the videos and examples in this lesson as they continue to master these concepts.
Question of the Day: How can I create more complex programs that keep track of information and make decisions?
In this mini-project, students will use the Circuit Playground to collect data, then use App Lab to analyze the data that was collected. This is similar to citizen science fieldwork or survey apps where a person collects data on a device "in the field", then returns to a central location to view and analyze the data (such as cataloguing endangered species in the wild). Students will use variables and events to collect data from the circuit playground, then use if-statements to make decisions or recommendations based on the data they collect.
Question of the Day: How can I use events and variables to create an app that collects and analyzes data?
In this lesson, students learn how to use the 10 color LEDs on the Circuit Playground. Students will control the color and intensity of each LED, then use what they have learned to program light patterns to create a light show on their Circuit Playground.
Question of the Day: How can you use the colored LEDs in an app?
Students learn to use several new design elements - text inputs, dropdowns, and sliders - so they can get user input from the screen of their apps. This lesson also introduces students to the getProperty and getText blocks, which allow them to access their user input in their code. Students first practice using these tools to determine what the user has input in various user interface elements. Students later use getProperty and setProperty together with the counter pattern to make elements move across the screen. A new event trigger, change, is also introduced to represent when a dropdown or slider changes values.
Question of the Day: How can we use the app screen for user input?
In this lesson, students combine inputs and outputs across both the circuit playground and the app screen. For example, students may use dropdowns or sliders to make the LEDs on the circuit playground change. Or, students may use the buttons on the circuit playground to update elements on the screen. This lesson also extends how students use variables and if-statements to make more complex decisions based on user input. There are no new coding commands or circuit playground features in this lesson, but students are combining many elements from previous lessons in new ways.
Question of the Day: How can I use inputs and outputs from both the circuit playground and the app screen?
In this project, students create an app that controls the Circuit Playground so it interacts with the physical environment around it, similar to many smart phone apps that are used to control devices in a house or car or school. Students use physical materials to help design their physical device, then create an app that lets the user interact with the physical device or change settings.
Description
In this chapter, students focus on how their physical device can interact with the outside world. They learn how to use sensors and the accelerometer to react to the physical environment. They learn to attach external LEDs and buttons that extend the types of devices they can make. Throughout the unit, students use physical materials like paper or cardboard to extend the functionality of their devices. By the end of the unit, students will have created an interactive art project and developed a prototype for a physical device that solves a problem.
Big questions
- How can a physical device use sensors to react to a physical environment?
- How can simple hardware be used to develop innovative new products?
In this lesson, students explore how the three sensors (sound, light, and temperature) can be used to write programs that respond to changes in the environment. The use of these sensors marks a transition in terms of how users interact with a program. By using sensors as an input, the user of an app doesn't have to directly interact with it at all or may interact without actually realizing they are doing so.
Question of the Day: How can I use sensors to detect changes in the environment?
In this lesson, students will explore the accelerometer and its capabilities. They’ll become familiar with its events and properties, as well as create multiple programs utilizing the accelerometer similar to those they’ve likely come across in real world applications.
Question of the Day: How can I use the accelerometer to create apps?
In this lesson students will use the buzzer to its full extent by producing sounds, notes, and songs with the buzzer. Students start with a short review of the buzzer's frequency and duration parameters, then move on to the concept of notes. Notes allow students to constrain themselves to frequencies that are used in Western music and provide a layer of abstraction that helps them to understand which frequencies might sound good together. Once students are able to play notes on the buzzer, they use arrays to hold and play sequences of notes, forming simple songs.
Question of the Day: How can I use the buzzer to play musical notes or songs?
This lesson introduces students to functions as way to organize and group repeated blocks of code together, such as changing all of the LEDs to red or blue. Then, students learn how to use parameters in their functions as a way to generalize behaviors to work for different contexts - for example, changing all the LEDs to a certain color rather than always changing them red or blue. Students will use these concepts in future lessons, and it may be necessary to return to this lesson to reference the resources and videos.
Question of the Day: How can I use functions to organize and simplify my code?
In this lesson, students create a piece of interactive artwork using the sensors on the Circuit Playground and physical materials. Students explore how the Circuit Playground can augment physical materials to create an interactive experience. This project does not use the App Lab screen except to help with debugging - otherwise, users only interact with the physical artwork itself.
In this lesson, students learn how to attach external LEDs to their circuit playground and use code to light up these LEDs. This allows students to create more flexible devices that mimic real-world products. This lesson requires several external materials, as well as safety protocols to ensure students don’t accidentally damage their circuit playground.
Question of the Day: How can I use external LEDs to create physical prototypes?
In this lesson, students learn how to connect external wires to create input events when the wires touch, simulating a button press. Students learn to use code to recognize these external button events to make changes to their app. This allows students to create more flexible devices that mimic real-world products. This lesson requires several external materials, as well as safety protocols to ensure students don’t accidentally damage their circuit playground.
Question of the Day: How can I use external buttons to create physical prototypes?
In this final project for the course, students team to develop and test a prototype for an innovative computing device based on the Circuit Playground. Using the inputs and outputs available on the board, groups will create programs that allow for interesting and unique user interactions.
Level Type | Level Status | |||||
Not started | In progress | Keep working | Needs review | Completed | Assessments / Surveys | |
Concept | Concept: Not started | Concept: In progress | N/A | N/A | Concept: Completed (perfect) | N/A |
Activity | Activity: Not started | Activity: In progress | Activity: Keep working | Activity: Needs review | Activity: Completed (perfect) | Activity: Submitted |
Level Type | Level Details | ||
Concept | Text | Video | Map |
Activity | Unplugged Lesson Extras | Online Assessment | Question Choice level |