Wave Properties Calculator
Build an app that calculates wavelength, frequency, wave speed, and demonstrates the wave equation. Includes modes for sound waves and light waves.
🎯 Learning Goals
- ▹ Master the universal wave equation (v = fλ)
- ▹ Understand differences between Sound and Light waves
- ▹ Perform temperature-based speed of sound adjustments
- ▹ Implement scientific notation for extreme values (light speed)
🌎 Why This Matters
Waves are how we communicate. Your Wi-Fi, mobile network, radio, and even the colors you see are all waves. Understanding wave properties is the first step toward understanding modern telecommunications and quantum physics.
📖Understanding Waves
Theory MasterclassA wave is a disturbance that transfers energy from one place to another without transferring matter. Types: • Transverse waves: particles vibrate perpendicular to wave direction (light, water waves) • Longitudinal waves: particles vibrate parallel to wave direction (sound) Key Properties: Wavelength (λ): Distance between two consecutive crests (or compressions). Unit: meters Frequency (f): Number of complete waves per second. Unit: Hertz (Hz) Time Period (T): Time for one complete wave. T = 1/f Amplitude (A): Maximum displacement from rest position Wave Speed (v): How fast the wave travels The Wave Equation: v = f × λ Speed = Frequency × Wavelength Sound Waves: Speed of sound in air ≈ 343 m/s (at 20°C) Speed increases with temperature: v = 331 + 0.6T (T in °C) Audible range: 20 Hz to 20,000 Hz Below 20 Hz = infrasound, Above 20,000 Hz = ultrasound Light Waves: Speed of light: c = 3 × 10⁸ m/s Visible light wavelengths: 400nm (violet) to 700nm (red) c = f × λ (for electromagnetic waves)
Mathematical Foundation
🎨Part A — Designer View (UI Design)
Open MIT App Inventor → Switch to Designer view. Follow each step below to build the interface.
Set up with wave type selector
Title: "Wave Calculator" Add HorizontalArrangement: "General Wave", "Sound Wave", "Light Wave"
Create General Wave panel
TextBox: "Frequency (Hz)" TextBox: "Wavelength (m)" TextBox: "Wave Speed (m/s)" Label: "Enter any TWO to find the third" Button: "Calculate"
Create Sound Wave panel
TextBox: "Frequency (Hz)" — Hint: "440 (Concert A)" TextBox: "Temperature (°C)" — Hint: "20" Button: "Calculate Sound Properties" Labels for: Speed, Wavelength, Period Also: "Audible?" indicator (is it between 20-20000 Hz?)
Create Light Wave panel
TextBox: "Wavelength (nm)" — Hint: "550" OR TextBox: "Frequency (Hz)" Button: "Calculate Light Properties" Labels for: Frequency/Wavelength, Color name, Energy (E=hf)
Add result display
ResultLabel for main output. InfoLabel for contextual information (e.g., "This is a red light" or "This is ultrasound").
🧩Part B — Blocks View (Logic & Calculation)
Switch to Blocks view. Now add the logic that makes your app actually work.
General Wave calculator
When CalculateButton.Click: Check which value is empty: If Speed empty: v = f × λ If Frequency empty: f = v / λ (check λ ≠ 0) If Wavelength empty: λ = v / f (check f ≠ 0) Also calculate: T = 1/f Display all values.
Sound Wave properties
When SoundCalculateButton.Click: 1. Read frequency and temperature 2. Calculate speed of sound: v = 331 + (0.6 × temp) 3. Calculate wavelength: λ = v / f 4. Calculate period: T = 1 / f 5. Display all values Add audibility check: if f < 20 → "Infrasound (below human hearing)" if f > 20000 → "Ultrasound (above human hearing)" else → "Audible sound ✓"
Identify the sound
Add fun context for common frequencies: if f ≈ 262 → "Middle C (piano)" if f ≈ 440 → "Concert A (tuning reference)" if f < 250 → "Bass range" if f > 2000 → "High treble range" "Wavelength of this sound: " + λ + " m" "That's about " + comparison + " long"
Light Wave properties
When LightCalculateButton.Click: 1. Read wavelength in nm 2. Convert to meters: λ_m = wavelength × 10⁻⁹ 3. Calculate frequency: f = c / λ_m (c = 3×10⁸) 4. Calculate energy: E = h × f (h = 6.626×10⁻³⁴) 5. Display in scientific notation
Identify the color
Based on wavelength (nm): 380-450 → "Violet 🟣" 450-495 → "Blue 🔵" 495-570 → "Green 🟢" 570-590 → "Yellow 🟡" 590-620 → "Orange 🟠" 620-750 → "Red 🔴" < 380 → "Ultraviolet (invisible)" > 750 → "Infrared (invisible)"
Format scientific notation
For very large or small numbers, display nicely: Create a procedure that converts: 300000000 → "3 × 10⁸" 0.00000000066 → "6.6 × 10⁻¹⁰" Or simply: round to 3 significant figures and add the unit prefix.
🧪Testing Your App
- ✓Sound at 440 Hz, 20°C → v=343 m/s, λ≈0.78 m
- ✓Visible light: 550nm → green, f≈5.45×10¹⁴ Hz
- ✓Red light: 700nm → f≈4.29×10¹⁴ Hz
- ✓Sound at 0°C → v=331 m/s
- ✓20000 Hz at 20°C → λ≈1.7cm (smallest audible wavelength)
🚀Bonus Challenges
Extra credit — impress your instructor
- ★Draw a sine wave on Canvas with correct wavelength and amplitude
- ★Add Doppler Effect calculator: f' = f(v±v_observer)/(v∓v_source)
- ★Create a 'frequency to musical note' converter
- ★Add interference: resultant = 2A×cos(Δφ/2)