Questions for Students:
- What project are you planning to work on? Laser Harp? Optical Music Box?
- What is the Minimum Viable Product? (https://www.engineeringdesignworkshop.com/minimum-viable-product.html )
- Who is working on the project? Students are encouraged to work in groups
- Download the Arduino IDE ( Integrated Development Environment) and install it on their own computers. Watch the intro video at https://youtu.be/zfp0IJoXcFg
- Bring laptops to next week’s class.For next week:
- Laser Diodes
- IR Sensors
- Microcontroller
- MIDI Board
- Speakers
- Power Supply
- Paper transport for Music Box
- Laser Harp Frame
Lab activities:
- Sensor lab:
- IR Reflective sensor- how they work; adjustments (https://eca790.blogspot.com/p/building-custom-optical-music-box.html )
- Laser Diodes + Photo-resistive sensor- how they work
- MIDI (https://eca790.blogspot.com/p/midi-musical-instrument-digital.html )
- Intro to Arduino- Blink, Analog Read
-----------------------------------------------------------------------------------
AI-generated Course Overview & Prerequisites
- Target Audience: Freshmen
- Duration: 4 sessions (approximately 90–120 minutes each).
- Core Concepts: Voltage dividers, analog sensing, sound generation (tone() vs. MIDI), conditional logic, and physical alignment.
- Hardware Kit (Per Team of 2):
- 1 × Arduino Uno (or Nano) + USB cable
- 1 × Half-size or full-size breadboard
- 4–6 × 5V 650nm Red Laser Diode modules (Class 2 / Class 3R, 5mW maximum)
- 4–6 × Light Dependent Resistors (LDRs / Photoresistors) or LDR modules

- 4-6 IR line sensors

- 4–6 × 10kΩ Resistors (for voltage dividers)
- 1 × Passive or active piezo buzzer (or 3.5mm audio jack for external speaker)
- Jumper wires & cardboard/foam-board/laser-cut wooden frame
Session-by-Session Instructional Sequence
1.Optical Sensing & Safety Fundamentals:
- Prerequisite safety check: Class 2/3R eye safety rules must be briefed first.
- Objective: Understand how an LDR detects light intensity changes and wire a stable voltage divider circuit.
- Safety Briefing: Never look directly into the laser beam or point it at reflective surfaces; ensure all laser modules are powered off until mounted.
- Hands-on Task:
- Build a voltage divider with a single LDR and a 10kΩ resistor connected to pin A0.
- Upload a simple analogRead() sketch and observe ambient light values via the Arduino Serial Plotter.
- Aim a handheld laser pointer at the LDR to determine the "hit" threshold vs. "blocked" threshold.
2.Sound Generation & Single-String Prototype:
- Objective: Translate an interrupted light beam into a distinct musical note.
- Hands-on Task:
- Wire a piezo buzzer to digital pin 8.
- Introduce Arduino's built-in tone(pin, frequency) function.
- Write a threshold conditional statement:
Arduino Code sample:
if (analogRead(A0) < threshold) {
tone(8, 262); // Middle C
} else {
noTone(8);
}
Test interrupting the beam with a finger to verify immediate response latency and calibrate ambient light sensitivity.
3.Scaling to Multiple Strings & Code Architecture:
- Objective: Scale the circuit from 1 to 4–6 strings without writing repetitive code.
- Hands-on Task:
- Duplicate the LDR + 10kΩ voltage divider across pins A0 through A4.
- Refactor code using arrays for pins and musical frequencies:
const int sensorPins[] = {A0, A1, A2, A3};
const int notes[] = {262, 294, 330, 349}; // C4, D4, E4, F4
Implement an automatic calibration routine inside setup() that reads ambient levels for 2 seconds to calculate dynamic trip thresholds.
4.Chassis Integration & Final Performance:
- Objective: Mount components to an enclosure, align optical paths, and polish interaction.
- Hands-on Task:
- Assemble a cardboard, wood, or 3D-printed C-frame.
- Mount laser diodes on the top arm and LDRs inside recessed channels (baffles or heat-shrink tubing) on the bottom arm to shield them from ambient room lighting.
- Align laser dots to photoresistors and test multi-beam chord or melodic playback.
- Extension Option: Swap the piezo buzzer for a MIDI-over-USB library to trigger digital instruments inside software like GarageBand or Ableton Live.
Common Pitfalls & Troubleshooting Checklist - Ambient Light Interference: Overhead fluorescent or LED lighting can trigger false positives. Wrap heat-shrink tubing or black paper collars around each LDR to create a narrow field of view.
- Beam Misalignment: Fixed frames flex. Ensure the laser mounts have slight mechanical tolerance or set-screws for manual beam adjustment.
- Monophonic Limits of tone(): Arduino's standard tone() function can only generate one frequency at a time. Remind students that simultaneous multi-beam playing requires MIDI output to an external synthesizer or a multi-channel audio shield.
No comments:
Post a Comment