Ambient ceiling lighting project for Dolby 5.1 sound for PC

So I'm taking on an ambient lighting project for my 78 inch Samsung and so far so good. I'm running an UNO. I'm currently in the middle of the project and was looking into different grabbers for PC based interaction with the Lights.. So I had this thought..

I was considering wrapping my room closer to the molding by the ceiling with WS2812's and was thinking.. Is there a grabber for 5.1 sound.. Something that could light up different parts of the room deepening on which speaker was getting sound at the moment or a level if sound. Also if there was a heavy bass sound it could light the whole room..

Your thoughts?


The only way I know that might work would be an msgeq7 chip for each channel of interest. You would need line-level analog audio signals to feed the chips. The Arduino could read the output from the chips and make appropriate colour displays on the strip

it might be possible to use something to decode dolby from the HDMI cable.. So apparently there is a Pi input board for HDMI to start with..

Input Board Link

and after lookng around i sww that someone was able to interface the uno with the pi over serial. this could be a way to get the 5.1 channel information from the pi over to the uno for starters. then we can look at what to do after the fact?

Input Shield Link

I'm sure a Pi could drive the ws2812 directly. The Arduino seems redundant. I don't know how to get that to work, but including a Pi and an Arduino just seems to be making things more complicated than they need to be.

Thats not the issue of driving the WS2812B.. its the HDMI input to decode the dolby channels.. that was the only reason i suggested to add the pi.

maybe this can be used instead directly connected to the uno.

TFP401 HDMI/DVI Decoder to 40-Pin TTL Breakout - Without Touch Link

Pk, different thought process.. We can get a split HDMI cable and use an output off it to feed this device which already decodes no problem..

HDMI-to-HDMI-Audio-Decoder Link

at that point can we take the channel information and feed 6 pins on the uno to determine the volume output of each channel's RCA and use that to control the WS2812B?

then we can do things like if the sub is loud the LEDS all turn from purple low / blue med / red high.

we could also do things like.. fun shot from channel front lest to rear right chase LEDS from both directions around a square room to the other side. so we can see the travel of the bullet. at that point the sub will be used to determined brightness of the LEDS. and the color could be anything like white or purple..

Just tossing out ideas..

Please learn how to post links properly, like this.

can we take the channel information and feed 6 pins on the uno

No, the signals would damage the Arduino. See reply #1.

Not sure how ur reply helps..

It helps by not damaging the Arduino's analog inputs. You cannot connect a line level audio signal to an Arduino analog pin without it being damaged by the negative voltages in the signal. The msgeq7 chip has an input which is designed to accept a line level audio signal. It also contains circuits that measure the volume of the signal in 7 frequency bands.

if you just want it to respond to amplitude, the simplest way to do this is with microphones placed near each speaker.....

The chip is a starting point and although the microphone idea is good it's not a clean approach toward this. Which is why the thought process of the hdmi sound decoding came into play

Well, you have a route to one potential solution. The hdmi decoder box you gave the link to, connected to an Arduino via some number up to 6 X msgeq7 chips.

And you have another potential but less resolved solution based around an RPi. You should post on the RPi forums for help on that one. It has the potential to be a simpler solution overall, avoiding the analog domain entirely. I don't think an Arduino will be necessary for that solution. It seems a little pointless to add a 16MHz processor to a 1GHz+ processor!

Hmm.. You bring up good points.. The thing in my current setup is that I have an output on my receiver that I can use right now.. I could plug the output directly to the decoder box. Then get a bread board and wire 6 rca connectors to it and order 6 of those chips then report back at that point. Can you give me an idea on how to wire the chip to the arduino please.

Thanks for all the help

Also for now I'll wire in 40 ws2812b,'s just to get things started, I would prefer to stick to the arduino for now and if later on I want to to switch over I'll do so but so far I've been working on this board and want to learn more before just giving up and switching to a new platform. I'll also go back and update the links..

Just Google "Arduino msgeq7". There are loads of examples. Just start with one chip and get that working. Then add more. You may find you don't need 6. 3 or 4 may give you the effects you want. You can combine 2 channels with a couple of resistors, for example the rear two or the centre and sub channels.

Multiple chips can share the same Arduino pins for reset and strobe but will obviously need separate analog inputs.

Tip 1: use a Nano 3. It can plug into your breadboard and has 2 extra analog pins.

Tip 2: the pins on most 3.5mm headphone sockets are not long enough to reliably connect to a breadboard, you need to make or buy an adaptor.

Good afternoon guys,

So i found this article about the MSGEQ7 which was very helpful. However i havE a few questions.

Question 1, Since i need 6 channels i assume that these chips are mono and ill need 6 chips

Queestion 2, The reset and strobe pins across the chips, can i tie them all in together to keep tings in sync and use the outputs of that to the alanolgue inputs on the UNO?

Obviously you missed my last reply.

Clearly and if I can get both channels then I only need 3.thanks..

With only 3 channels, you would loose all left/right information. I would suggest 4 chips/channels would be a good compromise. Channel 1: front left. Channel 2: front right. Channel 3: combined centre+sub. Channel 4: combined rear left+right. Or maybe add a fifth channel and keep rear left & right separate.


It seems that you cannot use more than one channel on the MSGEQ7, if you choose to do so then it will combine the channels and for this project that wont work. So i will in fact need 6 chips for processing.

I also found a very useful link for programming the chips Here


so after looking at the code for the MSGEQ7 it seems that the peak driver is what outputs the value to be processes from 0 to 1,023 which divided by 4 will allow for an input range of 0-255 for arduino and this happens 7 times per channel. Now in my case i will have to find a common frequency to look at per channel, in my case i would have to choose 160hz for the front and rear channels, and 63hz for the sub. Now that I'm looking into this more i really dont have a need for the center channel because the LED's will surround the room in a square. So there is no need for the center channel since i plan to do a chase LED from the center of each speaker location to the speaker with the active sounds.

Now my understanding is that the MSGEQ will be pulsed 7 times and those values will be logged on the alalogue pin. now in a case like that if the volume was high the 7 values trapped should be higher correct? If so then if i wanted to only keep an eye out for 160Hz then i would look at the second value of 7 for processing the two front and two rear channels. For the sub i would only need to look at the first value which corrosponds to the 63Hz range.

So logging the first and second calues i can use those numbers to determine the volume of those freaquences. This also makes me think for the sake of programming i should devide the numbers by 10.24 for processing so i get a value of 1-100 in volume values vs 0-255 thich just makes it easire to understand for volume level.

So in his code hs uses the code below to read the 7 bands and the bands are: 63Hz, 160Hz, 400Hz, 1,000Hz, 2,500Hz, 6,250Hz, 16,000Hz

for(int i=0; i <7; i++)                            // Cycle through the 7 spectrum bands

I should be able to use for the FR,FL,RR,RL channels. Can i start at 1 to remove the first value since its for the sub and i only need the second value?

for(int i=1; i <2; i++)                            // Cycle through the 7 spectrum bands

and use this for the sub since its the only value i need.

for(int i=0; i <1; i++)                            // Cycle through the 7 spectrum bands

His code

Again.. thanks for all the help guys, im no programmer but i have a basic understanding of logic and programming.