Project tutorial
VU Meter for Audio Signal (dBu) using LCD

VU Meter for Audio Signal (dBu) using LCD © GPL3+

Simple VU meter to display audio level (dBu) on 16x2 LCD using LiquidCrystal_I2C driver library.

  • 7,222 views
  • 0 comments
  • 6 respects

Components and supplies

About this project

Background

I build a Studio Monitor Management project, and one part of that project is a VU meter, to display audio signal level in dBu. There are many ways to build VU meter, most common way is to use LED bulbs. However, to use LEDs will require many pins. Initially I plan to use 16 LEDs for each stereo channel, so in total there will be 32 LEDs! And those LEDs need to be controlled individually, although it is possible to use I2C serialization to reduce number of required pins to control those LEDs, it seems bit more complicated to build the electronic circuitry (PCB etching, soldering, and so on.... to me at least, being lazy to build those... :D ).

Along the way, I found a project KT Audio VU Meter by ThomAce (check on this link). which simplify the needs to display audio level by using an LCD (Liquid Crystal Display) without any complex electronic circuitry, only 3 resistors and 2 capacitors and standard PCB with holes should be enough. The number of segment is 14, which is also still close with my initial plan of using 16 LEDs.

This Project

Here we are, this project actually is a derivative work from ThomAce's KT Audio VU Meter, with following changes:

  • Audio level is measured in decibel (dBu), so it could reflect common audio metering
  • Range for measurement can be adjusted easily, by changing the macro definition. Default value are -25dBu to 2dBu.
  • Provides function to calibrate the VU meter, as I found the reality that the unit behaves in dynamic ways (maybe due to noises, power supply and connections, and perhaps some emotional things are involved as well :D )

Important Note

Although default values for voltage calculation parameters are provided, it is highly encouraged to perform proper voltage measurements using a multi meter at certain points (please refer to the diagram below or documentation for the calibration here).

The default values are (based on measurement in my environment):

  • Reference voltage: voltage measured at AREF pin, in millivolt (mV). Defined in macro as VREF = 1500.
  • Center voltage: voltage measured at center of voltage divider (in the middle of 100K resistors), in mV, at condition the input channel is connected to ground (see documentation). Defined in macro as VCENTER = 450.
  • Offset voltage: defined in macro as VOFFSET = 315. This value can only be displayed in Serial port, so you need to activate Serial.begin(9600) inside your void setup() coding block as following (in order to see the value for offset value):
void setup() {
    Serial.begin(9600);
}

This is the sample of offset voltage value in my environment (VREF=1500, VCENTER=450). You can check Volt L and Volt R values below, in my case are 339.55mV and 335.16mV.

Volt L: 339.55mV L data: -7.16dBu  Volt R: 335.16mV  R data: -7.28dBu  R: 10, 10 L: 10, 10 

