Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15574

Classroom noise detector

$
0
0

Problem I'm trying to solve:

More than half of my students have ADHD and other learning issues. The problem is sixth grade children with these issues are very loud and they don't have enough self control to sit and be quiet. When I get them quiet, they perform better (no surprise) but I'm spend most of my day telling them to stop talking, sit down, listen etc. I end up stressed out, and the kids are mad, or they ramp up so they get sent to the office. I need a different approach.

I saw something like a stop light( https://www.asistorefront.com/p-235-quiet-light-noise-monitor.aspx ) but the company selling them wants a lot of money for them ($140.00 plus shipping). It works in another classroom, so I thought I'd try to make one with my Nano, and some basic instructions. I bought the parts and built it, uploaded the code and I did get the single LED to come on, but this isn't going to work in a room with 35 kids shouting over each other. I bought a light ring to flash brighter so I could catch the kids attention. I use alarms on my computer to tell kids when to start and stop working, and the kids respond well to those, so a visual signal will most likely work really well, and I won't have to yell over them.

Ideally, the orange lights come on when a 30 dB level is reached. At 35 dB, it turns red, and at 40 dB, it starts strobing in bright red and blue.

As this is an issue every teacher is facing, I would appreciate it if someone could walk me through this beyond the simple tutorial I learned on YouTube and Elegoo's project website.

Besides hooking up the parts and then coding, which I can probably get ChatGPT to write for me... (maybe). The struggle I also had was setting the actual sound levels when adjusting the potentiometer screw. I need it to work at the dB levels, and I couldn't figure out how to dial it in to those.

// www.elegoo.com
// 2018.10.24
/*
 LED1 should be lit, showing power. LED2 indicates sound input, and the sensitivity is adjusted by potentiometer.
 There is a tiny screw on the blue potentiometer block that you can use for adjustment. Turning that
 clockwise lowers the potentiometer value, while counter-clockwise raises the potentiometer value.
 Use the potentiometer to adjust the Sound Sensor sensitivity. Turn the potentiometer
 several rotations until you see the LED2 extinguish (or just faintly blink). This might be slightly greater than
 500, if you are also watching Serial Monitor (inital adjustment), or, Serial Plotter (the latter is prefererd for observation).
 Special thanks to user CRomer, for his input and hard work!
*/

int  sensorAnalogPin = A0;    // Select the Arduino input pin to accept the Sound Sensor's analog output 
int  sensorDigitalPin = 7;    // Select the Arduino input pin to accept the Sound Sensor's digital output
int  analogValue = 0;         // Define variable to store the analog value coming from the Sound Sensor
int  digitalValue;            // Define variable to store the digital value coming from the Sound Sensor
int  Led13 = 13;              // Define LED port; this is the LED built in to the Arduino (labled L)
                             // When D0 from the Sound Sensor (connnected to pin 7 on the
                             // Arduino) sends High (voltage present), L will light. In practice, you
                             // should see LED13 on the Arduino blink when LED2 on the Sensor is 100% lit.
                             

void setup()
{
 Serial.begin(9600);               // The IDE settings for Serial Monitor/Plotter (preferred) must match this speed
 pinMode(sensorDigitalPin,INPUT);  // Define pin 7 as an input port, to accept digital input
 pinMode(Led13,OUTPUT);            // Define LED13 as an output port, to indicate digital trigger reached
}

void loop(){
 analogValue = analogRead(sensorAnalogPin); // Read the value of the analog interface A0 assigned to digitalValue 
 digitalValue=digitalRead(sensorDigitalPin); // Read the value of the digital interface 7 assigned to digitalValue 
 Serial.println(analogValue); // Send the analog value to the serial transmit interface
 
 if(digitalValue==HIGH)      // When the Sound Sensor sends signla, via voltage present, light LED13 (L)
 {
   digitalWrite(Led13,HIGH);
 }
 else
 {
   digitalWrite(Led13,LOW);
 }
 
 delay(50);                  // Slight pause so that we don't overwhelm the serial interface
}

I have an Arduino Nano with the KY-038 microphone, a 60 LED addressable RGB light ring (WS2812). I need this to run on 110 AC. How do I determine the power required for the light ring, and to step down the power to 5v for the Nano? I don't know how to power the bigger lights. And I don't know how to code the RGB lights to get the desired colors at the different dB levels. Can you suggest how to power this with the part number for the power control, and how to connect it, and code for the lighting? Thanks!

37 posts - 7 participants

Read full topic


Viewing all articles
Browse latest Browse all 15574

Latest Images

Trending Articles



Latest Images