VM-AI1i

What is VM-AI1i ? Simply, the best DIY VU-Meter ever!

VM-AI1i is a clever microcontroller-based VU-Meter and has the largest number of functions that can be found in a kit (and, maybe, in a commercial product):

  • 2x Display modes (Bar/Dot)
  • 4x Peak modes (Off/Fall/Hold auto reset/Hold manual reset)
  • 4x Meter scales (Ansi VU-Meter/1 dB @ Point/2 dB @ Point/Mectronics Scale)
  • 7x Decay (release) speed (UltraFast [8ms @ point] … UltraSlow [96ms @ point])

This mean that you can configure VM-AI1i in (2 x 4 x 4 x 7) = 224 different ways…ALL IN ONE!

And also:

  • 2x independent channel – it can be used in stereo or in dual mono mode
  • 24 point per channel – high resolution display, well above the average of VU-Meter kits
  • 1 or 2 leds per point – from 48 to 96 leds in total!
  • high sensitivity ad widely input range – from 1mVRMS to 60VRMS!
  • ultra high sample rate: 500 samples/s – captures any audio spike!
  • adjustable brightness (up to 10 levels)
  • simply user interface – easily setup
  • very compact size
  • all this using only ONE MCU!
…that’s why it’s called VM-AI1i: VU-Meter ALL IN ONE, improved!
VM-AI1i

VM-AI1i in classic (Green-Yellow-Red) color.


How it work

The hardware

To understand how the VM-AI1i works, it is convenient to start observing the following image, that represents the block diagram:

VM-AI1i Block Diagram

VM-AI1i Block Diagram – Schematic

As can be seen, there are three macro blocks:

  • Analog Stage
  • Digital Stage
  • Power Supply Stage

The analog stage is composed of four sub blocks:

  1. Preamplifier stage – after the input trimmer, that permits a level adjustment, there is the preamplifier stage. The gain of this stage is about 12dB (4V/V).
  2. Full wave rectifier stage – usually, in audio measuring, the signal is elaborated using his absolute value for retrieve all information that contains. The full wave rectifier is nothing if not an absolute value extractor. Also introduces another gain in the chain; The gain of this stage is about 14dB (5V/V).
  3. Peak detector stage – to monitor the audio spikes requires his capturing through a peak detector.
  4. LPF (Low pass filter) stage – with a fast rise speed and a medium speed release, smooths the peak signal and introduces a bit of integration to help the capture of the spikes.

The total gain of Analog Stage is about (12+14) = 26dB (20V/V) and the full scale value of the meter is about 4.95V: a 4.95/20 = 0.24V signal may be enough to drive all leds! Note that dividing the gain among the two stages a very wide band is ensured (ie, in this case, about 80..100kHz). This means that the entire audio spectrum (20Hz…20kHz) is correctly elaborated.

The digital stage, the heart of VM-AI1i, is composed of three sub blocks:

  1. MCU stage – the real heart of VM-AI1i. The MCU, that runs at 8MHz, manages all functions such:
    1. Signal’s sampling – the input signals are sampled at 500Hz which means that there is a new sample every 2ms! Audio spikes are considered as such if they last at least 4ms: VM-AI1i captures also the spikes that last less of 4ms! The ADC resolution is 10bit: there are 1024 possible inputs leves and minimum level is 20log10(1/1024) = -60dB.
    2. Signal’s elaboration – after the sampling, the signal is elaborated, that undergoes a conversion from linear scale to the scale selected (VU-Meter, 1dB @ Step etc…) and, at the end of process, the right led level is calculated. The elaboration is independent for each of the two channels.
    3. Peak – After the signal’s elaboration, there is the peak management. Depending by the Peak Mode selected, VM-AI1i calculates the hold/fall time of peak; as above, the elaboration, using very clever routines, is independent for each of the two channels.
    4. Timing – last but not least, there is the bars timing management. VM-AI1i calculates the release of bar depending by Decay Speed setup. Again, as above, the elaboration is independent for each of the two channels.
    5. Display driving – the led matrix is drived with a high refresh speed: 80Hz. Human eye, to avoid the flickering, needs at least of 25…30Hz refresh speed. VM-AI1i exceeds this value by as much as double! And at the same time is also managed the display brightness!
    6. Meter setup – at any time the user can change the configuration parameters. A software FSM (Finite State Machine) control this functionality. The configuration is stored in the internal EEprom.
  2. Transistor switch (buffer) stage – a six transistors group (three transistor per channel). Each transistor enable a 8 columns leds group.
  3. Led matrix stage – a 6 columns by 8 rows led matrix. There are six group of eight columns leds each, three group per channel. Each column can drive up to 2 leds, so, there may be up to 6x8x2 = 96 leds in total!