Now, you can use the value in between or average value to be used as VOFFSET (let's say 337), then call method setReference(), typically inside the setup() block, as you can see below. You can keep default values for other parameters by using VREF and VCENTER definitions.

void setup() {
    lcd.init();
    lcd.setReference(VREF, VCENTER, 337); //this will set offset to 337 
}

In most cases, the following result with only several mV differences should be OK (in Volt L and Volt R) after adjusting vOffset, since it's quite hard to get exact zero difference.

Volt L: 2.48mV L data: -49.89dBu  Volt R: -4.84mV  R data: nandBu  R: 0, 0 L: 0, 0
 Volt L: -0.45mV L data: nandBu  Volt R: -3.38mV  R data: nandBu  R: 0, 0 L: 0, 0
 Volt L: 2.48mV L data: -49.89dBu  Volt R: -4.84mV  R data: nandBu  R: 0, 0 L: 0, 0
 Volt L: -1.91mV L data: nandBu  Volt R: -1.91mV  R data: nandBu  R: 0, 0 L: 0, 0
 Volt L: 2.48mV L data: -49.89dBu  Volt R: -3.38mV  R data: nandBu  R: 0, 0 L: 0, 0

Future Possibilities

To make calibration more easier without changing the code, it is possible to put a trimpot attached to other analog pin, and adjust the value of offset voltage using that trimpot, by comparing the adjusted value and actual reading value described above, until the difference is at the lowest, or you can set a LED that will goes on/off when the difference between trimpot voltage value and actual reading value is within acceptable range (let's say tenths of millivolts).

Code

Sample program of using LCD_VUArduino
/***************************************************
 * This is an example on using LCD_VU.
 * This example has been created using Arduino Uno 
 * 
 * You will need LiquidCrystal_I2C library in your system
 * 
 * Aug 10th, 2020
 * *************************************************/

#include <LCD_VU.h>

/****************** Definition for audio input pins *******************/
#define pinAudioLeft    A3
#define pinAudioRight   A2

/******************* LCD declaration **********************
 * 1st argument: address of LCD with I2C backpack, this address may vary between LCD device
 * 2nd argument: number of columns
 * 3rd argument: number of rows
 * 4th argument: analog pin for audio input left channel
 * 5th argument: analog pin for audio input right channel
 * ********************************************************/
LCD_VU lcd (0x127, 16, 2, pinAudioLeft, pinAudioRight);

void setup() {
    // Activate Serial if you want to debug or calibrate
    Serial.begin(9600);

    // You need to call this method to initialize LCD_VU
    lcd.init();
    
    /****** The introduction block ******/
    lcd.setCursor(0,0);
    lcd.print("* dBu VU meter *");

    lcd.setCursor(0,1);
    lcd.print("--");
    lcd.print(lcd.getVersion());
    lcd.print("--");

    delay(2000);
    lcd.clear();
    /****** End of The introduction block ******/

    /**** call this method to calibrate the VU meter ****
    * No need to call this method if with using standard values,
    * display has been displayed properly.
    * Default value are (as measured in my test environment)
    * - vRef = 1500mV
    * - vCenter = 450mV
    * - vOffset = 315mV
    * 
    * The values below are only for an example, you need to
    * do measurement using voltmeter on the points mentioned below 
    * to get better accuracy. 
    * 
    * 1st argument: reference voltage (in millivolt/mV) at pin AREF
    * 2nd argument: center voltage at voltage divider (in mV)
    * 3rd argument: offset voltage, check voltage at Serial printout 
    *               when audio input is connected to ground. Use 
    *               absolute value only (remove negative sign).
    *               You need to activate Serial for this purpose. 
    * ***************************************************/
    // Unremark the following codes if you need it
    
    // use this if necessary, values are only for sample
    //lcd.setReference(1800, 800, 200); 
    
    // or if you need only to set offset value, and keep the rest the same
    //lcd.setReference(VREF, VCENTER, 200);
}

void loop() {
    // call this method to refresh data readings and display VU meter
    lcd.loop();
}
LCD_VU library
This is the library to be used in building VU meter using LCD. You need to include the library in the code. Example on how to use the library is provided, along with documentation on how to do calibration and also references.

Schematics

LCD_VU Sketch
This is the wiring schematic sketch file using Fritzing
lcd_vu_meter_qu9DUdXJ6g.fzz
Wiring Schematic
This is the wiring schematic diagram
Lcd vu meter kopfrugmcq

Comments

Author

Damar k
deltakilo
  • 1 project
  • 0 followers

Additional contributors

Published on

August 11, 2020

Members who respect this project

RwswoffordDamar kAoh14gg3y6msey1wm2ux ff4h9ozsnmxe3iagw0cga3vgw=s96 cDefaultIcon square orangewhite 120x120

and 2 others

See similar projects
you might like

Similar projects you might like

2 x 16-Band Audio Spectrum Analyzer with LCD

by shajeeb and ThomAce

  • 11,849 views
  • 3 comments
  • 12 respects

Stereo NeoPixel Ring VU Meter

Project showcase by ericBcreator

  • 115,933 views
  • 373 comments
  • 206 respects

KTAudio VU Meter

by ThomAce

  • 10,019 views
  • 3 comments
  • 13 respects

Simple Vu Meter Using Arduino

Project tutorial by edison science corner

  • 10,708 views
  • 0 comments
  • 2 respects

Temperature Monitor with DHT22 and I2C 16x2 LCD

Project tutorial by adrakhmat

  • 41,633 views
  • 18 comments
  • 55 respects

Tiny Tune: Optimized Audio Playback

Project tutorial by Jonathan Schneibel

  • 4,630 views
  • 2 comments
  • 12 respects
Add projectSign up / Login