Saturday 25 May 2019

led - Amplifying an audio signal



Preface


Essentially, I want to use the analog signal coming out of my smartphone when I play music to modulate LEDs and piezo electric elements. Initially, I thought that if the raw power output is enough to power small headphones and such, then it should be enough to make a piezo and LED do something. However, nothing happens when I plug them in.


I have two piezos which are much larger in diameter than my other ones, but they seem to work (i.e. I can hear the music, albeit it's very tinny). I guess diameter is not really a good metric though, but the one which works best has a voltage range of 3-24V, whereas the smaller one which I want to use (but isn't working) has an input range of 3-6V. I tried playing with the volume (which I imagine increases/decreases the amplitude of the signal in terms of its output voltage), but no luck.


So I need to get a piezo working, and a LED. A secondary problem I see with the LED (which is my suspicion as to why it's not working) is the fact that it can only really be on or off ... it's not an analog device. So in order for it to respond the way I want it to to my music, I think I would have to digitize the signal? Though, my signal from the mp3 player is a square wave, so in a sense it should be digital anyway.


Now, on to my question:


How can I achieve what I want (that is, to modulate a piezo and a few LEDs based on the input from my mp3 player)? I have been reading about signal processing, and it seems like I can do this analog or digital. I have a pretty good amount of experience with AVR microcontrollers and embedded systems in general, but not so much with signal processing. Would the simplest way to do this be to use an op amp? I have no problem using an external power source for the piezos and LEDs and modulating that. Or would I need to do a whole DSP thing with an ADC to DAC.


Another way to amplify the signal (even if the gain is unity, I just need to modulate these things) I found is described here using something called an "audio output transformer". I have no idea how this works, but it seems to do the job.


I know an oscilloscope would help a lot, and mine is on its way. I tried to figure out what the audio signal looks like with my multimeter, but I think the response time simply isn't good enough.




Answer



Capcom, while this isn't an odd question it is one that we are tired of answering. Please don't take this as an offence or insult. I only mean to inform you of why people are not answering it. Then, I will "somewhat" answer it! Do not let people's response to your question at all discourage you from perusing your goal.


This question, in many different forms, gets asked every couple of weeks. It has been answered, a lot. Well, the part about driving an LED with audio has been asked/answered a lot. It is also a difficult question to answer, because almost always the people who ask it are in a little over their heads. I am not saying that you are in over your head, only that most people who ask this are. So to answer this question properly, we usually have to start with the basics of electronics and audio. This takes a lot of time, and we get tired of doing it over and over for essentially the same question.


I suggest that you search for previous questions/answers for the information you need. I also suggest that you do a Google search for "color organ".


As for the piezo problem... You describe your results so far as sounding tinny. All practical piezos will sound tinny. The way you get around that is to not use a piezo. Piezos also are not very loud. Odds are that the small piezo that you used did make a sound but it was too soft to be heard. The third problem is that piezos are only good for making noise in a small frequency band, which is great for making beeps but terrible for reproducing audio.


The normal way to make a piezo work is to use some sort of amplifier. It doesn't have to be a particularly powerful amp, but the output voltage needs to be a range similar to what the piezo is expecting and the amp needs to be able to drive a capacitive load. For the most part, that means that the amp is actually a bit more powerful than what would normally be required.


But really, the best way to fix your piezo is to not use a piezo. Use a normal speaker instead. When you do that, you'll probably still need an amplifier to drive it, but there are many chips and circuits that you can find to do that. TI makes a bunch of amp chips that are easy to use.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...