Acoustic spectrum analyzer for HD44780 LCD. This is version 2 of this device, version 1 was popular and you asked for some effects and options, so here it is :)
Changes made scince v1:
– added 5pin connector to small keyboard
– you can change backlight brightness of LCD (PWM on OC2 output), included software VFD brightness change
– change sensivity
– choice display effect (bars, lines, poles, ovals, arrows)
– options are autosaved to the eeprom memory
– added jumper (solder pads under uC) to select the prescaler for adc, if your avr is not displaying higher band due to too hign overclock of adc (solder to lower the adc clock)
– added jumper to select if you using a VFD display – device instead of controlling PWM, will be sending special data command for brightness changing.
– PCB’s for both 2*8 and 16*1 connectors displays.
The speed of refreshing mostly depends on display model, most of cheap 16*2 LCD’s have slower controllers. The fastest displays that i saw are the VFD’s, refreshing is so fast that we can not be able to see difference if it will be even faster. To make this even faster, you can overclock uC with 20MHz or more, just update the $crystal constant in program. Note that above 16MHz uC can be unstable, and issues with ADC guaranteed (i explain this at the end). But if you have slow display, even overclocking will not give any good results. In that case i have used the noritake itron CU20029ECPB-W1J, which is, as it turned out, not fully HD44780 compatible, as can be seen on my movie, it makes some difficulties while changing the user definable chars.
Device is compatible backward and vice versa, so you don’t need to make new PCB. See schematic, just solder one NPN transistor and one resistor for backlight, and attach wires to keyboard. Let me know if you want firmware with english language. On this moment device support following displays: 16*2, 20*2, 24*2, and 20*4. If you have one which this device not support, please contact me and i will try to adapt code for it – it’s not that hard, but i need you to test it, so i don’t make codes for displays that i can’t test.
Video – Prezentacja na wyświetlaczu VFD.
There are 3 ways to connect audio signal:
Below i try to explain how to setup analyzer to work with pc signal. If you want build it in amplifier or other device, note that there might be different signal strength. If you have possibility to give signal from function generator (can be from pc, or even recorded on cd-audio) this is good. In other case you will have to do this setup by “watching” music on oscilloscope.
You will need a “function generator” program, i use “FG Lite” (on download page). Connect and power-up analyzer, sound connect to line-out of your pc card, ground to Agnd. Attention – grounds can not be connected together! Function generator set to sinus, frequency 400Hz, gain at about 80%.
Left potentiometer set so that was leaning out just one bar (eventually two, depends on frequency), highest as possible. If gain be too large, you will see other leaning out bars – this is bad. Now, change generator frequency to 10KHz, and right potentiometer set in the exactly same way. Done.
You will need two programs “function generator” and a “oscilloscope”. I use “FG Lite” and “Oscilloscope 2.51 for windows 95” (on download page). Learn the basics of using a oscilloscope, how to setup line-in of your pc audio card, how to set a input gain of audio card and oscilloscope so that there was no overdrive – i will not describe that here – if you do not have an idea on what i am talking about, just make the fast callibration.
Function generator set to sinus, frequency 5KHz, gain at about 80% (on picture there is 400Hz, don’t mind that).
Left potentiometer turn right to the end, connect line-in of your pc audio card to RED point.
That should look a proper clean signal
And like that will look a overdrien signal with tops cutoff
If potentiometer is turned right to the end and despite that signal is overdriven, you will have to reduce signal from your pc, or, if nalayzer will be working in other device, you will have to add R/R divider or extra potentiometer to reduce the signal strength to proper value. If the signal is nice and clean, try to raise it a little bit by turning the potentiometer in left direction – but do not overdive. Do the same with the right potentiometer and GREEN point. Now, connect your pc audio input to BLUE point and then to YELLOW to check if signal is ok. At the end check if low-pass filter is working corectly, connect your pc audio line-in to YELLOW point, and slowly move the frequency slider from left to right, signal should vanish near 800Hz – 1KHz.
Components used in filter must be exactly as on schematic, and better if they will be new, especially capacitors. Two 470ohm resistors that makes the 2.5V reference voltage must be similar as possible. Some of avr’s (especially the new ones produced after 2008) are not susceptible to overclocking very good… program overclocks BADLY the ADC while measuring the high band signal. If you can’t see anything on the right side of display, this means that your ADC is not working. Solder the LOW PRESC jumper to reduce frequency of ADC, it will apply prescaler 4 instead of 2. If you are using VFD, solder the VFD jumper to send special brightness regulation commands instead of controlling PWM output. This can not be used together because the LCD wrongly recognize this command and its start to be unusable.
Jumpers explanation :
The author of program is user Hunterhouse, + some of my addons.
ATTENTION on 09.02.2010 i updated the attachment, programs from previous have a little bug.
DOWNLOAD – eagle 5.4.0 project files, schematic and pcb PDF’s and PNG for 2*8 and 16*2, firmware BIN and HEX and source code for displays: 16*2, 20*2, 24*2, and 20*4.
MrShilov suggested few changes in schematic. Simple modification, but spectrum will be reproduced much better. Didn’t tested this.