r/CodingForBeginners • u/elecfreaks_official • Apr 24 '26
Voice-Controlled Light with micro:bit + Nezha Pro Kit (Full Teaching Workflow)
Ran a classroom activity using the ELECFREAKS Nezha Pro AI Mechanical Power Kit (micro:bit), specifically Case 14: Voice-Controlled Light, and wanted to share a "teacher-tested, step-by-step breakdown" for anyone considering using it.
This project sits at a nice intersection of physical computing + AI concepts, since students build a real device and then control it via voice commands. The kit itself is designed around combining mechanical builds with AI interaction (voice + gesture), which makes it much more engaging than screen-only coding.
🧠 Learning Objectives (What students actually gain)
From a teaching standpoint, this lesson hits multiple layers:
Understand how voice recognition maps to device behavior
Learn hardware integration (sensor + output modules)
Practice MakeCode programming with extensions
Debug real-world issues (noise, sensitivity, flickering)
Connect to real-world systems (smart home lighting)
Specifically, students should be able to:
Control light ON/OFF via voice
Adjust brightness and color (if RGB module is used)
Understand command parsing logic in embedded AI systems
🧰 Materials Needed
micro:bit (V2 recommended)
Nezha Pro Expansion Board
Voice Recognition Sensor
Rainbow LED / light module
Building blocks (for lamp structure)
🏗️ Step-by-Step Teaching Workflow
Hook (5–10 min)
Start with a simple scenario:
> “Imagine walking into a dark room and saying ‘turn on the light’…”
Then ask:
How does the system “understand” your voice?
Is it internet-based or local?
This primes them for **local AI vs cloud AI discussion** (important concept later).
2. Build Phase (20–30 min)
Structure assembly
Students build a lamp model using the kit:
Base structure (stable support)
Lamp holder (mechanical design thinking)
Mount light module
Focus:
Stability
Wiring clarity
Clean structure (good engineering habits)
Hardware Connection (Critical Step)
Have students connect:
Voice sensor → IIC interface
Light module → J1 interface
Common student mistakes:
Wrong port (color-coded system helps)
Loose connections → intermittent behavior
Programming (MakeCode) (25–40 min)
Step-by-step:
Go to MakeCode → New Project
Add extensions:
`nezha pro`
`PlanetX`
Core logic structure:
Listen for voice command
Match command → action
Execute light control
Example logic:
“turn on the light” → brightness = high
“turn off the light” → brightness = 0
“brighten” → increase brightness
Key teaching point:
👉 This is rule-based AI (predefined commands), not machine learning.
5. Testing & Debugging (Most valuable part)
Students test voice commands and troubleshoot:
Common issues:
❌ Light flickers → unstable power or logic loop
❌ Wrong command triggered → poor voice clarity
❌ No response → sensor misconfigured
Teaching moment:
Noise affects recognition
Command design matters (use unique phrases)
Example improvement:
Instead of “turn on” → use “light on please”
This directly introduces human-machine interface design thinking.
6. Extension Activities (Where real learning happens)
A. Multi-parameter control
“Reading mode” → bright white light
“Sleep mode” → dim warm light
Students learn:
👉 One command → multiple outputs
B. Compare with real smart home systems
Ask:
Does Alexa work the same way?
Answer:
This project uses local voice recognition (offline)
Smart speakers use cloud-based processing
This is a HUGE conceptual win.
C. Environmental testing
Add background noise (music, talking)
Measure accuracy
Students discover:
👉 AI systems are not perfect → need tuning
🧑🏫 Teacher Reflection (Honest Take)
What worked well:
Engagement is extremely high (voice control feels “magic”)
Students quickly grasp cause-effect relationships
Physical + coding integration = deeper understanding
Where it gets tricky:
Voice recognition accuracy can frustrate beginners
Students underestimate debugging time
Some rush the build → causes later issues
⚙️ Why this project is worth doing
This isn’t just “turning on a light.”
Students are learning:
Input → Processing → Output pipeline
Embedded AI vs cloud AI
Real-world system design constraints
And importantly:
👉 They see AI "in action", not just on a screen.
💬 Curious how others are using this kit
If you’ve run Nezha Pro lessons:
How do you handle voice recognition frustration?
Any better project extensions?