Posts

Week4

Image
This week is the last week of the entire project, and the main functions of our project will be completed this week. All tasks include the following: 1. Complete the guitar part code. 2. Use switches to control transitions between instruments. 3. Use ultrasonic sensors to control changes in pitch. 4. Complete the poster production. First, we complete the adjustment of the ultrasonic sensor. By changing the distance, the changes in the piano's tone can be controlled. Secondly, the code for the guitar instrument is also completed this week. Changes in chords can also be controlled by changing the distance of the ultrasonic sensor. Then we adjusted the circuit again. Add switches to control switching between instruments. Final version of code Python part Mainly used serial and pygame libraries. The core approach of the code snippet is to receive the signal  sent by Arduino through serial communication and play the corresponding audio file based on the content of the signal. Audio file...

Week3

Image
Since the musical instrument hardware part has taken shape, this week we will focus on optimizing the code logic to improve sound quality and enrich functions. Posters as well as sustainability reports are also discussed during the week. This week, our key tasks are as follows: 1. Implement the code for piano playing. 2. Discuss the production of posters, including modules and preliminary content settings. 3. Discuss the content of the sustainability report. First, the instrument we initially want to implement is piano.  We chose python as the coding language. Due to the unsatisfactory results of the buzzer test last week, we decided to complete the playback directly on the PC this week. The above code completes the use of the controller to control audio playback, and then controls the pause and resume through the infrared sensor. The first step of communication performance test is completed. At the same time, the main calculations, audio processing and playback are completed on ...

Week2

Image
We continue to optimize component performance based on the first week. During the second week, main mission objectives include: 1. Mathematically map the different distances of the ultrasonic sensor to the frequency of sound vibrations 2. Study the communication between secure digital card  and board First, we built the circuit and entered the code into the Arduino Uno board. We simulated the component circuit connection diagram through simulation to make the circuit more intuitive. We then researched and tested SD card. By using an SD card to store played strings and then reading them, automatic playback is achieved. But there is a problem with the adjustment process of the SD card.  Arduino cannot directly read the information in the SD card and requires a new compiler, so this solution was abandoned. Generally speaking, the progress of the experiment this week was not very smooth.  The instability of ultrasonic sensors greatly reduces the effect of sound frequency chan...

Week1

Image
In the first week of school, we started the operation of the second-year project 'Sensor-Based Contactless Musical Instrument', which means that users can obtain sound only through induction without directly touching the strings. The functionality of this 'guitar' will be continuously expanded during the project’s implementation. In the first week, we will complete the following five main tasks: 1. Understand the basic principles of guitar. 2. Test the Arduino Uno. 3. Completed the testing of six IR sensors and ultrasonic sensor. 4. Completed the buzzer and speaker tests. 5. Match the six IR sensors to the different frequencies of the speakers. First, we test the Arduino Uno through the computer to understand its functions and programming methods. Connect the six IR sensors to the computer respectively, and judge whether there is an object approaching the IR sensor based on the returned grayscale or distance value. After completing the six IR sensor tests, the ultrasoni...