Day 14: Potentiometer - Analog Input
Mission Status: Critical Enhancement Protocol
The amber glow of your workstation flickers as you review yesterday's security system test logs. Functional, yes. But in the depths of space, functional isn't enough. Your ship's AI has been monitoring alien transmission patterns, and the complexity is increasing. Basic beeps and single-color warnings won't cut it when faced with the sophisticated communication protocols you're detecting.
You slide the RGB LED module across your workbench. Its rainbow potential represents something more than pretty lights. This is about creating an intuitive language between human and machine, a visual vocabulary that speaks instantly to your survival instincts. Green for safety, red for danger, blue for processing. Universal signals that transcend species and star systems.
The security panel hums quietly, its keypad waiting. Soon it will sing with purpose. Each button press will trigger a cascade of coordinated feedback. Sound and light working in harmony to guide you through critical procedures, even when your oxygen-deprived brain struggles to process complex information. This isn't just an upgrade. It's a lifeline wrapped in code.
Outside your viewport, distant stars pulse with their own ancient rhythms. Today, you'll create your own constellation of signals. Time to transform your basic buzzer into a symphony of survival.
What You'll Master Today
When you complete this lesson, you'll be able to:
- Integrate RGB LED feedback with your keypad security system
- Create custom audio-visual feedback functions that work in harmony
- Manage PWM pin requirements when adding new components
- Design intuitive color-coded status indicators for complex systems
- Coordinate multiple output devices to create rich user experiences
- Handle the technical challenge of PWM and tone() function conflicts
Understanding Multi-Device Feedback Systems
Think about the dashboard in a car. When you put on your turn signal, you don't just get a blinking light. You get a rhythmic clicking sound, a visual indicator on the dashboard, and often a light on the steering wheel. This redundant feedback system ensures you know what's happening even when your attention is divided.
Your security panel needs the same level of communication sophistication. A single beep tells you a button was pressed, but it doesn't tell you if that press was correct, if you're in PIN entry mode, or if the system just granted or denied access. By combining audio tones with color-coded light feedback, you create a rich communication channel between human and machine.
The challenge lies in coordination. Each device speaks its own language. Your buzzer understands frequency and duration. Your RGB LED understands red, green, and blue intensity values. Your job is to become the translator, creating functions that speak both languages simultaneously and meaningfully.
This coordination becomes critical in high-stress situations. When emergency protocols activate, you need feedback that's immediate, intuitive, and impossible to misinterpret. Green means go, red means stop, blue means wait. These aren't just pretty colors. They're a universal language of safety that works even when complex thinking shuts down under pressure.
Critical Wiring Changes
This lesson builds on Day 13's wiring, but adding the RGB LED forces us to move some existing connections. Here's why:
- PWM Pin Requirements: RGB LEDs need Pulse Width Modulation pins (marked with ~ on your board) to control brightness and color mixing
- Pin Shortage: Day 13 used PWM pins 9 and 10, leaving only pin 11 available. We need three PWM pins for RGB control
- Solution: Move the keypad wire from pin 9 to pin 13, and move the buzzer from pin 10 to pin 12
- RGB Connections: Red to pin 11, Green to pin 10, Blue to pin 9 (all through 330Ω resistors)
- Pin 13 Note: This pin blinks during code uploads, so avoid connecting the buzzer here (unless you enjoy upload sounds!)

Code Architecture: Pin Definitions and Setup
First, we establish our new pin assignments and prepare the RGB LED for operation:
// Updated pin assignments to accommodate RGB LED
const byte ROW_PINS[ROWS] = { 5, 4, 3, 2 };
const byte COL_PINS[COLS] = { 6, 7, 8, 13 }; // Pin 9 moved to 13
const byte BUZZER_PIN = 12; // Pin 10 moved to 12
// RGB LED pins - all PWM capable
const byte RED_PIN = 11;
const byte GREEN_PIN = 10;
const byte BLUE_PIN = 9;This is lesson 15 of 31 in 30 Days Lost in Space — a professionally produced Arduino course taught by Dr. Greg Lyzenga (NASA JPL scientist, Harvey Mudd professor). Each lesson features cinematic-quality video produced with a 20-30 person professional crew.
All video lessons are free to watch. Get the kit at craftingtable.com — $100 with a 30-day money-back guarantee.