Skip to main content

Air piano

You can play music just by moving your fingers through air.

info

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.

Architecture diagram

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.

Hardware picture

Schematics

This is the schematic in KiCad for the project. KiCad

Bill of Materials

DeviceUsagePrice
Raspberry Pi PicoThe microcontroller39 lei
BreadboardMain board10 lei
Jumper WiresConnecting8 lei
Passive BuzzerAlert1,40 lei
Red LEDIt lights up0,39 lei
Yellow LEDIt lights up0,39 lei
Green LEDIt lights up0,39 lei
Ultrasonic Distance SensorMeasure distances7 lei
ResistorsFor LED's7 lei
Micro USB CableTo supply the Raspberrry plate3 lei

Software

LibraryDescriptionUsage
EmbassyA Rust-based framework designed specifically for embedded programmingIt's for programming the Raspberry Pi Pico and simplifying embedded concepts
embassy-halHardwareProvides access to Raspberry Pi Pico W specific hardware functionalities
pico-ultrasonic-rsRaspberry Pi Pico + HC-SR04 sensorSending data from the sensor to pico
embassy-rpFor using the hardware capabilitiesImplements both blocking and async APIs for many peripherals
  1. Air piano(not rust)
  2. How the Ultrasonic Sensor works
  3. How to make music with pico