Introduction: Classroom Volume Light

This project is a classroom volume sensing light. When completed, this project is a light that can be brightened or dimmed using a potentiometer. An additional feature of this project is that when there is excessive sound in a classroom, a red light turns on to alert students that the volume is too high. The threshold for excessive volume can also be set with a potentiometer on the sound sensor module.

I chose to create this project because I feel like it can be useful in a classroom setting. Often, students become incredibly loud in the classroom without realizing how loud they have become. It is my hope that through using this light, I can alert students that they are getting too loud without having to repeatedly tell students that they are being too noisy.

I would recommend this project to someone who has at least some experience with Arduinos because the circuit is complicated. Please see the video for a demonstration of how the light works.

Supplies

Here is a complete list of the supplies I used for this project

  • Arduino Uno
  • Breadboard
  • Sound Sensor Module (with four pins so it is analog capable)
  • Potentiometer
  • 2 Red LEDs
  • 4 White LEDs
  • 6 330 Ohm resistors
  • 14 wires of varying lengths
  • Arduino Create web editing software

Step 1: Connect Breadboard to Arduino UNO

Connect the breadboard to the UNO by connecting the positive rail to the 5V socket and the negative rail to the ground socket.

Step 2: Connect First LED

Place a white LED into the breadboard. Connect the cathode side of the LED to the negative rail of the breadboard with a 330 Ohm resistor.

Then, connect the anode side of the LED to the ~6 socket of the UNO. IT IS VERY IMPORTANT that you connect all white LEDs to plus width modulation (PWM) capable sockets so they are adjustable.

Step 3: Connect All Other White LEDs

As in step two, place three more white LEDs into the breadboard and connect their cathode sides to the negative rail with 330 Ohm resistors.

Connect the anodes of the LEDs to the UNO with wire at the ~9, ~10, and ~11 sockets. In the images, the white LEDs are connected with blue wire. You can see that all white LEDs are connected to PWM sockets.

Step 4: Connect Red LEDs

As with the white LEDs, place the red LEDs into the breadboard and connect their cathode sides to the negative rail with 330 Ohm resistors. Connect the anodes of the LEDs to the UNO at sockets 12 and 13. These sockets do not need to be capable of PWM because these lights are either going to be in HIGH or LOW, not at a level in between.

In the images above, the red LEDs are connected to the UNO with orange wires.

Step 5: Attaching the Sound Sensor Module

The sound sensor module for this project has four pins. The leftmost pin is analog output, the second pin from the left is for grounding, the third pin from the left is connected to power, and the rightmost pin is a digital output.

For this project, we are using analog output.

Place the sound sensor module into the breadboard. Connect the third pin from the left to the positive rail with a wire. Connect the second pin from the left to the negative rail with a wire. Connect the leftmost pin to the Arduino UNO at the socket A0.

Step 6: Connecting Potentiometer

Connect the potentiometer to the breadboard. Connect the left pin to the positive rail with a wire. Connect the right pin to the negative rail with a wire. Connect the center pin to the Arduino UNO at A1.

Step 7: Check Circuit, Upload Sketch

This is a diagram of the circuit that I created on Tinkercad. Unfortunately, Tinkercad does not have a sound sensor module in its database so I substituted it with the ultrasonic distance sensor. If you build this project in Tinkercad, it will not work properly. However, I wanted a clear diagram of what the wiring looked like so I created this picture.

Check that your wires are inserted properly into your breadboard and your UNO.

Then, upload this sketch to your UNO.

If it is working properly, the white lights should come on and be controlled by the potentiometer. When there is a loud noise, the red lights should come on as well.

About the sketch:

The sketch I wrote for this project is respectively simple. I initialized the sensors and lights to their sockets so I could name them instead of using the socket numbers. I set the potentiometer and the sound sensor as input and the lights as output. By mapping the potentiometer to the LED, I was able to set the input bounds of the potentiometer (1-1024) to the range of the output bounds (1-255). This makes it so the potentiometer can easily control the light output of the LEDs. For the sound sensor module, I set a conditional so that below the threshold of 50, the red LEDs remain off. However, once the threshold is met or exceeded, the red LEDs turn on to inform the students they are too loud.

Step 8: Troubleshooting

If you are having trouble with your project try the following things:

  • If a single LED does not turn on, check that your LED is facing the right direction. The longer side is the anode and should be connected to the UNO. The shorter side, the cathode, should be connected to the negative rail of the breadboard.
  • If the red LEDs do not come on when you are being loud near the sound sensor module, try adjusting the potentiometer on the sound sensor module, it looks like a small flat head screw.
  • If the white LEDs do not change brightness properly, check that they are attached to PWM-capable sockets (they have a tilde ~ next to the number) or check that the potentiometer is connected correctly.

I hope you enjoy this project if you try it!