MUSIC REACTIVE RGB LED / MOOD LIGHT
by Kimanzi254 in Circuits > Audio
700 Views, 3 Favorites, 0 Comments
MUSIC REACTIVE RGB LED / MOOD LIGHT
RGB LEDs which stands for Red Green and Blue Light Emitting Diodes combine at different intensities to produce over 16 million hues of light. RGB LEDs are believed to be the next big leap in the light bulb technologies. They outlast and outperform existing light technologies such as the incandescent bulbs and halogen bulbs when it comes to energy efficiency and coming up with any imaginable colours.
RGB LEDs are quite popular this days, they help in enhancing the light accent of living space. Mood lights as they are commonly referred help to create a desired atmosphere in any room.
In this instructable, I am going to show how we can create not only a mood light but also a music reactive RGB LEDs that one can also create different colours with the help of a remote control.
LETS GET INTO IT!!!
Supplies
- Arduino pro mini x 2
- NRF24L01 x 2
- Push button x 8
- LM317 x 3
- IRFZ44N x 3
- 2N3904 x 3
- 10Watts Common Anode RGB LED
- 10KOhm x 14
- 1KOhm x 3
- 12V PSU
- Breadboard
- Jumper wires
- USB cables
- Heatsink
The Hardware
When it came to component selection I was fortunate and unfortunate to get what I needed but I had to work with what I found locally.
RGB LED for this instructable has to be 10 watts or below because of the components used. It is a common Anode RGB LED. According to the attached document the individual LEDs need to be powered by the specified voltages:-
- RED 6-7V
- GREEN 9-11V
- BLUE 9-11V
Each at 300mA.
With this information there is need of voltage regulation and current regulation circuit. Remember to attach the LED on a heatsink before powering it up. Take note of the polarities.
An N-Channel MOSFET is required since we are driving a load on the low side. IRFZ44N was used in this case, its not a logic MOSFET which is recommended to be used with the microcontroller. In my application the current passing through the MOSFET is quite low and hence we will not face issues with overheating from the MOSFET since its not fully open. Three MOSFETs were used with each being driven by a npn transistor; the simplest way to drive a MOSFET., its recommended to use a driver IC. But hey in this case I didn't find one and this one works quite well.
LM317 is an adjustable linear voltage regulator that outputs fixed voltages. In this case we wont be using it for voltage regulation but for current regulation, yes current regulation. Current devices like high power LEDs are best used when they are fed a constant current because they will maintain the same brightness no matter how much they heat up. The current is determined by the following formula:-
I = 1.25 / R
Since this is a linear regulator I wouldn't recommend currents higher than 300mA, because of heat dissipation and stability of the circuit.
The voltage source should be a voltage regulated power supply with at least 1A of current output
For wireless control the popular NRF24L01 was used. It is a transceiver which is advantageous incase of future updates. Note that this module is powered by 3.3V but its SPI pins are 5V tolerant so its can work with the Arduino. I recommend a linear power supply to be used when powering it since it is susceptible to noise which affects it.
Analogue pin A0 should be connected to the output of audio filter circuit e.g high pass filter or low pass filter for better results.
A push button both on the receiver and transmitter side is used for toggling between the two modes. Remember to include the pull-up resistors.
Make sure you double check your connections before powering anything, make the connections as short as possible especially for the radio module.
The Software
The Arduino IDE was used. The brightness of the LEDs are controlled with PULSE WIDTH MODULATION so the driver circuits should be connected to PWM compatible pins of the Arduino. The PWM can be controlled with values from 0 to 255, with 0 having a duty cycle of 0% and 255 have a duty cycle of 100%. At 0% duty cycle the pwm pins outputs 0 volts and at 100% the pwm pins outputs 5 volts. With this we can control the brightness of an LED. There exists charts with colour codes incase you want to come up with different colours.
In the case of music reaction, analogue read function was used to help with the mapping of different RGB colours to analogue read values.
Make sure you have downloaded the required libraries and have selected the correct baud rate when mapping the values.
HOW IT WORKS
So basically this project is divided into two part:-
- Receiver side
- Transmitter side
The receiver side includes the RGB LED, LED driver circuit, Arduino and NRF24L01 module. A push button switches between the two modes. When mood light is selected, with the use of the remote one do colour mixing. In the case of Music reactive, the Arduino through pin A0 reads analogue values from the audio source and maps it to the values mapped hence mixing the colours accordingly and reacting to the music.
The transmitter or remote is used to toggle between the two modes and for colour mixing.
The Future
The project worked as expected. There is room for improvement though, especially in the hardware side. I want to get a driver IC for the MOSFET. IRFL44N being a logic MOSFET will be suitable when dealing with microcontrollers.
Probably I will replace NRF24L01 with an ESP8266 so that you can control it with you phone via WiFi.
HAPPLY BUILDING!