Finally, the Power supply stage is composed of two sub blocks:

  1. VDigital regulator – that ensure the +5VDC power supply required by the MCU (+Vd);
  2. Negative voltage converter – a charge pump IC that generates the negative voltage for the Analog stage (-Va).

The software

The most important “component” of VM-AI1i is his firmware. Obviously, the hardware is also very important, but the “power” of VM-AI1i is due to the firmware. The following image show how is “structured” the code (note: isn’t a flow chart and there are several simplifications!).

VM-AI1i Firmware

VM-AI1i Firmware structure

In the code there are two “supervisor”:

  1. Syncro Timer
  2. FSM

The Syncro Timer supervisor, as name tell, regulates the timing of all functions of VM-AI1i. The task flow is:

  1. Sampling and ADC conversion – using the ADC module of the microcontroller, it acquires the signal and does the analog to digital conversion. The sample is so represented with a 10-bit code.
  2. Vin2dB conversion – converts the 10-bit word (that can have 1024 possible codes) and returns the right level [1…24] of the display, that corresponds to the input level. This block uses an external function: the Meter Scale setup. In this way, simply changing this function (VU-Meter, 1dB @ Step, etc…) is possible to have multiple meters in one.
  3. VM-AI1i Core Algorithm – the core algorithm use the [1…24] level calculated at the previous step and calculates the codes Bar/Dot and Peak (using the Display Mode and the Peak Mode setup) for the Display Logic. Also, this block calculates the decay of the Bar (thanks to the Decay Speed setup) and the timing (fall/hold) of the Peak.
  4. Display Logic – at the end of the flow there is the Display Logic block, that, using the codes Bar/Dot and Peak, generates the the right signals (rows and columns) that controls the display. Also, using the Brigntness setup, regulates the led’s brightness.

As the image below show, the sequence is a continuous loop and work like a 4-levels pipeline; for example, when the current sample, tn, “pass” through the Vin2dB block,  the previous sample, tn-1, is elaborated by the core an the tn-2 sample is show on the display. The power of VM-AI1i is this…

VM-AI1i Firmware Pipeline

VM-AI1i Firmware Pipeline

The FSM (Finite State Machine) supervisor instead regulates the setup of VM-AI1i, and sets the right parameters in the right block. The FSM recognizes the button’s pression as interrupts and, if receives a right signal, updates the meter setup and stores the configuration in the MCU’s EEprom. Also, at startup, the FSM retrieves the configuration from the EEprom and sets all the parameters.


Technical Specifications

Parameter Specification Limit Units Comments
Input impedance 25k 10% maximum
Input gain 26 1% dB
Input BW 100k 2% Hz
Minimum input signal 1.2m V MS = 2dB @ Point
Maximum input signal 60 V Input trimmer set close to minimum
Peak detector attack istantaneous
Peak detector decay 4m 10% 2
LPF cut frequency 100 10% Hz
Bar fall time 190m 2% s DS = UltraFast
385m 2% s DS = SuperFast
720m 2% s DS = Fast
1340m 2% s DS = Normal
1450m 2% s DS = Slow
1820m 2% s DS = SuperSlow
2300m 2% s DS = UltraSlow
Peak hold time 800m 2% s PM = Peak Fall
Peak fall time 95m 2% s @ Point, PM = Peak Fall
Peak hold time 3 2% s PM = Peak Hold a.r.
Sample ratio 500 samples/s
Power Supply min. 9 V
Power Supply max. 12 V
Supply current max. 150m A Bar Mode, all leds on, Brigh. 100%

Related pages

VM-AI1i User guide

VM-AI1i Simulator

VM-AI1i Assembly step by step

VM-AI1i Video Gallery