From 8558046a0d996fa723db01377e5fcb8df86b3712 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Wed, 25 Jan 2023 20:05:17 +0000 Subject: [PATCH 01/10] Setting up GitHub Classroom Feedback From 28921e3657d49f2d457c197a76554cd6ba614480 Mon Sep 17 00:00:00 2001 From: David Gormley Date: Wed, 25 Jan 2023 15:32:29 -0500 Subject: [PATCH 02/10] Adding plan --- writing/report.md | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/writing/report.md b/writing/report.md index 8a96328..4baf764 100755 --- a/writing/report.md +++ b/writing/report.md @@ -1,34 +1,42 @@ -# Report by Add Your Names Here +# David Gormley, Maximillian Mandel ## Planning, due on January 27th, 2023 by 9:30am ### Timeline -| Timeline | Tasks | -| ----------- | ----------- | -| dates | task 1 | +| Timeline | Tasks | +| ---------- | ----------- | +| 2 weeks from 25th Jan | finish project | ### Hardware -TODO: - - Arduino board - -- in an itemized list, specify specific sensors, motors, etc. to be used in your project +- leds of different colors (ideally 13) (at least 8) +- microphone ## Arduino Project -TODO: Describe the application you have chosen to develop and provide a motivation for why it is a useful application. Include references of all sources you have used throughout this project (URLs are sufficient). +We plan to create a arduino board application which will take sound as an input (talking/music), take an approximation of the frequency being recorded and then display a color based on the closest note heard. The different led's will be set to correspond to specific note frequencies. ## Agent -TODO: Explain the characteristics/attributes of your agent, what makes it an agent (within the discussed course content), what makes it rational, what type of an agent it is, and what is its environment task (PEAS). +It is an agent because it interacts with the outside world. this is due to its ability to record sound and display a corresponding color in response. This is rational behaviour because the output corresponds directly to the input. + +Performance will be measured by its abiity to accurately show thew correct colors. + +Environment is inteded to be recreational spaces such as homes or studios. + +Agents will be the leds that display the various colors. + +Sensing will be done through the microphone. + ## Challenges and Learning Experiences TODO: + Discuss any challenges you have encountered during the work on this lab and describe what have you learned. ## Ethical Benefits and Implications From a73a236e741f05df68b86a79004a115a55149d6d Mon Sep 17 00:00:00 2001 From: kemandel Date: Fri, 27 Jan 2023 14:32:19 -0500 Subject: [PATCH 03/10] Edited hardware section --- writing/report.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/writing/report.md b/writing/report.md index 4baf764..0eeecf1 100755 --- a/writing/report.md +++ b/writing/report.md @@ -10,9 +10,12 @@ ### Hardware -- Arduino board -- leds of different colors (ideally 13) (at least 8) +- Arduino board (need) +- leds of different colors (ideally 13) (at least 8) (have) +- breadboard (have) - microphone +[amazon 1](https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10/ref=sr_1_3?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847782&sprefix=arduino+microhpone%2Caps%2C319&sr=8-3); +[amazon 2](https://www.amazon.com/DEVMO-Microphone-Sensitivity-Detection-Arduino/dp/B07S4DTKYH/ref=sr_1_1_sspa?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847851&sprefix=arduino+microhpone%2Caps%2C319&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyWE9LSjk1MjdSOUVHJmVuY3J5cHRlZElkPUEwMzUzMTA4Sko0WDhSQzI0Wk0wJmVuY3J5cHRlZEFkSWQ9QTAwNzE2NjJZRUI4NlE3SkZCTkkmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl) ## Arduino Project From 86eb622ea96a1cdd3ed83fa070188feec4cac8c4 Mon Sep 17 00:00:00 2001 From: kemandel Date: Mon, 6 Feb 2023 09:31:01 -0500 Subject: [PATCH 04/10] Edited report.md --- writing/report.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/writing/report.md b/writing/report.md index 0eeecf1..d56b0a7 100755 --- a/writing/report.md +++ b/writing/report.md @@ -6,9 +6,13 @@ | Timeline | Tasks | | ---------- | ----------- | -| 2 weeks from 25th Jan | finish project | +| 27th Jan | Planning | +| 1st Feb | Get Parts | +| 4th Feb | Build Board | +| 6th Feb | Programming | +| 7th Feb | Finish | -### Hardware +### Hardware - Arduino board (need) - leds of different colors (ideally 13) (at least 8) (have) @@ -21,13 +25,16 @@ Describe the application you have chosen to develop and provide a motivation for why it is a useful application. Include references of all sources you have used throughout this project (URLs are sufficient). -We plan to create a arduino board application which will take sound as an input (talking/music), take an approximation of the frequency being recorded and then display a color based on the closest note heard. The different led's will be set to correspond to specific note frequencies. +We plan to create a arduino board application which will take sound as an input (talking/music), take an approximation of the frequency being recorded and then display a color based on the closest note heard. The different led's will be set to correspond to specific note frequencies. This idea functions similarly to a tuner, although we hope to be able to distinguish the notes regardless of the octave. + ## Agent Explain the characteristics/attributes of your agent, what makes it an agent (within the discussed course content), what makes it rational, what type of an agent it is, and what is its environment task (PEAS). It is an agent because it interacts with the outside world. this is due to its ability to record sound and display a corresponding color in response. This is rational behaviour because the output corresponds directly to the input. +PEAS: + Performance will be measured by its abiity to accurately show thew correct colors. Environment is inteded to be recreational spaces such as homes or studios. @@ -38,26 +45,29 @@ Sensing will be done through the microphone. ## Challenges and Learning Experiences -TODO: +Discuss any challenges you have encountered during the work on this lab and describe what have you learned. -Discuss any challenges you have encountered during the work on this lab and describe what have you learned. +Our first biggest challenge for this lab was learning how to build with an arduino board. Neither of us had extensive experience with arduino, so as such we needed to learn from scratch using online guides and tutorials. More specifically, we had difficuly learning how to connect multiple led circuits to the same ground, but were eventually able to find a suitable solution. ## Ethical Benefits and Implications -TODO: In this section, drawing on class discussions and readings, answer the following questions 1. What entities, businesses, organizations do you envision developing the type of the application you have chosen to develop? +This type of application would largely be devloped by a company specializing in recreational objects, such as toys. However, there would also be potential in the audio industry, such as a company looking to create a visually interactive microphone or speaker. 2. Who are the intended users of this technology? +This technology would like be used by those in the audio industry. This application funcions purely for aesthetics, providing little or no practical application. As such, it could easily be used by anyone for personal purposes. 3. Who is not supposed to use this technology? +While I cannot think of anyone who should strictly speaking not use this technology, it would be preferable to avoid people using this technology as a replacement for instrument tuners, as it does not accomplish between notes of a different octave. 4. How can the application developed in this lab cause harm? +The most damage this application could do is through incorrect use by using it as an instrument tuner. This application is not capable of causing any bodily harm. 5. What solutions could be implemented to avoid the harm or to fix the harm described above? +As the application functions too differently to be used as a tuner, the user should be able to determine its usefulness lies in a different areal. ## Team Work -TODO: -Describe the details of your team working strategy, specifically explain how did you complete this work as a team and describe the specific contributions of each team member. +For our team work, we decided to split the work-load based on each of the tasks requried from the team as a whole. Both of us worked on acquiring all of the necessary materials and planning out the project as a whole. Once we had all the materials, we split the work load as follows. Max worked on building the arduino board and testing the functionality of the componants, and David worked on programming the arduino board in order to build our application with our goals in mind. Although we did split tasks at a higher level, both of us did end up having a hand in all aspects of the project such as building and programming the arduino. From 6bb7ec04c04a0999ed694857ed162a827aad1e31 Mon Sep 17 00:00:00 2001 From: kemandel Date: Mon, 6 Feb 2023 09:34:01 -0500 Subject: [PATCH 05/10] report.md linting --- writing/report.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/writing/report.md b/writing/report.md index d56b0a7..abbe4fa 100755 --- a/writing/report.md +++ b/writing/report.md @@ -15,11 +15,12 @@ ### Hardware - Arduino board (need) + - leds of different colors (ideally 13) (at least 8) (have) + - breadboard (have) -- microphone -[amazon 1](https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10/ref=sr_1_3?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847782&sprefix=arduino+microhpone%2Caps%2C319&sr=8-3); -[amazon 2](https://www.amazon.com/DEVMO-Microphone-Sensitivity-Detection-Arduino/dp/B07S4DTKYH/ref=sr_1_1_sspa?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847851&sprefix=arduino+microhpone%2Caps%2C319&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyWE9LSjk1MjdSOUVHJmVuY3J5cHRlZElkPUEwMzUzMTA4Sko0WDhSQzI0Wk0wJmVuY3J5cHRlZEFkSWQ9QTAwNzE2NjJZRUI4NlE3SkZCTkkmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl) + +- microphone [amazon 1](https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10/ref=sr_1_3?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847782&sprefix=arduino+microhpone%2Caps%2C319&sr=8-3); [amazon 2](https://www.amazon.com/DEVMO-Microphone-Sensitivity-Detection-Arduino/dp/B07S4DTKYH/ref=sr_1_1_sspa?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847851&sprefix=arduino+microhpone%2Caps%2C319&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyWE9LSjk1MjdSOUVHJmVuY3J5cHRlZElkPUEwMzUzMTA4Sko0WDhSQzI0Wk0wJmVuY3J5cHRlZEFkSWQ9QTAwNzE2NjJZRUI4NlE3SkZCTkkmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl) ## Arduino Project @@ -53,20 +54,15 @@ Our first biggest challenge for this lab was learning how to build with an ardui In this section, drawing on class discussions and readings, answer the following questions -1. What entities, businesses, organizations do you envision developing the type of the application you have chosen to develop? -This type of application would largely be devloped by a company specializing in recreational objects, such as toys. However, there would also be potential in the audio industry, such as a company looking to create a visually interactive microphone or speaker. +1. What entities, businesses, organizations do you envision developing the type of the application you have chosen to develop? This type of application would largely be devloped by a company specializing in recreational objects, such as toys. However, there would also be potential in the audio industry, such as a company looking to create a visually interactive microphone or speaker. -2. Who are the intended users of this technology? -This technology would like be used by those in the audio industry. This application funcions purely for aesthetics, providing little or no practical application. As such, it could easily be used by anyone for personal purposes. +2. Who are the intended users of this technology? This technology would like be used by those in the audio industry. This application funcions purely for aesthetics, providing little or no practical application. As such, it could easily be used by anyone for personal purposes. -3. Who is not supposed to use this technology? -While I cannot think of anyone who should strictly speaking not use this technology, it would be preferable to avoid people using this technology as a replacement for instrument tuners, as it does not accomplish between notes of a different octave. +3. Who is not supposed to use this technology? While I cannot think of anyone who should strictly speaking not use this technology, it would be preferable to avoid people using this technology as a replacement for instrument tuners, as it does not accomplish between notes of a different octave. -4. How can the application developed in this lab cause harm? -The most damage this application could do is through incorrect use by using it as an instrument tuner. This application is not capable of causing any bodily harm. +4. How can the application developed in this lab cause harm? The most damage this application could do is through incorrect use by using it as an instrument tuner. This application is not capable of causing any bodily harm. -5. What solutions could be implemented to avoid the harm or to fix the harm described above? -As the application functions too differently to be used as a tuner, the user should be able to determine its usefulness lies in a different areal. +5. What solutions could be implemented to avoid the harm or to fix the harm described above? As the application functions too differently to be used as a tuner, the user should be able to determine its usefulness lies in a different areal. ## Team Work From b4d3285595b8780313fe1e6c4b10f730756aa9e3 Mon Sep 17 00:00:00 2001 From: kemandel Date: Wed, 8 Feb 2023 13:06:09 -0500 Subject: [PATCH 06/10] Added application source code --- src/lab01/Application/Application.ino | 92 +++++++++++++++++++++++++-- 1 file changed, 88 insertions(+), 4 deletions(-) diff --git a/src/lab01/Application/Application.ino b/src/lab01/Application/Application.ino index 2998df1..31c51cb 100755 --- a/src/lab01/Application/Application.ino +++ b/src/lab01/Application/Application.ino @@ -1,12 +1,96 @@ /* -Add Your Names Here - +Maximillian Mandel +David Gormley */ +#define CPin 7 +#define DPin 8 +#define EPin 9 +#define FPin 10 +#define GPin 11 +#define APin 12 +#define BPin 13 + +#include + +#include + +// Turns off all LEDs +void disableLEDs() { + digitalWrite(CPin, LOW); + digitalWrite(DPin, LOW); + digitalWrite(EPin, LOW); + digitalWrite(FPin, LOW); + digitalWrite(GPin, LOW); + digitalWrite(APin, LOW); + digitalWrite(BPin, LOW); +} + void setup() { - TODO + // Enable LEDs + pinMode(CPin, OUTPUT); + pinMode(DPin, OUTPUT); + pinMode(EPin, OUTPUT); + pinMode(FPin, OUTPUT); + pinMode(GPin, OUTPUT); + pinMode(APin, OUTPUT); + pinMode(BPin, OUTPUT); + + // Serial for debugging + Serial.begin(9600); + + // Set frequency meter settings + setFrequencyDetectorControlDefaults(); + setFrequencyDetectorReadingValues(ADC_CHANNEL_DEFAULT, INTERNAL, PRESCALE_VALUE_DEFAULT, RAW_VOLTAGE_MIN_DELTA_DEFAULT); + + // set the frequency range + setFrequencyDetectorMatchValues(1400, 1700); } void loop() { - TODO + // Initialzie maximum variable and frequency + uint16_t mx = 0; + uint16_t frequency = 0; + + // Take 3 samples and determine the max frequency + // This is for accuracy and to reduce jitter + for (int i = 0; i < 3; i++) { + frequency = readSignal(); + frequency = doEqualDistributionPlausi(); + computeDirectAndFilteredMatch(frequency); + + if (frequency > mx) { + mx = frequency; + } + } + + // Take the maximum + frequency = mx; + + // Turn off all LEDs + disableLEDs(); + // Determine what LED to turn on + if ((frequency >= 508 && frequency <= 554) || (frequency >= 1010 && frequency <= 1108) || (frequency >= 2030 && frequency <= 2217)) { + digitalWrite(CPin, HIGH); + } else if ((frequency >= 554 && frequency <= 622) || (frequency >= 1108 && frequency <= 1244)) { + digitalWrite(DPin, HIGH); + } else if ((frequency >= 622 && frequency <= 675) || (frequency >= 1244 && frequency <= 1350)) { + digitalWrite(EPin, HIGH); + } else if ((frequency >= 675 && frequency <= 740) || (frequency >= 1350 && frequency <= 1480)) { + digitalWrite(FPin, HIGH); + } else if ((frequency >= 740 && frequency <= 830) || (frequency >= 1480 && frequency <= 1661)) { + digitalWrite(GPin, HIGH); + } else if ((frequency >= 830 && frequency <= 932) || (frequency >= 1661 && frequency <= 1864)) { + digitalWrite(APin, HIGH); + } else if ((frequency >= 932 && frequency <= 1010) || (frequency >= 1864 && frequency <= 2030)) { + digitalWrite(BPin, HIGH); + } + + // If we turned on an LED then print to console and delay the next loop + if (frequency >= 508 && frequency <= 2030) { + Serial.print(frequency); + Serial.println(" Hz"); + delay(200); + } } + From b1ed3ae71d8e914a08c9e1b6655736a1ee1fa8a0 Mon Sep 17 00:00:00 2001 From: kemandel Date: Wed, 8 Feb 2023 13:14:57 -0500 Subject: [PATCH 07/10] Finished report.md --- writing/report.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/writing/report.md b/writing/report.md index abbe4fa..b55f170 100755 --- a/writing/report.md +++ b/writing/report.md @@ -50,6 +50,12 @@ Discuss any challenges you have encountered during the work on this lab and des Our first biggest challenge for this lab was learning how to build with an arduino board. Neither of us had extensive experience with arduino, so as such we needed to learn from scratch using online guides and tutorials. More specifically, we had difficuly learning how to connect multiple led circuits to the same ground, but were eventually able to find a suitable solution. +Another challenge that we had was figuring out how to best use the attached mic to sample the audio frequency. At first we first using a digital input to record the mic, but this only returns a simple 0 or 1 value representing that the volume reached a certain threshold. THen we started using an analog input which could measure more finely the audio coming in. After experimenting with a few different arduino libraries, we were able to implement a way for our application to accurately sample audio. + +Finally, the last challenge we had was getting our application to consistently respond to audio input. While the application was technically working, there was a lot of jittering with the LEDs as the noise coming in was very chaotic and non-frequent. To remedy this, we decided to sample multiple audio signals at once and then use only the highest frequency. Furthermore, we added a very short delay after an LED turns on before the program tries to re-sample or order to help make the application feel more consistant. + +We learned a lot from this project, mostly relating to arduino circuits and programming, but also some about how audio inputs and led outputs function. We feel that if we were to try another arduino project again in the future, we would be able to tackle it with much greater efficiency. + ## Ethical Benefits and Implications In this section, drawing on class discussions and readings, answer the following questions From c31bf3b36ba31e24eb49a4c042ca1e9c237e1d0c Mon Sep 17 00:00:00 2001 From: kemandel Date: Wed, 8 Feb 2023 13:18:21 -0500 Subject: [PATCH 08/10] Fixed spelling --- writing/report.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/writing/report.md b/writing/report.md index b55f170..a3fec96 100755 --- a/writing/report.md +++ b/writing/report.md @@ -9,8 +9,8 @@ | 27th Jan | Planning | | 1st Feb | Get Parts | | 4th Feb | Build Board | -| 6th Feb | Programming | -| 7th Feb | Finish | +| 7th Feb | Programming | +| 8th Feb | Finish | ### Hardware @@ -60,16 +60,16 @@ We learned a lot from this project, mostly relating to arduino circuits and prog In this section, drawing on class discussions and readings, answer the following questions -1. What entities, businesses, organizations do you envision developing the type of the application you have chosen to develop? This type of application would largely be devloped by a company specializing in recreational objects, such as toys. However, there would also be potential in the audio industry, such as a company looking to create a visually interactive microphone or speaker. +1. What entities, businesses, organizations do you envision developing the type of the application you have chosen to develop? This type of application would largely be developed by a company specializing in recreational objects, such as toys. However, there would also be potential in the audio industry, such as a company looking to create a visually interactive microphone, speaker or instrument. -2. Who are the intended users of this technology? This technology would like be used by those in the audio industry. This application funcions purely for aesthetics, providing little or no practical application. As such, it could easily be used by anyone for personal purposes. +2. Who are the intended users of this technology? This technology would like be used by those in the audio industry. This application funcions purely for aesthetics, with a little functionality for direct audio feedback. As such, it could easily be used by anyone for personal purposes. -3. Who is not supposed to use this technology? While I cannot think of anyone who should strictly speaking not use this technology, it would be preferable to avoid people using this technology as a replacement for instrument tuners, as it does not accomplish between notes of a different octave. +3. Who is not supposed to use this technology? While I cannot think of anyone who should strictly speaking not use this technology, it would be preferable to avoid people using this technology as a replacement for instrument tuners, as it does not distinguish between notes of a different octave. 4. How can the application developed in this lab cause harm? The most damage this application could do is through incorrect use by using it as an instrument tuner. This application is not capable of causing any bodily harm. -5. What solutions could be implemented to avoid the harm or to fix the harm described above? As the application functions too differently to be used as a tuner, the user should be able to determine its usefulness lies in a different areal. +5. What solutions could be implemented to avoid the harm or to fix the harm described above? As the application functions too differently to be used as a tuner, the user should be able to determine its usefulness lies in a different area. ## Team Work -For our team work, we decided to split the work-load based on each of the tasks requried from the team as a whole. Both of us worked on acquiring all of the necessary materials and planning out the project as a whole. Once we had all the materials, we split the work load as follows. Max worked on building the arduino board and testing the functionality of the componants, and David worked on programming the arduino board in order to build our application with our goals in mind. Although we did split tasks at a higher level, both of us did end up having a hand in all aspects of the project such as building and programming the arduino. +For our team, we decided to split the work load based on each of the tasks requried from the team as a whole. Both of us worked on acquiring all of the necessary materials and planning out the project as a whole. Once we had all the materials, we split the work load as follows. Max worked on building the arduino board and testing the functionality of the componants, and David worked on programming the arduino board in order to build our application with our goals in mind. Although we did split tasks at a higher level, both of us did end up having a hand in all aspects of the project such as building and programming the arduino, as both tasks were easier to accomplish with a wider range of ideas. From ccef5b9e61994ba792db084b163937f01a3d0717 Mon Sep 17 00:00:00 2001 From: kemandel Date: Wed, 8 Feb 2023 13:26:30 -0500 Subject: [PATCH 09/10] ADded references --- writing/report.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/writing/report.md b/writing/report.md index a3fec96..6b69898 100755 --- a/writing/report.md +++ b/writing/report.md @@ -24,10 +24,14 @@ ## Arduino Project -Describe the application you have chosen to develop and provide a motivation for why it is a useful application. Include references of all sources you have used throughout this project (URLs are sufficient). +Describe the application you have chosen to develop and provide a motivation for why it is a useful application. Include references of all sources you have used throughout this project (URLs are sufficient). We plan to create a arduino board application which will take sound as an input (talking/music), take an approximation of the frequency being recorded and then display a color based on the closest note heard. The different led's will be set to correspond to specific note frequencies. This idea functions similarly to a tuner, although we hope to be able to distinguish the notes regardless of the octave. +[robotique](https://www.robotique.tech/robotics/blink-two-leds-with-arduino/) + +[circuitbasics](https://www.circuitbasics.com/how-to-use-microphones-on-the-arduino/) + ## Agent Explain the characteristics/attributes of your agent, what makes it an agent (within the discussed course content), what makes it rational, what type of an agent it is, and what is its environment task (PEAS). @@ -38,7 +42,7 @@ PEAS: Performance will be measured by its abiity to accurately show thew correct colors. -Environment is inteded to be recreational spaces such as homes or studios. +Environment is inteded to be used in recreational spaces such as homes or studios. Agents will be the leds that display the various colors. From 5429c952b1c075592b0944ffe99fcd2234b47048 Mon Sep 17 00:00:00 2001 From: Janyl Jumadinova Date: Fri, 17 Feb 2023 00:09:57 -0500 Subject: [PATCH 10/10] Convert report to README --- README.md | 174 +++--------------------------------------- config/gatorgrade.yml | 28 ------- writing/report.md | 79 ------------------- 3 files changed, 12 insertions(+), 269 deletions(-) delete mode 100755 writing/report.md diff --git a/README.md b/README.md index 5d5a0e2..649fa85 100755 --- a/README.md +++ b/README.md @@ -1,173 +1,23 @@ -# Project 1: Reflex Agent +# Sound Detection -## Deadlines: +## Arduino Project -- _Project Planning_: January 27th by 9:30am -- _Project Walkthrough_: February 1st, 2:30pm - 4:20pm -- _Code and Report_: February 8th by 2:30pm -- _Project Demonstration_: February 8th, 2:30pm - 4:20pm +We created a arduino board application which takes sound as an input (talking/music), takes an approximation of the frequency being recorded and then displays a color based on the closest note heard. The different LEDs are set to correspond to specific note frequencies. This idea functions similarly to a tuner, although we hope to be able to distinguish the notes regardless of the octave. -## Table of Contents +[robotique](https://www.robotique.tech/robotics/blink-two-leds-with-arduino/) -- [Summary](#summary) -- [Objectives](#objectives) -- [Agreement](#agreement) -- [Code of Conduct](#code-of-conduct) -- [Learning](#learning) -- [Assignment Specification](#assignment-specification) - - [Set Up](#set-up) - - [Arduino Programming](#arduino-programming) -- [Planning](#planning) -- [Project Walkthrough](#project-walkthrough) -- [Project Demonstration](#project-demonstration) -- [Required Deliverables](#required-deliverables) -- [Assignment Assessment](#assignment-assessment) -- [GatorGrade](#gatorgrade) - - [Automated Checks with GatorGrader](#automated-checks-with-gatorgrader) -- [Receiving Assistance](receiving-assistance) +[circuitbasics](https://www.circuitbasics.com/how-to-use-microphones-on-the-arduino/) -## Summary +## Agent -This project assignment invites you to work in a team to implement a simple reflex agent using an interactive application with an Arduino board and sensors. You are also responsible for writing a detailed report, stored in the file `writing/report.md`. This is a Markdown file that must adhere to the standards described in the [Markdown Syntax Guide](https://guides.github.com/features/mastering-markdown/). +It is an agent because it interacts with the outside world. this is due to its ability to record sound and display a corresponding color in response. This is rational behaviour because the output corresponds directly to the input. -## Objectives +PEAS: -To apply concepts of agent types and agent environment to a practical application. Specifically, you will use an open-source electronics platform called Arduino to develop a simple agent. You will learn how to use Arduino programming language, its IDE, Arduino board and other hardware components such as sensors and motors. Finally, you will reflect on the design of your agent, its attribute and type, its decision making within the environment, and its social responsibility. +Performance will be measured by its ability to accurately show thew correct colors. -## Agreement +Environment is intended to be used in recreational spaces such as homes or studios. -This laboratory assignment will be completed in groups of two or three (max). Each team member must follow the [community guidelines](https://github.com/CMPSC-310-AI-Spring2023/course_information/blob/main/community_guidelines.md), including team guidelines, developed by the students in this class. +Agents are the LEDs that display the various colors. -By working on and completing this laboratory assignment you agree to use the hardware given to you in a responsible manner. Each team is responsible for the safety and security of the Arduino board and any sensors, motors, cables and other electronics equipment utilized for their lab. Malicious unsafe operation of the hardware by any team member will result in the inability of that team member to work with the hardware provided by the instructor. - -By class time on Friday, January 27th, you must specify all hardware components you are planning to use in the appropriate section of your report document. At the completion of the lab, the instructor will check all of your specified equipment back in. All equipment must be returned before grades can be released. - -## Code of Conduct - -Throughout the completion of this project you must adhere to the [community guidelines](https://github.com/CMPSC-310-AI-Spring2023/course_information/blob/main/community_guidelines.md) that we developed as a class. In addition to reporting any violations of the code of conduct using [this form](https://forms.gle/W6Kf2jt1DmmKEdAs6), please make sure that you attest to the fact that you followed the code of conduct. Students who think that the class should revise some aspect of the guidelines must use the GitHub issue tracker for that repository to suggest, discuss, and implement any required changes. - -## Learning - -To review what you have learned about agents, their attributes, types, and environments, please read sections 1.3-1.5, 2.1-2.2 from the [Artificial Intelligence: Foundations of Computational Agents](https://artint.info/2e/html/ArtInt2e.Ch1.html) textbook. - -If you have not done so already, please read all of the relevant [GitHub Guides](https://guides.github.com/) that explain how to use many of the features that GitHub provides. In particular, please make sure that you have read the following GitHub guides: [Mastering Markdown](https://guides.github.com/features/mastering-markdown/), [Hello World](https://guides.github.com/activities/hello-world/), and [Documenting Your Projects on GitHub](https://guides.github.com/features/wikis/). - -## Assignment Specification - -In this two-week lab students are invited to implement a rational agent using an open-source electronics platform, Arduino, for some application of your choosing (within the realm of available hardware resources). As you select a specific application, you must identify the agent type, its attributes, and its task environment. The developed applications will be used during outreach activities in Crawford Central school district. - -Arduino platform makes it relatively easy to develop interactive applications that utilize both hardware and software by taking inputs from a variety of switches or sensors and controlling a variety of outputs (lights, motors, etc.). You will be working with an Arduino microcontroller board, a small circuit (the board) that essentially contains a small computer on a small chip (the microcontroller). There are different versions of the Arduino board that differ in components and size, you will work with either UNO or DUE versions. Other electronics components that are available are light sensor, infrared distance sensor, LED module, light sensor, push button, sound sensor, temperature sensor, tilt sensor, motion sensor, rotation sensor, buzzer module, servo, among others. - -There are many examples for sample Arduino projects, including the following: - -- [ProjectHub](https://create.arduino.cc/projecthub) -- [Hackster](https://www.hackster.io/arduino/projects) -- [DF robot](https://www.dfrobot.com/product-1454.html?search=Gravity%3A%20Starter%20Kit%20for%%3E) -- [Elegoo](https://www.elegoo.com/download/) - -Although you are encouraged to use the sample examples included with Arduino IDE or sample projects from existing online resources, your solution to this lab can not be just an existing project that you have put to practice. You must add at least one small extension or make a small change to the project providing an inspiration for your work. In your report document, you must also include a reference (URL is sufficient) to all resources that you have used when learning about Arduino and possible projects. - -### Set Up - -Arduino programs are written in the Arduino Integrated Development Environment (IDE). In ALIC, Arduino IDE is already installed on the machines. If you would like to use your own laptop, you can obtain the necessary software from [Arduino website](https://www.arduino.cc/en/Main/Software). You also have an option of developing and testing your program on [Arduino Wed Editor](https://create.arduino.cc/editor). - -### Arduino Programming - -Arduino IDE enables you to write sketches (programs in Arduino) for different Arduino boards. The Arduino programming language is based on a very simple language called processing, which is similar to the C language. After the sketch is written in the Arduino IDE it can be uploaded on the Arduino board for execution. - -The structure of an Arduino program contains a minimum of 2 blocks responsible for preparation and execution, setup and loop methods respectfully in the example below. - -``` -void setup( ) { - statements; -... -} -void loop( ) { - statements; ... -} -``` - -When program is run, the setup function is executed first, and it is responsible for initializing the pin modes and starting serial communication. This function has to be included even if there are no statements to execute but it is only executed once. After the setup function runs, the execution block runs next. The execution block contains statements that are responsible for specific tasks, such as reading inputs, triggering outputs, checking conditions etc. For example, a loop function is a part of execution block and it executes the set of statements repeatedly. - -## Planning - -Once you have chosen the Arduino project you want to implement and the type of agent you want to develop, identify the tasks that need to be completed for this lab. Then, by class time on Friday, January 27th, complete and submit the planning portion in your report that includes the tasks your team has to complete and a timetable for their completion. In this section of your report you must also indicate all of the hardware components that your team will need for the lab completion. - -## Project Walkthrough - -During the lab session on Wednesday, February 1st, each team will participate in the project walk-through process. Project walkthrough is an informal process where the instructor leads the process of reviewing the progress of the project and the written code is reviewed for technical accuracy with the objective of finding errors and improving the quality of the code. The purpose of this walkthrough is to motivate continuous progression on the project, identification of any conceptual issues, and detection of any technical errors. When the walkthrough is finished, the authors of the project are responsible for taking the necessary actions to correct the identified issues. - -By this project walkthrough, each team should have identified the agent they plan to develop, have gotten to know Arduino IDE and hardware component interactions, and have started writing some code. During the walkthrough, the team members will collaboratively lead the walkthrough process, which should last 5-10 minutes for each team. Each team should: - -- Describe the chosen application. -- Discuss what makes the agent being developed in this application "an agent", what its attributes, its type, and its environment are. -- Explain the written code. -- Identify the steps left to complete for this project. - -## Project Demonstration - -At the beginning of the lab session on Wednesday, February 8th, each team will be given an opportunity to demonstrate their project. When the lab session starts, teams will be given a few minutes to set up their demonstrations and get them running. Then, class members will participate in an interactive demonstration session, where everyone will be able to view each demonstration. - -## Required Deliverables - -This assignment invites you to submit the following deliverables through your team repository. - -1. Planning portion of the report due on January 27th by 9:30am. The rest of the written requirements are due at 2:30 pm on February 8th. -2. A properly completed and commented source program(s). Please make sure your source code is titled "Application" and located inside "src/lab01/Application" directory in your lab01 repository. -3. The report, stored in /writing/report.md and written in Markdown, that contains the planning portion as described above, and provides answers in all remaining sections (follow the prompts inside the report document). -4. Lab session on February 1st will be used to conduct project walkthroughs and for lab work. -5. The lab session on February 8th will be used for demonstrations. - -## Assignment Assessment - -The grade that a student receives on this assignment will have the following components. - -- **GitHub Actions CI Build Status [up to 15%]:**: For lab01 repository associated with this assignment students will receive a checkmark grade if their last before-the-deadline build passes. - -- **Mastery of Verbal Explanation during Walkthrough and Demonstration [up to 20%]:**: Since the continuous and timely project development and the ability to communicate technical details of a project is crucial to building successful software and hardware applications, a portion of students' lab grade will be determined based on the quality of the project walkthrough and the project demonstration. - -- **Mastery of Technical Writing [up to 20%]:**: Students will also receive a checkmark grade when the responses to the writing questions presented in the `report.md` reveal a proficiency of both writing skills and technical knowledge. To receive a checkmark grade, the submitted writing should have correct spelling, grammar, and punctuation in addition to following the rules of Markdown and providing conceptually and technically accurate answers. - -- **Mastery of Technical Knowledge and Skills [up to 45%]**: Students will receive a portion of their assignment grade when their project implementation reveals that they have mastered all of the technical knowledge and skills developed during the completion of this project. As a part of this grade, the instructor will assess aspects of the project including, but not limited to, the correctness of the program, the completeness and correctness of the software and hardware integration, the use of effective source code comments and Git commit messages. - -All grades for this project will be reported through a student's gradebook GitHub repository. - -## GatorGrade - -You can check the baseline requirements of this project by running department's assignment checking `gatorgrade` tool. To use `gatorgrade`, you first need to make sure you have Python installed. If not, please see: - -- [Setting Up Python on Windows](https://realpython.com/lessons/python-windows-setup/) -- [Python 3 Installation and Setup Guide](https://realpython.com/installing-python/) -- [How to Install Python 3 and Set Up a Local Programming Environment on Windows 10](https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-windows-10) - -Then, you need to install `gatorgrade`: - -- First, [install `pipx`](https://pypa.github.io/pipx/installation/) -- Then, install `gatorgrade` with `pipx install gatorgrade` - -Finally, you can run `gatorgrade`: - -`gatorgrade --config config/gatorgrade.yml` - -## Automated Checks with GatorGrader - -Your submission must pass the following checks that [GatorGrader](https://github.com/GatorEducator/gatorgrade) automatically assesses. If [GatorGrader's](https://github.com/GatorEducator/gatorgrade) automated checks pass correctly, the tool will produce the output similar to the one below. - -``` -✔ The report.md in writing has exactly 0 of the 'Add Your Names Here' fragment -✔ The Application.ino in src/lab01/Application has at least 2 single-line Java comment(s) -✔ The Application.ino in src/lab01/Application has exactly 0 of the 'TODO' fragment -✔ The Application.ino in src/lab01/Application has exactly 1 of the 'setup(' fragment -✔ The Application.ino in src/lab01/Application has exactly 0 of the 'Add Your Names Here' fragment -✔ The report.md in writing has exactly 9 of the 'heading' tag -✔ The repository has at least 10 commit(s) -✔ The file Application.ino exists in the src/lab01/Application directory -✔ The report.md in writing has at least 200 word(s) in total -✔ The file report.md exists in the writing directory -✔ The Application.ino in src/lab01/Application has at least 1 of the 'loop(' fragment -✔ The report.md in writing has exactly 0 of the 'TODO' fragment -``` - -## Receiving Assistance - -If you are having trouble completing any part of this project, then please talk with either the course instructor during the lab session. Alternatively, you may ask questions in the Slack workspace for this course. Finally, you can schedule a meeting during the course instructor's office hours. +Sensing is done through the microphone. diff --git a/config/gatorgrade.yml b/config/gatorgrade.yml index 6bf9071..133429a 100755 --- a/config/gatorgrade.yml +++ b/config/gatorgrade.yml @@ -33,34 +33,6 @@ count: 1 exact: false -# --> check the technical writing for various characteristics -- writing/report.md: - - description: Ensure that report.md file exists in the writing/ directory - check: ConfirmFileExists - - description: Write a minimum number of meaningful words (200) in the report - check: CountFileWords - options: - count: 200 - exact: false - - description: Confirm that the markdown file has the correct number of headers - check: CountMarkdownTags - options: - tag: heading - count: 9 - exact: true - - description: Complete all TODOs, remove the TODO markers in the report.md - check: MatchFileFragment - options: - fragment: TODO - count: 0 - exact: true - - description: Replace the 'Add Your Names Here' prompt in the report file - check: MatchFileFragment - options: - fragment: "Add Your Names Here" - count: 0 - exact: true - # count number of commits in the GitHub repository - description: Have at least a specific minimum number of commits (10) in repository check: CountCommits diff --git a/writing/report.md b/writing/report.md deleted file mode 100755 index 6b69898..0000000 --- a/writing/report.md +++ /dev/null @@ -1,79 +0,0 @@ -# David Gormley, Maximillian Mandel - -## Planning, due on January 27th, 2023 by 9:30am - -### Timeline - -| Timeline | Tasks | -| ---------- | ----------- | -| 27th Jan | Planning | -| 1st Feb | Get Parts | -| 4th Feb | Build Board | -| 7th Feb | Programming | -| 8th Feb | Finish | - -### Hardware - -- Arduino board (need) - -- leds of different colors (ideally 13) (at least 8) (have) - -- breadboard (have) - -- microphone [amazon 1](https://www.amazon.com/DAOKI-Sensitivity-Microphone-Detection-Arduino/dp/B00XT0PH10/ref=sr_1_3?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847782&sprefix=arduino+microhpone%2Caps%2C319&sr=8-3); [amazon 2](https://www.amazon.com/DEVMO-Microphone-Sensitivity-Detection-Arduino/dp/B07S4DTKYH/ref=sr_1_1_sspa?crid=28V9D1JTD845K&keywords=arduino+microphone&qid=1674847851&sprefix=arduino+microhpone%2Caps%2C319&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyWE9LSjk1MjdSOUVHJmVuY3J5cHRlZElkPUEwMzUzMTA4Sko0WDhSQzI0Wk0wJmVuY3J5cHRlZEFkSWQ9QTAwNzE2NjJZRUI4NlE3SkZCTkkmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl) - -## Arduino Project - -Describe the application you have chosen to develop and provide a motivation for why it is a useful application. Include references of all sources you have used throughout this project (URLs are sufficient). - -We plan to create a arduino board application which will take sound as an input (talking/music), take an approximation of the frequency being recorded and then display a color based on the closest note heard. The different led's will be set to correspond to specific note frequencies. This idea functions similarly to a tuner, although we hope to be able to distinguish the notes regardless of the octave. - -[robotique](https://www.robotique.tech/robotics/blink-two-leds-with-arduino/) - -[circuitbasics](https://www.circuitbasics.com/how-to-use-microphones-on-the-arduino/) - -## Agent - -Explain the characteristics/attributes of your agent, what makes it an agent (within the discussed course content), what makes it rational, what type of an agent it is, and what is its environment task (PEAS). - -It is an agent because it interacts with the outside world. this is due to its ability to record sound and display a corresponding color in response. This is rational behaviour because the output corresponds directly to the input. - -PEAS: - -Performance will be measured by its abiity to accurately show thew correct colors. - -Environment is inteded to be used in recreational spaces such as homes or studios. - -Agents will be the leds that display the various colors. - -Sensing will be done through the microphone. - -## Challenges and Learning Experiences - -Discuss any challenges you have encountered during the work on this lab and describe what have you learned. - -Our first biggest challenge for this lab was learning how to build with an arduino board. Neither of us had extensive experience with arduino, so as such we needed to learn from scratch using online guides and tutorials. More specifically, we had difficuly learning how to connect multiple led circuits to the same ground, but were eventually able to find a suitable solution. - -Another challenge that we had was figuring out how to best use the attached mic to sample the audio frequency. At first we first using a digital input to record the mic, but this only returns a simple 0 or 1 value representing that the volume reached a certain threshold. THen we started using an analog input which could measure more finely the audio coming in. After experimenting with a few different arduino libraries, we were able to implement a way for our application to accurately sample audio. - -Finally, the last challenge we had was getting our application to consistently respond to audio input. While the application was technically working, there was a lot of jittering with the LEDs as the noise coming in was very chaotic and non-frequent. To remedy this, we decided to sample multiple audio signals at once and then use only the highest frequency. Furthermore, we added a very short delay after an LED turns on before the program tries to re-sample or order to help make the application feel more consistant. - -We learned a lot from this project, mostly relating to arduino circuits and programming, but also some about how audio inputs and led outputs function. We feel that if we were to try another arduino project again in the future, we would be able to tackle it with much greater efficiency. - -## Ethical Benefits and Implications - -In this section, drawing on class discussions and readings, answer the following questions - -1. What entities, businesses, organizations do you envision developing the type of the application you have chosen to develop? This type of application would largely be developed by a company specializing in recreational objects, such as toys. However, there would also be potential in the audio industry, such as a company looking to create a visually interactive microphone, speaker or instrument. - -2. Who are the intended users of this technology? This technology would like be used by those in the audio industry. This application funcions purely for aesthetics, with a little functionality for direct audio feedback. As such, it could easily be used by anyone for personal purposes. - -3. Who is not supposed to use this technology? While I cannot think of anyone who should strictly speaking not use this technology, it would be preferable to avoid people using this technology as a replacement for instrument tuners, as it does not distinguish between notes of a different octave. - -4. How can the application developed in this lab cause harm? The most damage this application could do is through incorrect use by using it as an instrument tuner. This application is not capable of causing any bodily harm. - -5. What solutions could be implemented to avoid the harm or to fix the harm described above? As the application functions too differently to be used as a tuner, the user should be able to determine its usefulness lies in a different area. - -## Team Work - -For our team, we decided to split the work load based on each of the tasks requried from the team as a whole. Both of us worked on acquiring all of the necessary materials and planning out the project as a whole. Once we had all the materials, we split the work load as follows. Max worked on building the arduino board and testing the functionality of the componants, and David worked on programming the arduino board in order to build our application with our goals in mind. Although we did split tasks at a higher level, both of us did end up having a hand in all aspects of the project such as building and programming the arduino, as both tasks were easier to accomplish with a wider range of ideas.