Display decibels

Im a student of 3rd grade of technical school.

My project is VU meter with 10 leds (Vu meter 10 led Tutorial (lm 3914) - YouTube). I have microphone - sound detector and 4-digit 7 segment display. I dont know how to get decibels and show it on display.

Please help me with your codes...

Why bother with an Arduino?

(I'm sure there will be suitable examples on the data sheet)

I must use arduino mega 2560.

I need code...

1st you must understand decibels. A decibel is a number that shows the relationship of two values. For instance 3dB (3 decibels) increase in POWER is twice the power. for voltage 6dB is twice the voltage - the simple formula is 20 log(10) v2/v1.

a Vu meter measures voltage from audio signal and displays it in decibels, or in other words, in a logarithmic scale rather than a linear one.

a linear scale would have 1,2,3,4,5 where 2 is twice 1 , 3 is trice 1, 4 is 4x1 or 2x2, etc.
In a log scale, 1, 2, 3 would be in DB, where 3 is twice 1, 6 is 2x1, 9 is 4x1 , etc (10log v2/v1) (for power)

so, math aside, you would use the arduino A/D (analog to digital) input to read the voltage of the audio signal. the relative changes would determine how many LEDs to light up. for instance the lowest level would light up the first led. if the voltage doubled, you would light up the 2nd LED, if it doubled again, light up the 3rd led, etc. Vu meters typically have a "Wow' scale at the end, where instead of 1,2,3 they go 10,20,30 at the very end - for very loud signals to be represented (usually and overload condition).

so , with that little high school level of understanding of decibels and their relationship to reading a voltage - it should be easy to write code. For an arduino. i wouln't bother with the math - just use a lookup table if volts =1 ligtht led 1, if volts =2 light led 1and2, if volts = 4 light leds 1,2,3, etc.

anyway, that should get you in the ball park

I must use Arduino mega 2560.

Must you now?

I cannot think of anything less appropriate. Reminiscent of the saying - "When the only tool on your belt is a hammer, every problem begins to resemble a nail."

I need code...

You need a life. :smiley: