Tuesday, October 27, 2026

October 27th- Class Canceled; Items for Next Week

Questions for Students:

  1. What project are you planning to work on?  Laser Harp? Optical Music Box?


  2. Who is working on the project? Students are encouraged to work in groups

  3. Download the Arduino IDE ( Integrated Development Environment) and install it on their own computers.  Watch the intro video at https://youtu.be/zfp0IJoXcFg

  1.  Bring laptops to next week’s class.


    For next week:

Review Project Plans and needed parts, such as:
    • Laser Diodes
    • IR Sensors
    • Microcontroller
    • MIDI Board
    • Speakers
    • Power Supply
    • Paper transport for Music Box
    • Laser Harp Frame
Lab activities: 

-----------------------------------------------------------------------------------

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
  • LDR2.jpeg
    • 4-6 IR line sensors
  • Principle-of-working-of-IR-sensor.jpg
    • 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:
    1. Build a voltage divider with a single LDR and a 10kΩ resistor connected to pin A0.
    2. Upload a simple analogRead() sketch and observe ambient light values via the Arduino Serial Plotter.
    3. 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:
    1. Wire a piezo buzzer to digital pin 8.
    2. Introduce Arduino's built-in tone(pin, frequency) function.
    3. 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:
    1. Duplicate the LDR + 10kΩ voltage divider across pins A0 through A4.
    2. 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:
    1. Assemble a cardboard, wood, or 3D-printed C-frame.
    2. 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.
    3. Align laser dots to photoresistors and test multi-beam chord or melodic playback.
    4. 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

Nov 3rd Class- Experimenting with Neopixels; MIDI Prototyping

Above: Kerem makes calculations...  The planned projects seemed to have coalesced into two projects: Project 1(Stanley-Kexin-Rohan) is a clo...