Day 7: The Road Back – Creating an Interactive System with Sensors and LEDs
Welcome to Day 7 of your adventure with Kai and Orion! Today, we’ll learn how to combine multiple sensors and LEDs to create an interactive system. This will help us simulate the power network as we prepare to disable the energy drain device. Let’s dive into our mission!
Learning Objectives
By the end of this lesson, you will:
- Understand different types of sensors and their applications.
- Write and upload code to integrate multiple sensors and LEDs into a circuit.
- Develop skills in creating interactive systems using sensors.
Materials Needed
- Raspberry Pi Pico W
- USB cable
- Breadboard
- Multiple LEDs
- Photoresistors
- Buttons
- Resistors (220 ohm, 10K)
- Jumper wires (Male to Male)
Story Introduction
The industrial sector was a maze of factories and warehouses, each casting long shadows in the dim light. Kai and Orion moved cautiously, their goal clear but the path fraught with challenges. The stolen
information had led them here, and they were determined to succeed.
“Orion, how do we simulate the power network?” Kai asked, determination in his voice.
Orion’s eyes glowed with purpose. “Kai, we need to create an interactive system using sensors and LEDs. This will help us understand and control the power network.”
Kai: “Sensors? How do they help us?”
Orion: “Sensors allow us to detect changes in the environment. By integrating them with LEDs, we can create a system that responds to those changes, simulating the power network.”
“Let’s get started,” Kai said, his hands already reaching for the breadboard.
Orion hovered closer, projecting a holographic display to guide Kai through the process. “First, we need to understand how different sensors work and their applications.”
Gather your materials and prepare your workspace
Kai: Arranging the components on the workbench “Okay, I’ve got everything we need. What’s next, Orion?”
Orion: Hovering near the workbench, his eyes glowing with excitement “First, we need to understand the different types of sensors and their applications. Let’s begin.”
Activity: Learn about different types of sensors and how to integrate them into circuits
Orion’s Explanation of Sensors:
“Sensors detect changes in the environment, such as light, temperature, and pressure. Today, we’ll use photoresistors and buttons to create an interactive system.”
Kai: Examining the sensors “Got it. Let’s connect them.”
Orion: “Start by placing the sensors on the breadboard.”
Activity: Connect sensors to the LED’s and breadboard
Orion’s Tutorial on Wiring the Sensors and LEDs:
Photoresistor:
- Orion: “Place the photoresistor on the breadboard, ensuring each leg is on a different row.”
- Orion: “Connect one leg of the photoresistor to a 3.3V pin on the Raspberry Pi Pico W using a jumper wire.”
- Orion: “Connect the other leg of the photoresistor to one leg of the 10K ohm resistor.”
- Orion: “Connect the other leg of the 10K ohm resistor to a ground (GND) pin on the Raspberry Pi Pico W.”
- Orion: “Connect the junction between the photoresistor and the 10K ohm resistor to an ADC pin (e.g., GPIO pin 26) on the Raspberry Pi Pico W.”
Button:
- Orion: “Place the button on the breadboard, ensuring each leg is on a different row.”
- Orion: “Connect one leg of the button to a ground (GND) pin on the Raspberry Pi Pico W using a jumper wire.”
- Orion: “Connect the other leg of the button to GPIO pin 16 on the Raspberry Pi Pico W using another jumper wire.”
LEDs:
- Orion: “Connect the anode (longer leg) of each LED to different GPIO pins on the Raspberry Pi Pico W (e.g., pins 13, 14, 15).”
- Orion: