This project implements a simple oscilloscope using Python, allowing you to feed a signal to your laptop via its microphone jack and display the captured signal on its monitor.
- Real-time signal display
- Frequency and amplitude measurement
- Adjustable voltage and time divisions
- Support for sine, triangle, and square waves
- GUI interface with start/stop functionality
- Python 3.x
- PyQt5
- pyaudio
- numpy
- matplotlib
- Clone this repository:
git clone https://github.com/Sin-a-H/Python-Oscilloscope - Install the required packages:
pip install -r requirements.txt
Run the script:
python3 Oscilloscope.py
The main components of the oscilloscope are:
- Audio input handling using
pyaudio - Signal processing and FFT using
numpy - GUI implementation using
PyQt5 - Real-time plotting using
matplotlib
Key functions:
initialize_audio(): Sets up the audio streamupdate_plot(): Updates the oscilloscope display in real-timeupdate_frequency_and_amplitude(): Calculates and displays frequency and amplitudeupdate_voltage_div()andupdate_time_div(): Adjust voltage and time divisions
- Maximum amplitude: Limited by the headphone jack specifications (typically up to 1.5V or 2.5V)
- Maximum frequency: Limited by the sound card capabilities (usually up to 48kHz)
The app while running the code, will be as above.
The costomed headphone-jack that we made by soldering.
Feel free to fork this project and submit pull requests with improvements or bug fixes.
- Sina Hashemi
- Mahan Zamani
- MohammadHossein Sabzalian
Note: This project is for educational purposes only. The authors and contributors take no responsibility for any possible damage to your laptop or equipment.


