Intelligent Control Design and Production - Program Reference
This section provides program references for circuit building exercises using the Steamania JoyKit V2. Each project includes:
- Project Objectives: Clear learning goals
- Required Hardware: List of electronic modules needed
- Core Tasks: Key programming challenges
- Reference Solution: Complete program code with explanations
Available Projects
Project 1: Indoor Temperature Monitoring System
Objective: Build a temperature monitoring system using a temperature sensor and full-color LED. The LED color changes with temperature (from green to red as temperature increases).
Required Hardware:
- Steamania JoyKit V2 (Main Controller)
- BME280/BMP280 Temperature & Humidity Sensor Module
- WS2812B Full-Color LED Module
Core Tasks:
- Enable temperature sensor module
- Continuously read temperature data
- Map temperature values to LED colors (green → yellow → red)
- Display real-time temperature on screen
Key Concepts:
- Sensor data acquisition
- Conditional logic for color mapping
- RGB color control
- Loop structures
Project 2: Simulated Indoor Lighting Circuit
Objective: Simulate a light switch using buttons and a full-color LED.
Required Hardware:
- Steamania JoyKit V2 (Main Controller)
- Push Button Module
- WS2812B Full-Color LED Module
Core Tasks:
- Configure button as digital input
- Implement toggle logic (press to switch on/off)
- Control LED to emit white light when "on"
- Display current switch status
Key Concepts:
- Digital input reading
- State machine / toggle logic
- Edge detection (button press vs. hold)
- Binary state control
Project 3: Simulated Community Street Light System
Objective: Build an automatic street light system using a light sensor and 4 full-color LEDs (blue light). The system automatically adjusts the number of lit LEDs based on ambient light intensity (darker = more LEDs on) and displays real-time sensor values.
Required Hardware:
- Steamania JoyKit V2 (Main Controller)
- TCS34725 Color Sensor (for ambient light detection)
- 4x WS2812B Full-Color LED Modules (configured as blue street lights)
Core Tasks:
- Read ambient light intensity from sensor
- Implement multi-level threshold logic
- Control 4 LEDs independently based on light level
- Display real-time sensor values on screen
- Automatically adjust LED count (0-4 LEDs)
Key Concepts:
- Analog/digital sensor reading
- Multi-level conditional branching
- Array-like control of multiple outputs
- Real-time data visualization
- Threshold-based automation
Project 4: Digital Calendar
Objective: Build a digital calendar using buttons and a 4-digit 7-segment display. Initially display "0000", and switch between displaying the year "2026" and the month-day "0131" by pressing a button, cycling continuously.
Required Hardware:
- Steamania JoyKit V2 (Main Controller)
- 4-Digit 7-Segment Display Module
- Push Button Module
Core Tasks:
- Initialize 7-segment display to show "0000"
- Implement button press detection
- Toggle between year display mode (2026) and month-day display mode (0131)
- Continuously cycle through display modes
Key Concepts:
- Multi-digit 7-segment display control
- State management
- Button debouncing
- Display mode switching
Project 5: Voice-Controlled Electronic Candle
Objective: Design a voice-controlled candle using a sound sensor, full-color LED, and music module. The LED defaults to flashing green light. Blow once to switch to flashing red light (simulating lighting). Blow again to extinguish the LED and play music (at least three notes), then remain extinguished, simulating blowing out the candle. The process cycles.
Required Hardware:
- Steamania JoyKit V2 (Main Controller)
- Sound Sensor Module (Microphone)
- WS2812B Full-Color LED Module
- Buzzer/Music Module
Core Tasks:
- Initialize LED to flash green light (default state)
- Detect sound trigger (blowing air)
- Switch to red flashing mode on first blow (candle lit)
- Detect second blow to extinguish LED and play music
- Cycle through all states continuously
Key Concepts:
- Sound detection and triggering
- State machine with multiple modes
- LED flashing patterns
- Music playback integration
Project 6: Smart Curtain
Objective: Design a smart curtain system using a motor, driver module, and multiple sensors (buttons, remote control, voice, etc.). Includes three sub-tasks: 1) Button control for forward/reverse rotation for 1 second; 2) Remote control long-press for forward/reverse (stop when released); 3) Voice commands for forward/reverse rotation for 1 second. Encourage implementing multiple tasks with a single program.
Required Hardware:
- Steamania JoyKit V2 (Main Controller)
- DC Motor Module
- Motor Driver Module (L298N or similar)
- Push Button Module (2 buttons: forward/reverse)
- IR Remote Control Module
- Voice Recognition Module (optional)
Core Tasks:
- Button control: Press buttons to control forward/reverse rotation for 1 second
- Remote control: Long-press remote buttons for forward/reverse (stop when released)
- Voice control: Voice commands control forward/reverse rotation for 1 second
Key Concepts:
- Motor forward/reverse control
- Multiple input methods integration
- Human-computer interaction diversity
- Input priority handling
How to Use These Projects
For Students:
- Read the project requirements carefully
- Plan your circuit connections first
- Try to write the program yourself before looking at the solution
- Test and debug incrementally
- Experiment with modifications (e.g., different color schemes, thresholds)
For Instructors:
- Use these as lab exercises or homework assignments
- Modify parameters to create variations (e.g., different temperature ranges)
- Combine multiple projects for more complex challenges
- Encourage students to add creative features
Prerequisites
Before attempting these projects, students should be familiar with:
- Basic JoyKit programming (reading/writing registers)
- Digital I/O configuration
- Understanding of hexadecimal numbers
- Basic conditional jump instructions
Next Steps
Choose a project to start with, or explore them in order of increasing complexity:
- Temperature Monitor - Beginner friendly
- Light Switch - Intermediate
- Street Light System - Advanced