NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Piezoelectric Sound Meter

May 01, 2010
by CyberGod
CyberGod's Avatar

I am trying to measure the voltage between VOUT and GROUND as per this schematic http://www.nerdkits.com/videos/sound_meter/schematic.png while I am making some noise. I don't see any voltage changes on the multimeter. Does this mean that the multimeter is not sensitive enough to register the voltage change but the MTU will or am I doing something wrong ?

May 01, 2010
by CyberGod
CyberGod's Avatar

I am also getting this error when I run make:

make -C ../libnerdkits
make[1]: Entering directory `C:/Users/CyberGod/Desktop/Code/libnerdkits'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `C:/Users/CyberGod/Desktop/Code/libnerdkits'
avr-gcc -g -Os -Wall -mmcu=atmega168  -Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscan
f -lscanf_flt -lm -o soundmeter.o soundmeter.c ../libnerdkits/delay.o ../libnerd
kits/lcd.o ../libnerdkits/uart.o
soundmeter.c: In function 'main':
soundmeter.c:121: warning: unused variable 'lcd_stream'
c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr5\libc.a(log.
o): In function `log':
(.text.avr-libc.fplib+0x46): relocation truncated to fit: R_AVR_13_PCREL against
symbol `__addsf3' defined in .text section in c:/winavr-20100110/bin/../lib/gcc
/avr/4.3.3/avr5\libgcc.a(_addsub_sf.o)
c:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/lib/avr5\libc.a(log.
o): In function `log':
(.text.avr-libc.fplib+0x4e): relocation truncated to fit: R_AVR_13_PCREL against
symbol `__addsf3' defined in .text section in c:/winavr-20100110/bin/../lib/gcc
/avr/4.3.3/avr5\libgcc.a(_addsub_sf.o)
make: *** [soundmeter.hex] Error 1

Any suggestions, I am using the LCD source code.

May 01, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi CyberGod,

For your compilation problem, try editing the Makefile. At the end of the LINKFLAGS line, remove "-lm". At the end of the LINKOBJECTS line, add "-lm". Now, run "make" again and see if it works. This appears to just be a bug with certain compiler versions which are sensitive to the order of how libraries are linked.

You might not see changes on the multimeter because the sound signal is an changing (AC) signal. Your multimeter, if in a DC measuring mode, is just showing you the average value, which probably won't be affected by sound. Even in an AC mode, many multimeters may not show you what you might expect because of the DC offset.

Please give this a try and let us know if it works!

Mike

May 01, 2010
by CyberGod
CyberGod's Avatar

That did it, thank you very much for your help! Now I am going to hook the water pump and every time my cat mews in front of the door she'll get wet and hope will not wake me every morning (insert evil laugh here).

May 01, 2010
by CyberGod
CyberGod's Avatar

oh one more thing, what does the -lm flag do and where can I find more information about all these flags ?

May 01, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Poor cat... :-) Please post some photos / a video when you're done!

The -lm flag tells the linker to link the math library -- specifically libm.a. See Controlling the Linker for more details / other linker flags.

Running "avr-gcc --help" may also be a concise source of information.

Mike

May 02, 2010
by mongo
mongo's Avatar

I can't help but laugh here. That was funny! Great idea though, I might try it myself.

Post a Reply

Please log in to post a reply.

Did you know that you can build a digital read out (DRO) for a lathe or milling machine? Learn more...