An Arduino-based musical instrument that plays "In the Hall of the Mountain King" by scaling the melody based on the Schumann Resonance (Earth's natural electromagnetic frequency of 7.83 Hz).
The Schumann Resonance is Earth's natural "heartbeat" - electromagnetic resonances in the cavity between Earth's surface and the ionosphere, with a fundamental frequency of approximately 7.83 Hz. This project uses this natural frequency as a musical foundation.
- Dynamic Frequency Scaling: Potentiometer controls integer multipliers (1x to 50x) of the base Schumann frequency
- Proportional Melody Scaling: Entire melody scales while preserving musical intervals and relationships
- Safety Limiting: Automatic frequency capping at 1000 Hz to protect the buzzer
- Real-time Display: LCD shows current base frequency and exact Schumann multiplier
- Interactive Control: Button toggles playback on/off
- Complete Musical Piece: Plays "In the Hall of the Mountain King" with 100 notes
- Arduino Board (Uno, Nano, or compatible)
- 16x2 LCD Display (with HD44780 controller)
- Piezo Buzzer (passive buzzer recommended)
- Potentiometer (10kΩ linear)
- Push Button (momentary switch)
- Resistors (10kΩ pull-up if button doesn't use internal pull-up)
- Breadboard and jumper wires
| Component | Arduino Pin |
|---|---|
| Potentiometer (Signal) | A0 |
| Buzzer | Digital 7 |
| Play Button | Digital 2 |
| LCD RS | Digital 13 |
| LCD Enable | Digital 12 |
| LCD D4 | Digital 11 |
| LCD D5 | Digital 10 |
| LCD D6 | Digital 9 |
| LCD D7 | Digital 8 |
-
Clone this repository
git clone https://github.com/yourusername/schumann-resonance-player.git cd schumann-resonance-player -
Open in Arduino IDE
- Open the
.inofile in Arduino IDE - Ensure you have the
LiquidCrystallibrary (included by default)
- Open the
-
Upload to Arduino
- Select your board type under
Tools > Board - Select the correct port under
Tools > Port - Click Upload
- Select your board type under
- Power on the Arduino
- Adjust the potentiometer to change the frequency multiplier (1x to 50x)
- Display shows:
XXX.X Hz (Nx)where N is the multiplier
- Display shows:
- Press the button to start/stop the melody
- The melody will loop continuously until stopped
Base Frequency = 7.83 Hz × Multiplier (1-50)
Scaling Factor = Base Frequency / 220 Hz (reference note)
Scaled Note = Original Note × Scaling Factor
- Original melody range: 220 Hz (A3) to 554.37 Hz (C#5)
- Scaled range: 7.83 Hz to 391.5 Hz (at 50x multiplier)
- Safety cap: Maximum 1000 Hz to protect buzzer
- 100 total notes
- First melody section: 52 notes (repeated twice)
- Second melody section: 48 notes (repeated twice)
- Note durations: Quarter notes, half notes, and whole notes
- Playback speed: 1.1x (adjustable via
playbackSpeedvariable)
Modify the playbackSpeed variable in the code:
float playbackSpeed = 1.1; // Increase for faster, decrease for slowerReplace the melodyNotes[] and noteDurations[] arrays with your own musical sequence.
Adjust maxSafeMultiplier to change the available multiplier range:
int maxSafeMultiplier = 50; // Change to desired maximum- Potentiometer Reading: Analog input is mapped to 50 discrete multiplier steps
- Frequency Calculation: Base frequency = 7.83 Hz × selected multiplier
- Proportional Scaling: All melody notes scale by the same ratio to preserve musical intervals
- Safety Check: Automatically limits frequencies above 1000 Hz
- Button Debouncing: 50ms debounce delay prevents false triggers
- Sequential Playback: Notes play in sequence with defined durations, looping continuously
- Setup: Initializes pins, LCD, and displays title
- Main Loop:
- Reads potentiometer value
- Calculates frequency scaling
- Updates LCD display
- Handles button input with debouncing
- Manages note playback timing
| Issue | Solution |
|---|---|
| No sound from buzzer | Check buzzer polarity and pin connection |
| LCD shows garbage characters | Verify LCD wiring and contrast adjustment |
| Button not responding | Check pull-up resistor or internal pull-up configuration |
| Melody sounds wrong | Verify buzzer is passive (not active) type |
| Erratic frequency readings | Add a small capacitor (0.1µF) across potentiometer |
- Schumann Resonances - Wikipedia
- Musical Note Frequencies
- Arduino
tone()function documentation
This project is open source and available under the MIT License.
- Musical piece: "In the Hall of the Mountain King" by Edvard Grieg
- Inspired by Earth's natural electromagnetic frequencies
Made with 🎵 and the resonance of Earth
