Air piano
You can play music just by moving your fingers through air.
Author: Chirila Teodora
GitHub Project Link: https://github.com/UPB-FILS-MA/project-ChirilaTeodora
Description
This project constructs a musical instrument resembling a piano, but utilizing proximity sensors instead of physical keys. The Raspberry Pi Pico W detects the distance of a user’s fingers from the ultrasonic sensor using ultrasonic waves. This detected distance is then translated into visual feedback via LEDs and sound generation on the buzzers.
Motivation
I wanted to do something interesting and fun that would combine one of my passions, music.
Architecture
The project can be visualized as follows:
Main Component (Software): The Rust program running on the Raspberry Pi Pico W.
Subcomponents:
-
Sensor Input: Handles communication with the ultrasonic sensor and retrieves distance data.
-
LED Control: Controls the three LEDs based on the detected distance.
-
Buzzer Control: Generates tones on the buzzers corresponding to ”played” notes.
Log
Week 6 - 12 May
I uploaded the project documentation, detailing my reasons for choosing this project, the materials I used, and the connections between the components.
Week 7 - 19 May
I uploaded the KiCad schematics along with photos showing the components connected on breadboards.
Week 20 - 26 May
I have been working on making the code and completing the other milestones so far to correspond with the current status of the project.
Hardware
This project utilizes the following hardware components:
-
Raspberry Pi Pico W: The microcontroller board that controls the entire system.
-
Ultrasonic Sensor: Detects the distance of objects in front of it using ultrasonic waves.
-
Three LEDs: Provide visual feedback based on the detected distance.
-
One passive buzzer: Generate sound for the piano functionality.
-
Breadboard: Facilitates easy connection between components.
-
Jumper Wires: Connect components to the breadboard and Raspberry Pi Pico.
Schematics
This is the schematic in KiCad for the project.
Bill of Materials
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico | The microcontroller | 39 lei |
Breadboard | Main board | 10 lei |
Jumper Wires | Connecting | 8 lei |
Passive Buzzer | Alert | 1,40 lei |
Red LED | It lights up | 0,39 lei |
Yellow LED | It lights up | 0,39 lei |
Green LED | It lights up | 0,39 lei |
Ultrasonic Distance Sensor | Measure distances | 7 lei |
Resistors | For LED's | 7 lei |
Micro USB Cable | To supply the Raspberrry plate | 3 lei |
Software
Library | Description | Usage |
---|---|---|
Embassy | A Rust-based framework designed specifically for embedded programming | It's for programming the Raspberry Pi Pico and simplifying embedded concepts |
embassy-hal | Hardware | Provides access to Raspberry Pi Pico W specific hardware functionalities |
pico-ultrasonic-rs | Raspberry Pi Pico + HC-SR04 sensor | Sending data from the sensor to pico |
embassy-rp | For using the hardware capabilities | Implements both blocking and async APIs for many peripherals |