← Back to Hub
Teacher's Hands-On Companion Guide
AI & IoT Training Camp
PictoBlox Machine Learning, Arduino UNO, ESP32 & Sensor Integration
6 Days
24 Sessions
60 Participants
10 Groups
Table of Contents
DAY 1: Introduction to AI & Image Processing Integration
Session 1 — Group Formation & Arduino UNO Hardware Introduction
Session 2 — Image Classifier: Data Collection & Model Training
Session 3 — Servo Motor & Buzzer Wiring on Arduino Shield
Session 4 — Full If-Else Integration: AI Model to Physical Output
DAY 2: Audio & Pose (Body Movement) Models
Session 1 — Audio Classification: Voice Command Model Training
Session 2 — Relay & Water Pump Control via Voice Commands
Session 3 — Introduction to Pose (Body) Classifier: 17 Keypoints
Session 4 — Proportional Servo Control via Hand Y-Coordinate (Map)
DAY 3–4: ESP32 & Blynk IoT Cloud
→ See separate document: ESP32 & Blynk IoT Teacher's Guide
DAY 5: Full-Day Hackathon — Project Development
Sprint 1 — Data Collection & Sensor Wiring
Sprint 2 — AI Model Training & Physical Prototype Build
Sprint 3 — Software-Hardware Integration & Testing
Sprint 4 — Final Polish & Elevator Pitch Rehearsal
DAY 6: STEM Integration, Presentations & Closing
Session 1 — STEM Lesson Plan: Adapting Projects to School Curriculum
Session 2 — Group Presentations (Groups 1–5) with Live Demos
Session 3 — Group Presentations (Groups 6–10) & Q&A
Session 4 — Closing Ceremony: Evaluation & Certificates
DAY 1
Introduction to AI & Image Processing Integration
DAY 1 · SESSION 1
Group Formation & Arduino UNO Hardware Introduction
Groups of 6 participants are formed. The Arduino UNO board and Sensor Shield V5.0 are introduced. Participants learn the VCC, GND, and Signal (S) pin architecture, understanding how sensors and actuators connect to the shield.
Hardware Required
Arduino UNO
USB Cable (Type-A to Type-B)
Sensor Shield V5.0
Step-by-Step Instructions
1
Distribute one Arduino UNO board and one Sensor Shield V5.0 per group (6 people). Have participants mount the Sensor Shield directly onto the Arduino UNO by aligning the pins and pressing firmly until seated. The shield provides organized 3-pin (V/G/S) headers for every Arduino pin.
2
Explain the three-pin architecture on the Shield. Each pin header has three connections: V (VCC) = 5V power supply (red wire), G (GND) = Ground/negative terminal (black wire), S (Signal) = Data pin that communicates with the Arduino (green/yellow wire). This eliminates the need for complex breadboard wiring.
3
Connect the Arduino UNO to the computer using a USB cable. Open PictoBlox (desktop version). In the top menu, go to Board → Arduino Uno. Click Connect and select the correct port (COM port on Windows, /dev/tty on Mac). The connection icon will turn green when successful.
4
Assign group roles: Team Leader (coordination & presentation), Hardware Specialist (wiring & calibration), Software/AI Specialist (model training & block coding), Tester (debugging & quality assurance). Remaining members rotate between roles. Record roles on the Group Card template.
Tip: Verify each group's Arduino connection before moving to Session 2. If the port does not appear, reinstall the CH340/CP2102 USB driver for your operating system.
DAY 1 · SESSION 2
Image Classifier: Data Collection & Model Training
Using PictoBlox's Machine Learning Environment, groups create an Image Classifier project with at least 3 classes: "Dangerous Object", "Safe Object", and "Background". Data is collected via webcam and the model is trained and tested.
Hardware Required
Computer with Webcam
Various Physical Objects (pen, scissors, phone, etc.)
Step-by-Step Instructions
1
In PictoBlox, go to Files → Open ML Environment. Click "Create New Project". Enter a project name (e.g., "Safety Detector") and select "Image Classifier" as the model type. Click "Create Project". Two default class cards will appear.
2
Rename the classes by clicking the edit icon on each card. Create three classes: "Dangerous_Object", "Safe_Object", and "Background". To add a third class, click the "Add Class" button. Use names without spaces (underscores are fine) — this will be the exact label used in block coding later.
3
For each class, click the "Webcam" icon on the class card. Your camera will activate. Press and hold the "Hold to Record" button while showing the relevant object to the camera. Show the object from multiple angles (front, left, right, top) and under varying lighting conditions. Collect at least 200 samples per class. For the "Background" class, record with an empty desk/background only.
4
Once all classes have sufficient data, click "Train Model". Monitor the Accuracy and Loss graphs during training. Accuracy should approach 1.0 (100%), and Loss should approach 0. After training completes, switch to the "Test" tab and verify the model by showing objects to the webcam in real time. Check that the correct class is predicted with a confidence score above 80%.
Warning: The ML Environment is only available in the desktop version of PictoBlox (Windows/macOS/Linux). It will not work in the web/browser version.
DAY 1 · SESSION 3
Servo Motor & Buzzer Wiring on Arduino Shield
Participants wire a Servo Motor and an Active Buzzer module onto the Sensor Shield. The trained image recognition model is then tested on the PictoBlox Stage to verify camera input works correctly before full integration.
Hardware Required
Arduino UNO with Shield (from Session 1)
SG90 Servo Motor
Active Buzzer Module
Wiring Table
| Component | Wire Color | Shield Pin | Notes |
| Servo Motor | Brown → G (GND) | Pin 9 (PWM) | Must use a PWM pin (3, 5, 6, 9, 10, 11) |
| Red → V (5V) |
| Orange → S (Signal) |
| Buzzer | Black → G (GND) | Pin 10 | Active buzzer: HIGH = sound, LOW = silent |
| Red → S (Signal) |
Step-by-Step Instructions
1
Connect the SG90 Servo Motor to the Shield. Align the 3-pin connector: Brown wire → G (GND), Red wire → V (5V), Orange wire → S (Signal). Plug into the Pin 9 header on the Shield. Pin 9 is a PWM-capable pin required for servo control.
2
Connect the Active Buzzer Module to the Shield on Pin 10. The buzzer module typically has two pins: S (Signal) → Pin 10 S and GND → Pin 10 G. Some modules have 3 pins (VCC is also needed — connect to Pin 10 V).
3
In PictoBlox, ensure Arduino Uno is connected. Switch to Stage Mode (toggle in the top-right area). Click "Upload Firmware" to enable real-time communication between PictoBlox and the Arduino. Test the servo by dragging a set servo on pin (9) to (90) degrees block from the Actuators palette and clicking it — the servo should rotate to 90°.
4
Go back to the ML Environment, click "Export Model" to load your trained model into the block coding environment. New ML blocks will appear in the left palette. Drag a turn video on stage with (0)% transparency block, followed by analyze image from (webcam) inside a forever loop. Run the script (click green flag) to verify the camera feed and classification work in Stage Mode.
DAY 1 · SESSION 4
Full If-Else Integration: AI Model to Physical Output
The complete integration is built using If-Else logic: when the camera detects a "Dangerous Object", the buzzer sounds and the servo rotates to 180°. When a "Safe Object" is detected, the servo stays at 0° and the buzzer is silent.
Hardware Required
Complete Setup from Sessions 1–3
Step-by-Step Instructions
1
Create the main script. Start with when green flag clicked from Events palette. Add turn video on stage with (0)% transparency to activate the camera. Then add a forever loop from Control palette.
2
Inside the forever loop, add analyze image from (webcam) from the Machine Learning palette. This block processes each video frame through your trained model. Below it, add an if-else block from Control.
3
Set the If condition: drag is identified class (Dangerous_Object) from the ML palette into the hexagonal condition slot. Inside the IF branch: add set servo on pin (9) to (180) degrees and set digital pin (10) output as (HIGH) (buzzer ON). Inside the ELSE branch: add set servo on pin (9) to (0) degrees and set digital pin (10) output as (LOW) (buzzer OFF).
4
Click the green flag to run the system. Show different objects to the camera and verify: Dangerous object → servo rotates to 180°, buzzer sounds. Safe object or background → servo at 0°, buzzer silent. If false positives occur (wrong classification), return to the ML Environment, add more training data for the problematic scenario, retrain the model, and export again.
Tip: To reduce jitter on the servo, add a wait (0.1) seconds block after the servo command inside the loop. This prevents the servo from receiving too many rapid commands.
DAY 2
Audio & Pose (Body Movement) Models with Interaction
DAY 2 · SESSION 1
Audio Classification: Voice Command Model Training
Groups train an Audio Classifier model in PictoBlox's ML Environment. To manage noise in a 60-person workshop, groups record commands one at a time in a quiet area. Classes include "Water" (Sula), "Stop" (Dur), and "Background Noise".
Hardware Required
Computer with Microphone (built-in or webcam mic)
Step-by-Step Instructions
1
In PictoBlox, go to Files → Open ML Environment → Create New Project. Enter a project name and select "Audio Classifier". Click "Create Project". The Audio Classifier interface opens with two default class cards.
2
Rename the first class to "Background". With the room quiet (or at normal ambient noise level), click the "Microphone" button and record for at least 20–30 seconds. The recording is automatically split into 1-second segments and displayed as spectrograms. This teaches the model what "silence" or "ambient noise" sounds like.
3
Add two more classes: "Water" and "Stop". For each class, have group members take turns speaking the command clearly into the microphone. Vary: tone (loud, soft), speed (fast, slow), distance (close, farther), and speakers (different voices). Aim for at least 40 samples per command class. Each sample appears as a spectrogram strip.
4
Click "Train Model". Monitor the accuracy graph — it should approach 1.0. After training, switch to the "Test" tab and speak commands into the microphone. The system should correctly identify each command with confidence above 80%. If "Water" is confused with "Stop", record more distinct samples and retrain.
Important: Groups should record commands one group at a time or in a separate quiet space. Cross-contamination from other groups' audio will degrade model accuracy significantly.
DAY 2 · SESSION 2
Relay & Water Pump Control via Voice Commands
A 5V Relay module and a DC water pump (or strong DC motor) are introduced. Voice commands trigger the relay to turn the pump on and off. Participants learn power electronics isolation concepts.
Hardware Required
Arduino UNO with Shield
5V Relay Module
Mini DC Water Pump (3–6V)
External Battery Pack (4×AA or 9V)
Jumper Wires
Small Water Container
Wiring Table
| Component | Connection | Arduino Pin | Notes |
| Relay Module — VCC | → Shield V (5V) | Pin 7 | Relay IN pin triggers the switch |
| Relay Module — GND | → Shield G (GND) |
| Relay Module — IN | → Shield S (Signal) |
| Pump (+) | → Relay NO terminal | — | Pump powered by external battery, NOT Arduino |
| Pump (−) | → Battery (−) | — |
| Battery (+) | → Relay COM terminal | — | External power source for pump |
Step-by-Step Instructions
1
Wire the relay module to the Arduino Shield on Pin 7: VCC → V, GND → G, IN → S. The relay's high-voltage side has three terminals: COM (Common), NO (Normally Open), NC (Normally Closed). Connect the external battery (+) to COM, and the pump (+) wire to NO. Connect the pump (−) directly to the battery (−).
2
Export the Audio Classifier model to the block coding environment. The ML palette will show new audio-specific blocks: open recognition window, when () is predicted, and get recognized class.
3
Create Script 1: drag when green flag clicked → open recognition window. This opens a small window that shows real-time spectrogram analysis. Create Script 2: drag when (Water) is predicted → set digital pin (7) output as (HIGH). This triggers the relay when the "Water" command is recognized. Create Script 3: drag when (Stop) is predicted → set digital pin (7) output as (LOW).
4
Ensure Arduino is in Stage Mode with firmware uploaded. Click the green flag. Say "Water" — the relay should click and the pump starts. Say "Stop" — the relay releases and the pump stops. Test multiple times with different speakers.
Safety Warning: NEVER power the water pump directly from the Arduino 5V pin. The pump draws more current than the Arduino can supply, which can permanently damage the board. Always use an external battery through the relay.
DAY 2 · SESSION 3
Introduction to Pose (Body) Classifier: 17 Keypoints
The camera detects 17 reference points on the human body. Groups train a Pose Classifier to recognize poses like "Hands Up", "Leaning Right", and "Neutral Standing".
Hardware Required
Computer with Webcam
Step-by-Step Instructions
1
In PictoBlox, go to Files → Open ML Environment → Create New Project. Select "Pose Classifier". The interface activates the webcam and overlays 17 keypoints (joints) on the detected body: nose, eyes, ears, shoulders, elbows, wrists, hips, knees, ankles.
2
Create at least 3 classes: "Hands_Up" (both arms raised above head), "Lean_Right" (body tilted right), and "Neutral" (standing normally). For each class, stand in front of the camera in the correct pose and click "Hold to Record". Vary the position slightly between samples. Collect at least 100 samples per class.
3
Click "Train Model". After training, check the accuracy graph. You can optionally open "Train Advance" to adjust hyperparameters: Epochs (increase to 20–50 for better accuracy) and Batch Size (default is usually fine). Retrain if accuracy is below 90%.
4
Switch to the "Test" tab. Stand in front of the camera and perform each pose. The model should correctly identify the pose with high confidence. Note: The keypoint overlay should be visible on your body. If detection is poor, ensure good lighting and that your full upper body is visible in the frame.
Tip: Enable the "keypoints" visualization block when testing. This draws the 17 skeleton points on the stage, helping participants understand how the model "sees" the body.
DAY 2 · SESSION 4
Proportional Servo Control via Hand Y-Coordinate (Map Logic)
Instead of simple on/off classification, the right hand's Y-coordinate value is read from the camera and mathematically mapped (Map function) to proportionally control the servo motor angle from 0° to 180°.
Hardware Required
Arduino UNO with Shield & Servo Motor (Pin 9)
Computer with Webcam
Step-by-Step Instructions
1
In PictoBlox block coding, click the "Add Extension" button (bottom-left, purple icon). Search for and add the "Human Body Detection" extension. This extension provides blocks to track individual body part X/Y coordinates (different from the Pose Classifier which classifies whole poses).
2
Create the script: when green flag clicked → turn video on stage with (0)% transparency → forever loop containing analyze image from (webcam). This continuously tracks your body. Inside the loop, add a set [hand_y] to (y position of [right wrist]) block (create a variable called "hand_y").
3
The stage coordinate range is Y: −180 to +180. We need to map this to servo range 0° to 180°. Use Operators palette math blocks to create the mapping formula: set [servo_angle] to (((hand_y + 180) / 360) × 180). This converts the Y position proportionally to a servo angle.
4
Add set servo on pin (9) to (servo_angle) degrees inside the forever loop. Add wait (0.05) seconds to reduce servo jitter. Run the script — as you raise your right hand, the servo should smoothly rotate upward. Lower your hand and the servo returns. This demonstrates proportional (analog) control rather than simple on/off.
Key Concept (Map Logic): Mapping converts one range of values to another. Formula: mapped = ((value − input_min) × (output_max − output_min)) / (input_max − input_min) + output_min. In PictoBlox, you can also look for a map () from () - () to () - () block in the Arduino palette if available.
DAY 3–4
ESP32 & Blynk IoT Cloud
📘 Updated Curriculum Available
Day 3 & 4 sessions have been fully migrated to the ESP32 + Blynk IoT Cloud platform.
All lesson plans, wiring tables, code examples, and session pacing are covered in the dedicated guide.
Open IoT Teacher's Guide →
Open Student Portal →
DAY 5
Full-Day Hackathon — Project Development
DAY 5 · SPRINT 1
Data Collection & Sensor Wiring
Groups begin building their hackathon projects. This sprint focuses on collecting AI training data (images, audio, or poses) and wiring all sensors/actuators according to the architecture diagram from Day 4 Session 4.
Sprint Objectives
1
AI Data Collection: Open the ML Environment and create the project for their chosen classifier type (Image, Audio, or Pose). Begin collecting training samples. Target: minimum 150 samples per class for Image, 40 samples per class for Audio, 100 samples per class for Pose. More samples = better accuracy.
2
Hardware Wiring: Using the architecture diagram, wire all sensors and actuators. Verify each component individually before connecting everything together. Test each sensor reading independently — does the DHT11 return real values? Does the servo move? Does the buzzer sound?
3
Checkpoint: By the end of Sprint 1, each group should have: (A) raw training data collected for all classes, (B) all hardware wired and individually tested, (C) no hardware errors or loose connections. Flag any hardware defects to the instructor immediately.
Instructor Tip: Circulate between groups every 10 minutes. Common Sprint 1 issues: insufficient training data, wrong pin connections, dead batteries for pump/relay circuits. Keep spare components ready.
DAY 5 · SPRINT 2
AI Model Training & Physical Prototype Build
AI models are trained and tested. Simultaneously, the physical prototype structure (if any — e.g., cardboard housing, model farm setup) is built around the hardware.
Sprint Objectives
1
Train the AI Model: Click "Train Model" in the ML Environment. Monitor the accuracy graph. If accuracy is below 85%, go back and add more diverse training data. Common fixes: add more "Background" class samples, ensure consistent lighting during data collection, remove blurry/low-quality samples.
2
Test and Iterate: Use the Test tab to verify the model in real-time. Test edge cases: What happens with partial occlusion? What about different lighting? If the model fails on certain inputs, add those specific scenarios to the training data and retrain. Repeat until satisfied.
3
Export the Model: Once accuracy is satisfactory, click "Export Model". The ML blocks will load into the block coding environment. Verify by checking that the ML palette shows your class names.
4
Physical Build: If the project has a physical enclosure (e.g., a model greenhouse, a security booth), begin construction using available materials (cardboard, tape, containers). Mount sensors in appropriate positions.
DAY 5 · SPRINT 3
Software-Hardware Integration & Testing
The trained AI model is connected to the hardware through PictoBlox block coding. The complete system (sensor → AI → actuator) is tested end-to-end.
Sprint Objectives
1
Build the Main Script: Combine the AI model blocks with the sensor reading blocks and actuator control blocks. Follow the architecture diagram: Input → Processing → Output. Ensure the forever loop includes all analysis and decision blocks in the correct order.
2
End-to-End Testing: Run the complete system. Does the camera correctly classify? Do the sensors return valid readings? Do the actuators respond correctly to the combined decisions? Document any bugs or unexpected behaviors.
3
Debug and Fix: Common integration issues: (A) Servo jitter — add wait (0.1) seconds, (B) Wrong pin numbers — double-check wiring against code, (C) AI model not predicting — ensure analyze image from block is inside the loop, (D) Sensor readings are 0 — check VCC/GND connections and firmware upload.
4
Checkpoint: By the end of Sprint 3, the MVP (Minimum Viable Product) must be functional. The system should demonstrate the core input-processing-output loop at least once without errors.
DAY 5 · SPRINT 4
Final Polish & Elevator Pitch Rehearsal
Final testing, edge case handling, and presentation preparation. Groups rehearse a 5-minute "elevator pitch" that demonstrates their project.
Sprint Objectives
1
Edge Case Handling: Test the system under non-ideal conditions. What happens when no face is visible? When the room is very noisy? When two people are in frame? Add fallback logic (else branches) for graceful degradation rather than system freezes.
2
Stage Feedback: Add visual feedback on the PictoBlox Stage: sprite costume changes, background color changes, or text messages that explain what the system is doing. This makes demos more visually engaging for the audience.
3
Prepare Presentation: Structure the 5-minute demo: (1) Problem statement — what real-world issue does your project solve? (2) System overview — show the architecture diagram. (3) Live demo — run the system and explain each step. (4) Challenges and learnings. (5) Future improvements.
4
Rehearse: Run through the full presentation at least twice. Test the live demo before the rehearsal — ensure all hardware is working. Assign speaking roles: who explains the AI? Who demonstrates the hardware? Who discusses the results?
Instructor Note: Set a hard stop at the end of Sprint 4. No further code changes after this point. If a project is not fully functional, guide the group to present what they have and discuss what they would improve with more time.
DAY 6
STEM Integration, Presentations & Closing Ceremony
DAY 6 · SESSION 1
STEM Lesson Plan: Adapting Projects to School Curriculum
Participants (as educators) learn how to integrate the AI & IoT concepts from this training into their school curriculum. They create draft lesson plans that align with Science, Mathematics, and ICT/Computing subject areas, making these activities classroom-ready.
Step-by-Step Instructions
1
Subject Mapping Discussion: Present how training activities align with STEM subjects: Science (sensors measure physical phenomena — temperature, light, gas), Technology (AI models, IoT communication, block coding), Engineering (circuit design, system architecture, troubleshooting), Mathematics (data range mapping, probability/confidence scores, analog-to-digital conversion).
2
Each group selects one activity from Days 1–4 and writes a 45-minute lesson plan targeting their specific subject/grade level. The plan should include: Learning Objectives, Materials Needed (simplified kit), Step-by-Step Procedure (simplified from this guide), Assessment Criteria, and Safety Notes.
3
Simplification Strategy: Workshop activities use multiple sensors and complex logic. For a classroom setting, focus on one concept per lesson: e.g., "Image Classifier + Servo" is one lesson; "DHT11 reading + display" is another. Do not try to combine everything into one class period.
4
Groups share their lesson plan drafts with the room (2 minutes each). Other groups provide peer feedback: Is it achievable in 45 minutes? Are the learning objectives clear? Is the assessment method practical? Collect all lesson plans for the final documentation package.
DAY 6 · SESSION 2
Group Presentations (Groups 1–5) with Live Demos
The first five groups present their hackathon projects. Each group has 5 minutes for presentation + live demo, followed by 2 minutes of Q&A from peers and instructors. Rubric-based evaluation is conducted.
Presentation Structure
1
Presentation Format (5 min): (1) Problem statement and motivation (30 sec), (2) System architecture overview (1 min), (3) Live demo — run the system and explain the AI+sensor+actuator interaction (2 min), (4) Challenges faced and how they were solved (1 min), (5) Future improvements and real-world applications (30 sec).
2
Q&A (2 min): Audience and instructors ask questions. Encourage technical questions: "Why did you choose that sensor?", "What was your model's accuracy?", "What happens when X fails?" and design questions: "How would you scale this to a real building?"
3
Evaluation Rubric (per group): Innovation & Creativity (25%), Technical Complexity — AI + hardware integration (25%), Working Demo — does it function live? (25%), Presentation Quality — clarity, teamwork, Q&A handling (25%). Total: 100 points.
Logistics: Pre-test each group's hardware 10 minutes before their slot. Have a backup plan (recorded video) if live demo fails. Ensure consistent WiFi for groups using Face Detection extension.
DAY 6 · SESSION 3
Group Presentations (Groups 6–10) & Q&A
The remaining five groups present. Same format as Session 2. After all presentations, a brief peer-voting round determines audience favorites.
Step-by-Step Instructions
1
Groups 6–10 present following the same 5+2 minute format. Ensure the evaluation rubric is consistently applied by all evaluators (instructors and designated peer reviewers).
2
Peer Voting: After all presentations, each participant votes for their favorite project (they cannot vote for their own group). Categories: "Most Innovative", "Best Technical Implementation", "Best Presentation". Votes are collected on paper or by show of hands.
3
Feedback Round: Instructors provide brief collective feedback — common strengths observed across projects, recurring technical issues, and suggestions for improvement. Highlight exceptional debugging strategies or creative problem-solving approaches from specific groups.
DAY 6 · SESSION 4
Closing Ceremony: Evaluation & Certificates
Final instructor evaluation, sustainability discussion (how to continue learning), award announcement, certificate distribution, and program feedback collection.
Step-by-Step Instructions
1
Awards Ceremony: Announce results: (A) Top 3 Overall Projects (based on rubric scores), (B) Peer-voted awards: Most Innovative, Best Technical, Best Presentation, (C) Any special mentions (most improved team, best teamwork, creative use of sensors).
2
Sustainability & Next Steps: Share resources for continued learning: PictoBlox Download (thestempedia.com/product/pictoblox), STEMpedia Community Projects (ai.thestempedia.com/community-project), Codeavour Competition (codeavour.org). Discuss how to set up a school AI/IoT club.
3
Certificates: Distribute completion certificates to all 60 participants. Certificates should include: participant name, training title ("AI & IoT Training Camp"), dates, organizer logo, and instructor signature. Group winners receive additional award certificates.
4
Feedback Collection: Distribute a short feedback form (5 questions): (1) Which day was most valuable? (2) Which activity was most challenging? (3) Did you feel confident to teach these concepts in your classroom? (4) What additional topics would you like to learn? (5) Overall rating (1–5). Collect all forms before closing.
Final Note: Take a group photo of all participants. Ensure all hardware kits are returned, inventoried, and packed correctly. Collect all USB cables, sensors, and boards. Save all PictoBlox project files (.sb3) to a shared USB drive for participants to take home.