{"id":18554890,"url":"https://github.com/ttwag/p3_sound_follower","last_synced_at":"2025-05-15T12:09:32.398Z","repository":{"id":205673082,"uuid":"714536476","full_name":"ttwag/P3_Sound_Follower","owner":"ttwag","description":"A Sound Follower Robot built from the Texas Instrument RSLK Learning Kit","archived":false,"fork":false,"pushed_at":"2023-12-26T21:39:38.000Z","size":9653,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T11:15:12.163Z","etag":null,"topics":["c","embedded-systems","sound-processing"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttwag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T06:16:30.000Z","updated_at":"2023-12-16T02:56:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"6804e866-7928-4d66-9029-7e7ce9641818","html_url":"https://github.com/ttwag/P3_Sound_Follower","commit_stats":null,"previous_names":["ttwag/p3_sound_follower"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttwag%2FP3_Sound_Follower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttwag%2FP3_Sound_Follower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttwag%2FP3_Sound_Follower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttwag%2FP3_Sound_Follower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttwag","download_url":"https://codeload.github.com/ttwag/P3_Sound_Follower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337596,"owners_count":22054254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","embedded-systems","sound-processing"],"created_at":"2024-11-06T21:24:18.947Z","updated_at":"2025-05-15T12:09:32.375Z","avatar_url":"https://github.com/ttwag.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# P3_Sound_Follower\n\u003cimg src=\"./images/Figure1.png\" alt=\"error with loading the image\" width=\"500\" /\u003e\n\nhttps://github.com/ttwag/P3_Sound_Follower/assets/113254272/8ed2ba37-40fd-48aa-8de7-3d279f86dcb7\n\nIn this project, me and my partner built a robot that follows sound source in real-time.\n\nThe image above shows the entire robot along with the added sound receiver circuit.\n\nThe video above shows how PWM signals could instruct the RSLK robot to move.\n\n## Skills Involved\n* C Language\n* Embedded System Programming\n* Soldering Circuit\n* Basic Digital Signal Processing\n* Using a Multimeter and Oscilloscope \n\n## Development Environment\nI did this project with a teammate while I attended the class, [EEC10](https://ece.ucdavis.edu/course-catalog), at UC Davis.\n\nThis project uses the Texas Instrument's RSLK Learning Kit, and we programmed them in TI's [Code Composer Studio](https://www.ti.com/tool/CCSTUDIO)\n\nThe analog sound receiver (yellow board in the picture) was soldered by me and my teammate.\n\nWe used numerous lab instruments in Kemper Hall to test and debugg the circuit.\n\n![Figure8](./images/Figure8.jpeg)\n\n## Summary\nWe build an analog sound receiver circuit that converts the environment's sound into a voltage waveform, and then the analog-to-digital converter in the microcontroller samples the analog waveform into digital values. We programmed the microcontroller to digitally filter out the low and high-frequency sampled values and calculate the direction where the highest values come from. It then moves toward that direction by sending a pulse-width modulated signal to the motor.\n\n## Microphone Receiver Circuit\n![Figure2](./images/Figure2.png)\n\nThe sound receiver circuit has two microphones that convert sound waves into voltage waves.\n\nIt contains an analog active band-pass filter that filters out the high and low-frequency noise in the voltage waveform and amplifies the waveform.\n\n\n### Output from the microphone receiver circuit on an oscilloscope. \n![Figure3](./images/Figure3.png)\n\n### Output Sampled by the Microcontroller\nSampling Frequency: $2 \\space kHz$\n\nSample Size: $100$\n\n![Figure4](./images/Figure4.png)\n\n## Pulse-Width Modulated (PWM) Signal\nThe image below shows the PWM signal with a 50% duty cycle on an oscilloscope.\nIt's the signal that will control the motor.\n![Figure5](./images/Figure5.png)\n\n## Digital Band-Pass Filter\nTo digitally process the sampled values with a band-pass filter, we could process it with a low-pass filter and then a high-pass filter just like we would cascade them in analog circuits.\n### Digital Low-Pass Filter\nThe image below shows the Fast Fourier Transform (FFT) of the sampled values before (top) and after (bottom) the digital low-pass filter.\n\nThe cut-off frequency is 3000 Hz, so we see that high-frequency magnitude such as 4000 Hz is attenuated.\n\n![Figure6](./images/Figure6.png)\n\n### Digital High-Pass Filter\nOn the contrary, the high-pass filter filters out the low-frequency signal.\n\nThe image below shows the FFT of the sampled values before (top) and after (bottom) the digital high-pass filter.\n\nThe cut-off frequency is 200 Hz, so we see that low-frequency magnitude such as 150 Hz in the image is attenuated.\n\n![Figure7](./images/Figure7.png)\n\n## What Could I Do Better?\nThe analog receiver circuitry was not very good at giving consistent results. The inconsistency made the digital programming part extremely difficult. A good thing to do in the future is to ensure the symmetry between the two microphone circuits and maybe build more of them to achieve an extremely well-tuned circuit.\n\nTo determine if the sound source was in front of the microphone, the team thought of comparing the sound difference between the two microphones. If they were small enough, then the sound should be at the center. \n\nHowever, the sound difference between the left and right microphones was amplified when the robot got closer to the speaker, making it hard to determine the threshold since it’s a function of position and the speaker’s sound level. \n\nOne way to solve this problem could be to set the threshold as a percentage of the input average sound and only compare the percentages.\n## File Structure and Dependencies\n* The overall structure of the program is in main.c, but it doesn't contain the entire program.\n* This program requires numerous TI drivers and libraries.\n## Helpful Links\nYou can learn more about the library function [here](https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP432_Driver_Library/3_21_00_05/exports/driverlib/msp432_driverlib_3_21_00_05/doc/MSP432P4xx/html/driverlib_html/modules.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttwag%2Fp3_sound_follower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttwag%2Fp3_sound_follower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttwag%2Fp3_sound_follower/lists"}