Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

First project, audio spectrum analyser.

Status
Not open for further replies.

serj.t.s

New Member
First project, audio visualization.

Hi, I'm still very new to pic programming (and am still waiting for my programmer to arrive), for a first project I want to do something like this audio spectrum display:https://www.youtube.com/watch?v=lWTPD4bjHms
Very cool looking :p

I'm thinking of using 74154 4:16bit decoders one for the column select and the other to select a row. To have the option of selecting "bar mode" or "dot mode" I could use two independent row decoders with different wirings. And probably I'd have to buffer each output because I'm sure the decoder can't handle 16 leds(about 320mA?!).

My question relies in the processing/pic part. The guy in the video says he used band pass filters, I'm shure i'll find out how to do that with opamps. The filters can range from 30Hz to about 18Khz, probably evenly spaced between this.

Then comes the tricky part, what next? How do I get this all into a pic?

For this job I have a 16F917 with a ADC (also have a 16f59, no ADC). How can I multiplex the filter's outputs to the PIC's ADC? With a counter in the mux's select lines so the pics ports are free?

The discription in youtube says "The audio information is then digitized and converted to linear,1,2 or 3 db logarithmic scales." I don't understand this, if it is converted to a logarithmic scale it is logarithmic not linear, right? And what do the 1,2 or 3dB mean?
I know I have to use a logarithmic scale because I'm dealing with sound, so I should first convert the ADC's output(X) using something like 20logX (I assume there is an algorithm to do this :confused: ), then how should I distribuite the result to the 16 available levels?

Regarding the PIC's speed (and its ADC), will it be fast to get a good refresh rate?
If I use a multiplexer and a counter as I described above, I imagine there will be timing issues any idea how can i synchronize both? Or maybe i could use just one of the pics output pins to serve as a clock for the counter, that seems a good idea. I wanted to free up as much pins as I can because i wanted to have 32 colums(5bits needed and 32 band pass filters!!! That's a lot of opamps...) And have some kind of external controls, maybe even a LCD since the 16f917 has that function. :D

Thanks for the help and sorry about the confusing english. And thanks for the tutorials Nigel i've only reached the switch ones but they are very good!
 
Last edited:
Look on the PICList, there are details for an audio spectrum analyser using just a PIC, feeding a VGA monitor directly!.

Doesn't have as many channels as you want, but as you're not feeding a monitor you may be able to increase them?.
 
What ever happened to just flashing an LED as a first project?

PS if you don't know what dB, log, linear means wait till you hit the FFT stuff.

Since you want to tackle such a complex first project then a dsPIC would be better suited as it can do some FFT functions in hardware.
 
Last edited:
Hi, thanks for the responses.

Offcourse i know what logarithmic scale means, we use is all the time in electronics, but more often the base 10 log.
I just dind't get what the author of the youtube vid meant by 1, 2 or 3dB scale. Is it a multiplication factor? Anyway I'm passed the led flashing stuff, although i don't have a pic programmer yet I've studied a x86 setup where we explored timers, interrupts, DMA, rs232.. so flashing a led it quite basic. But you're probably right when you say it's a but overwhelming for a first project, but then again, Nigel's tutorials have it all.

I don't think i'll need FFT if i'm going to use analog bandpass filters to pass specific frequency portions, but it would in fact descrease the number of componentes because I'll have to use a lot of opamps.

It's going to be a real pain completing this..:p
 
I've finally took some steps forward to complete this, although I don't think I'll be doing the audio thingy because of the extra work, and it really is overkill for a first project.

The first step was to create the led array, and that took quite alot of time.. because i had to make a custom pcb and had never made one before! After making one came the soldering.... the pcb didn't come out that great but having to solder 256 leds and ic's and trans is very boring.. and some leds don't turn on 100% maybe with future tweaks.. it's very hard to resolder a led that's in the middle of the array(my bad pcb design).

Anyway I now wan't to make a game, like pong for the array, using the 16f917, and if there are any spare ports maybe include a lcd which i already possess. Since I'm a nwby in programming pics making the code from scratch will be... daunting:p .Does anyone by chance know of code which manipulates a similar array so I can get some ideas?

Here are some pics:
**broken link removed**
**broken link removed**
**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top