Buzzer Reacts to a Specific RGB LED Color

BUZZER REACT TO A SPECIFIC RGB LED COLOR:

Introduction:
In this tutorial it will be explained that how buzzer reacts to a specific RGB color. For example, it could be an alarm for specific situation, which is defined by colors. That is, as the color of RGB changes, the alarm sound changes and has a specific meaning.
Note: This tutorial only focuses on one color and one sound. Based on, different voltage and different RGB colors, buzzer could be applied for more kinds of notes and sounds.
Parts list:
• Arduino UNO (1)
• Breadboard (1)
• RGB LED (1)
• Jumper wire (11)
• 330 Ohm resistor (3)
• Piezo element (1)
• Potentiometer (1)

How to set up:
The first thing should be done is assembling all parts on the breadboard. Then, start coding.
Note1: Be sure that RGB led legs are connected correctly (in terms of colors and Common leg which is connected to GND without resistor).
Note2: Most LEDs are designed to work with a voltage between 1.5v and 3v. As most microcontrollers (including the Arduino) operate on 5 volts a current limiting resistor is required.
The following diagram shows how to assemble the parts on the breadboard:
instruction

Your final assembly should be something like this:

photo(3)

Code:
Please note that your Arduino must not be connected to the computer. Otherwise, the power might damage or burn out the parts. The code is as follows and next to each part it is explained what each part does.

Now to see the result, plug in your Arduino, upload your code and tern the potentiometer. The result should be like this video:
Video

Many thanks.

2 thoughts on “Buzzer Reacts to a Specific RGB LED Color”

  1. I m using RGB color sensor(adc output sensor). I want to detect the blue color using Arduino code..can u plz give me the solution

Leave a Reply

Your email address will not be published. Required fields are marked *