ΣSigmaStudio Ask AI Русский Log in

how to control led by music signal

SigmaDSP & SigmaStudio NCDaudio Oct 10, 2024 00:00 6 replies Original on forum ↗
Subscribe
NCDaudio Question
Oct 10, 2024 00:00

Xin chào, tôi có một bo mạch ADAU1701 sử dụng 2 đèn LED để kiểm tra tín hiệu. Tôi không biết cách tạo một dự án để làm cho hai đèn LED đó hoạt động. Khi chân MP2 mở 3v3, đèn LED sẽ sáng.

Audio Signal Processors

hardware

problem

SigmaDSP Audio Processors

adau1701

IMG_20241010_121559.jpg
IMG_20241010_121559.jpg
DaveThib Reply
Oct 10, 2024 00:00

Hello NCDaudio,

to get something out to you quick I will attach this project that I had built years ago that uses only one LED and pulses it faster if the audio is louder therby making it brighter with the level of the audio.

It is using GPIO1 so this is MP1, you will have to change it in the project and change the register settings.

Change this to "2"

Change these registers so MP2 is the GPIO output instead of MP1

That will get your signal level LED working.

Now for a peak LED you will have to setup a threshold and a test. It is probably best to use an ABCD block with a DC cell to set the threshold. You can use the same output from the peak envelope generator used for the signal level LED.

In this project I did show the trick for making an easy threshold by using a DC cell set to 1 and then a volume control.

I will add a second project where I did some switching from the signal level. This will show you how to use the ABCD block.

Sorry, that it is a busy day so I can't build one exact project right now.

8424.ADAU1701 GPIO output to a single LED to change brightness based on level.dspproj

1325.ADAU1701 Level Sensing Audio Switchover.dspproj

Dave T

NCDaudio Reply
Oct 10, 2024 00:00

oh thanks a lot. maybe it will help me

OctopusDev Reply
Feb 18, 2025 00:00

Hello Dave! What is the maximum current that the ADAU1476 GPIOx can produce?

DaveThib Reply
Feb 18, 2025 00:00

Hello OctopusDev,

This is a great question and with the over 200 pages in this datasheet that detail is not in there. It would not be easy to answer at this point in time. All the designers have moved on to other projects and the files all stored in the archives.

They would probably have to run a simulation and that can be challenging.

It would be difficult to damage the pin unless you drive a really low impedance like below 1k. Personally, I do not like to drive LEDs directly from a pin of a DSP or microcontroller. I always use a pre-biased transistor to do it. Normally the LED will not draw more than ~10ma to get to a decent brightness and that is not a lot for a pin to drive.

Remember that there is a drive strength setting for the MP pins. But, again, it is vague, low, high etc. It would have been great in hindsight to have it be in milliamps.

Dave T

OctopusDev Reply
Feb 20, 2025 00:00

Hello Dave!

I plan to use 12 pieces of MP to control LEDs (not all of them will light up at the same time, maximum 6 of them. This is for a simple input level indicator on a mixing console). I really don't want to add 12 transistors.

ChatGPT told me that ADAU1467 gives 4 mA each MPx and it is quite acceptable to connect LEDs with a consumption of 20 mA through a 470 ohm resistor. I suppose we can't do without experiments here. Is my information similar to the truth or should I start testing with other information? Please tell me, have you perhaps seen an answer to this question on the forum?

DaveThib Reply
Feb 20, 2025 00:00

Hello OctopusDev!

I just answered a similar question, let me start with what I said there:

We used to have a block for driving serial shift register style LED driver chips to make LED meters. But, when the chip went obsolete we stopped supplying the block. There is the MAX6979 that probably could be used. It is made for SPI but it might be able to be done just using GPIO pins.

I do not like the idea of increasing the current draw on the DSP to drive a bunch of LEDs. It just makes me worried over the long term. The pre-biased transistors are fairly small and do not need any external components. I have used the DTC114Y in a lot of designs to drive LEDs and even relays.

I like the shift register type of parts. I may pick up one and experiment with it. The parts like the MAX6979 is good because of the constant current feature helps to make all the LEDS the same brightness. But, in the past I have run into issues with different colors having different brightness with the same current. I went through a lot of trouble many years ago with a design that had three colors and I had to work hard to make them all the same brightness.

Dave T