Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎵 Arduino Schumann Resonance Melody Player

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).

Demo

🌍 About Schumann Resonance

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.

✨ Features

  • 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

🔧 Hardware Requirements

Components

  • 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

Pin Connections

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

🚀 Getting Started

Installation

  1. Clone this repository

    git clone https://github.com/yourusername/schumann-resonance-player.git
    cd schumann-resonance-player
  2. Open in Arduino IDE

    • Open the .ino file in Arduino IDE
    • Ensure you have the LiquidCrystal library (included by default)
  3. Upload to Arduino

    • Select your board type under Tools > Board
    • Select the correct port under Tools > Port
    • Click Upload

Usage

  1. Power on the Arduino
  2. Adjust the potentiometer to change the frequency multiplier (1x to 50x)
    • Display shows: XXX.X Hz (Nx) where N is the multiplier
  3. Press the button to start/stop the melody
  4. The melody will loop continuously until stopped

📊 Technical Details

Frequency Calculation

Base Frequency = 7.83 Hz × Multiplier (1-50)
Scaling Factor = Base Frequency / 220 Hz (reference note)
Scaled Note = Original Note × Scaling Factor

Musical Range

  • 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

Melody Structure

  • 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 playbackSpeed variable)

🎛️ Customization

Adjusting Playback Speed

Modify the playbackSpeed variable in the code:

float playbackSpeed = 1.1;  // Increase for faster, decrease for slower

Changing the Melody

Replace the melodyNotes[] and noteDurations[] arrays with your own musical sequence.

Modifying Frequency Range

Adjust maxSafeMultiplier to change the available multiplier range:

int maxSafeMultiplier = 50;  // Change to desired maximum

🔍 How It Works

  1. Potentiometer Reading: Analog input is mapped to 50 discrete multiplier steps
  2. Frequency Calculation: Base frequency = 7.83 Hz × selected multiplier
  3. Proportional Scaling: All melody notes scale by the same ratio to preserve musical intervals
  4. Safety Check: Automatically limits frequencies above 1000 Hz
  5. Button Debouncing: 50ms debounce delay prevents false triggers
  6. Sequential Playback: Notes play in sequence with defined durations, looping continuously

📝 Code Structure

  • 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

🐛 Troubleshooting

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

📖 References

📄 License

This project is open source and available under the MIT License.

🙏 Acknowledgments

  • 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

About

Melody player & scaling

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages