OLED VU Meter for transformer preamp

Started by jfrabat, August 24, 2020, 07:02:02 PM

Previous topic - Next topic

jfrabat

Hey, guys.  I got a question for you.  I heard some good things about the kits from Five Fish Audio, and I decided to try one of their pre-amps to see what's what.  I ordered one of their [urlhttp://micpreampkit.com/]DP-1010 Mic Preamp Kits[/url], and I was planning on using the same enclosure as my 4-Band Semi Parametric EQ and the Compressor (which is to say, a Hammond 1402B), as it does not come with an enclosure.

Now, the preamp has a small OLED display up front with the channel name and some other indicators. 



One thing that it is missing, though, is a VU meter (which is not really mandatory, but it is useful, and looks pretty cool).  It does have a dB indicator, but the meter looks much nicer in my opinion!  Since I have a lot of space in the enclosure, I figured I could add one.  Then I thought that a traditional VU meter would not match with the OLED screen and clash (design-wise).  But then I thought: "I have a bunch of those screens at home for use with my Arduinos...  What if I make a VU meter with the arduino?"

A few minutes later, I made a VU meter with Arduino and one of those screens.  Here is the result (I have a jack connected to the headphone jack of the tablet feeding it some music):



The only question I have now is if you think the VU Meter (ie. the Arduino) will introduce noise into the signal path (I am planning to use a L7805 to reduce voltage to 5V for the Arduino and I also need to share the GND with the audio signal for the VU Meter to work).  Let me know what you think.
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

PRR

> what you think.

I think you have to try it.
  • SUPPORTER

11-90-an

Will a 100 ohm resistor from audio ground to your VU meter ground throw your readings off?

Or maybe a diode (i.e. 1n400x) instead of that resistor... you just have to compensate the extra 0.6~0.7v in your programming

However, if you also put a diode in between your audio signal out to your VU meter "sound in", in theory, you shouldn't have to reprogram anything... as the both + and - would go down and up together... (given your diodes ahve the same forward voltage drop... if that!s what it's called... :icon_biggrin:)

Now i'm wondering if what i said makes sense... :icon_confused:

Time to buy some OLED Displays.... those things look cool! :icon_cool:
flip flop flip flop flip

Slowpoke101

This thing looks like fun.
Do you have the Arduino code available?
Want to play.... :icon_mrgreen:

  • SUPPORTER
..

pruttelherrie

Quote from: Slowpoke101 on August 25, 2020, 05:35:54 AMDo you have the Arduino code available?

This.

Looking at the schematics (last pages of the assemblyguides) it looks like the output of the buffer/driver of the preampboard, is already flatcable'd to the logic board (signals "SIG+" and "SIG-") but they are not connected to the ESP32 on the logicboard?!? *scratch*

If the ESP32 can read this output (hotwire?) and you have the code, you can implement the VU yourself.

By the way, the dB on the display is the gain setting, not the signal value.

jfrabat

Quote from: pruttelherrie on August 25, 2020, 07:04:26 AM
Quote from: Slowpoke101 on August 25, 2020, 05:35:54 AMDo you have the Arduino code available?

This.

Looking at the schematics (last pages of the assemblyguides) it looks like the output of the buffer/driver of the preampboard, is already flatcable'd to the logic board (signals "SIG+" and "SIG-") but they are not connected to the ESP32 on the logicboard?!? *scratch*

If the ESP32 can read this output (hotwire?) and you have the code, you can implement the VU yourself.

By the way, the dB on the display is the gain setting, not the signal value.

My intention is not to re-code the internal IC; I will add an Arduino (and another screen), which will connect to the output and measure from there...

Quote from: Slowpoke101 on August 25, 2020, 05:35:54 AM
This thing looks like fun.
Do you have the Arduino code available?
Want to play.... :icon_mrgreen:


Sure.  Here is the one I am using:

Quote
/*  OLEDMeter was written to utilize any 128x64 display. I have only seen marginal attempts to
*  animate meters and I hope this one will set a standard. Please feel free to modify and share
*  this code for any 128x64 LCD or OLED. OLEDMeter sketch was written for use with I2C SH1106.
*  This code must be modified to work with other display devices.

*  Working portion of code was taken from Adafruit Example Sound Level Sketch for the
*  Adafruit Microphone Amplifier
https://learn.adafruit.com/adafruit-microphone-amplifier-breakout/measuring-sound-levels

*  Remaining code was written by Greg Stievenart with no claim to or any images or information
*  provided in this code. Freely published May 26, 2016.

*  Software to convert background mask to 128x64 at: http://www.ablab.in/image2glcd-software/

*  IMPORTANT: Sound source must be grounded to the Arduino or other MCU's to work. Usually the
*  base sleeve contact on TRS or TRRS connector is the ground.
*/

#include <Wire.h>                     // requried to run I2C SH1106
#include <SPI.h>                      // requried to run I2C SH1106
#include <Adafruit_GFX.h>             // https://github.com/adafruit/Adafruit-GFX-Library
#include <Adafruit_SH1106.h>          // https://github.com/wonho-maker/Adafruit_SH1106

#define OLED_RESET 4                  // reset required for SH1106

Adafruit_SH1106 display(OLED_RESET);  // reset required for SH1106

int analogInput = A0;                 // analog input for outside audio source
int hMeter = 65;                      // horizontal center for needle animation
int vMeter = 85;                      // vertical center for needle animation (outside of dislay limits)
int rMeter = 80;                      // length of needle animation or arch of needle travel

const int sampleWindow = 50;          // sample window width in mS (50 mS = 20Hz)
unsigned int sample;

// VU meter background mask image:
static const unsigned char PROGMEM VUMeter[] = {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x60, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x09, 0x04, 0x80, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x01, 0x98, 0x08, 0x06, 0x03, 0x80, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0xA4, 0x10, 0x09, 0x00, 0x80, 0x21, 0x20, 0x07, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0xA4, 0x10, 0x06, 0x03, 0x00, 0x20, 0xC0, 0x00, 0x80, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x71, 0x80, 0xA4, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x0A, 0x40, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3C, 0x00, 0x00,
  0x00, 0x00, 0x3A, 0x40, 0x00, 0x00, 0x02, 0x01, 0x00, 0x40, 0x80, 0x07, 0x00, 0x20, 0x00, 0x00,
  0x00, 0x00, 0x42, 0x40, 0x00, 0x08, 0x02, 0x01, 0x08, 0x40, 0x80, 0x00, 0x00, 0x38, 0x00, 0x00,
  0x00, 0x00, 0x79, 0x80, 0x04, 0x08, 0x02, 0x01, 0x08, 0x81, 0x10, 0x00, 0x00, 0x04, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x02, 0x01, 0x08, 0x81, 0x11, 0x04, 0x00, 0x38, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x02, 0x01, 0x08, 0x81, 0x21, 0x04, 0x00, 0x00, 0x08, 0x00,
  0x00, 0x00, 0x00, 0x84, 0x02, 0x04, 0x0F, 0xFF, 0xFF, 0xC3, 0xE2, 0x04, 0x00, 0x00, 0x08, 0x00,
  0x00, 0x00, 0x00, 0xC2, 0x01, 0x07, 0xF0, 0x00, 0x00, 0x3B, 0xFE, 0x08, 0x40, 0x40, 0x08, 0x00,
  0x00, 0xFE, 0x00, 0x62, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xE8, 0x40, 0x80, 0x7F, 0x00,
  0x00, 0x00, 0x00, 0x21, 0x1E, 0x00, 0x04, 0x00, 0x80, 0x00, 0x7F, 0xFE, 0x80, 0x80, 0x08, 0x00,
  0x00, 0x00, 0x03, 0x31, 0xE0, 0x00, 0x04, 0x00, 0x80, 0x04, 0x01, 0xFF, 0xC1, 0x00, 0x08, 0x00,
  0x00, 0x00, 0x07, 0x1E, 0x00, 0x40, 0x00, 0x00, 0x00, 0x04, 0x00, 0x1F, 0xFA, 0x00, 0x08, 0x00,
  0x00, 0x00, 0x07, 0xF0, 0x00, 0x40, 0x3B, 0x07, 0x60, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x34, 0x81, 0x90, 0xCC, 0xC0, 0x00, 0x3F, 0xC0, 0x00, 0x00,
  0x00, 0x00, 0x0C, 0x00, 0x03, 0x30, 0x0C, 0x82, 0x90, 0x53, 0x20, 0x00, 0x07, 0xF8, 0x00, 0x00,
  0x00, 0x00, 0x70, 0x40, 0x00, 0xC8, 0x3B, 0x02, 0x60, 0x53, 0x20, 0x00, 0x00, 0xFE, 0x00, 0x00,
  0x00, 0x01, 0x80, 0x20, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x4C, 0xC0, 0x00, 0x00, 0x3F, 0x80, 0x00,
  0x00, 0x06, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x00,
  0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFC, 0x00,
  0x00, 0x30, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00,
  0x00, 0x00, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
  0x00, 0x00, 0xA0, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x02, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x06, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x8C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x70, 0x19, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const unsigned char PROGMEM FRabat []  = {
  B00000000,B00000000,B00000000,B00010100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00010001,B11111111,B11111111,B11111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B01111111,B11111111,B11111111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B01111111,B11111111,B10000000,B00000000,B00000111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B01000000,B00000111,B10000000,B00000000,B01111111,B11111111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00000000,B00000111,B00000000,B00000001,B11111111,B11101111,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00000000,B00000111,B00000000,B00000111,B11100111,B00000000,B11100000,B00000000,B00000000,B00000100,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00000000,B00001110,B00000000,B00000011,B10000111,B00000000,B11100000,B00000000,B00000000,B00001100,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00000000,B00001110,B00011000,B00000010,B00001110,B00000000,B11100000,B00000000,B00000000,B00001100,B00000000,B00000000,B11000000,B00000000,B00000000,
  B00000000,B00011111,B11111100,B00000000,B00001110,B00000000,B11000000,B00000000,B00000000,B00011100,B00000000,B00000001,B11000000,B00000000,B00000000,
  B00000011,B11111111,B11111100,B00000000,B00001110,B00000001,B11000000,B00000000,B00000000,B00011000,B00000000,B00000001,B10000000,B00000000,B00000000,
  B00000111,B11111100,B00011000,B00000000,B00001100,B00000001,B10000000,B00000000,B00000000,B00011000,B00000000,B00000001,B10000000,B00000000,B00000000,
  B00000000,B00111000,B00011000,B00000000,B00011100,B00001111,B00000000,B00000000,B00000000,B00110000,B00000000,B00000011,B10000000,B00000000,B00000000,
  B00000000,B00111000,B00011000,B00000000,B00011100,B00111110,B00000000,B00000000,B00000000,B01110000,B00000011,B11111111,B11111111,B11111111,B11111111,
  B00000000,B00111000,B00011000,B00000000,B00011001,B11111100,B00000000,B00000000,B00000000,B01100000,B00000001,B11111111,B11111111,B11111111,B11000100,
  B00000000,B01111000,B00000000,B00000000,B00011111,B11110000,B00000000,B00000000,B00000000,B01100000,B00000000,B00000111,B00000000,B00000000,B00000000,
  B00000000,B01110000,B00000000,B00000000,B00111111,B11000000,B00000000,B00000000,B00000000,B11000000,B00000000,B00000111,B00000000,B00000000,B00000000,
  B00000000,B01100000,B00000000,B00000000,B00111111,B11000000,B00000000,B00000100,B00000001,B11000000,B00000000,B00001110,B00000000,B00000000,B00000000,
  B00000000,B01100000,B00000000,B00000000,B00111011,B11100000,B00000000,B00111110,B00000001,B11000000,B00000010,B00011110,B00000000,B00000000,B00000000,
  B00000000,B11100000,B00001100,B00000000,B00110001,B11111000,B00000000,B11111111,B00000111,B10011000,B01111110,B00111010,B00000000,B00000000,B00000000,
  B00000000,B11100000,B00001100,B00000000,B01110000,B01111110,B00000000,B11101111,B00001101,B10000100,B11111110,B00110011,B00000000,B00000000,B00000000,
  B00000000,B11000000,B00000000,B00000000,B01110000,B00011111,B00000000,B11111110,B00011101,B10001100,B11111111,B01100000,B00000000,B00000000,B00000000,
  B00000001,B11000000,B00000000,B00000000,B01110000,B00000111,B10000000,B01100110,B00110001,B11111100,B01110011,B11100000,B00000000,B00000000,B00000000,
  B00000001,B10000000,B00000000,B00000000,B11110000,B00000001,B11100000,B00000111,B11100001,B11110000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00000000,B00000000,B00000000,B00000000,B11100000,B00000000,B01100000,B00000011,B11000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
  B00000000,B00000000,B00000000,B00000000,B01100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000
};

void setup(){

  pinMode(analogInput, INPUT);                             // analog input for outside audio source
  display.begin(SH1106_SWITCHCAPVCC, 0x3C);                // needed for SH1106 display
  display.clearDisplay();                                  // clears display from any library info displayed

  display.clearDisplay();
  display.drawBitmap(2, 20,FRabat,120,26, 1); 
  display.display();
  delay(3000);
}

void loop(){

/***********************************************************************
Start of code taken from Adafruit Example Sound Level Sketch for the
Adafruit Microphone Amplifier
************************************************************************/
 
  unsigned long startMillis = millis();                    // start of sample window
  unsigned int PeaktoPeak = 0;                             // peak-to-peak level
  unsigned int SignalMax = 0;
  unsigned int SignalMin = 1024;

  while ( millis() - startMillis < sampleWindow ){

    sample = analogRead(analogInput);
    if (sample < 1024) {

      if (sample > SignalMax){

        SignalMax = sample;                                // saves just the max levels
      }

      else if (sample < SignalMin){

        SignalMin = sample;                                // saves just the min levels
      }
    }
  }

  PeaktoPeak = SignalMax - SignalMin;                      // max - min = peak-peak amplitude
  float MeterValue = PeaktoPeak * 330 / 1024;              // convert volts to arrow information

/****************************************************
End of code taken from Adafruit Sound Level Sketch
*****************************************************/
 
  MeterValue = MeterValue - 34;                            // shifts needle to zero position
  display.clearDisplay();                                  // refresh display for next step
  display.drawBitmap(0, 0, VUMeter, 128, 64, WHITE);       // draws background
  int a1 = (hMeter + (sin(MeterValue / 57.296) * rMeter)); // meter needle horizontal coordinate
  int a2 = (vMeter - (cos(MeterValue / 57.296) * rMeter)); // meter needle vertical coordinate
  display.drawLine(a1, a2, hMeter, vMeter, WHITE);         // draws needle
  display.display();
}

Most of the code I got from here:
https://forum.arduino.cc/index.php?topic=403234.0

Added very little myself (why re-invent the wheel, right?)

You can adjust the needle with MeterValue or with the arc of the meter rMeter
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

jfrabat

Quick question about this; I was thinking that since the preamp is balanced, it would be wise to use a buffer.  I am thinking a unity-gain buffer with a TL071.  That should do the trick , right?

I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).

11-90-an

Yes, a buffer would be nice...
Maybe use a tl072 and put one on the input and one on the output? (Unless you did that already.. :icon_biggrin:)
flip flop flip flop flip

jfrabat

#8
Quote from: 11-90-an on August 31, 2020, 01:06:07 AM
Yes, a buffer would be nice...
Maybe use a tl072 and put one on the input and one on the output? (Unless you did that already.. :icon_biggrin:)

I thought about it.  But (1) the Arduino is not fast enough for both, and (2) I don't think (not 100% sure) I have space for both (both in the front panel and inside for another Arduino).  Keep in mind this box will house the power transformer, the power supply, the input transformer, the output transformer, the XLR board, the logic board, the main board, and the Arduino board!  And I am considering including an unbalanced TRS (or mono) output...

EDIT:  This is how it looks so far.  I still need to connect the power source and the main power transformer.  Input and Output transformers have not yet arrived, but I also need space in the front for the power switch and the Power LED.



Enclosure will be a Hammond 1402FV, which is 10" long and 7" wide (space for board is actually less, as it has the thick aluminum rails on the side for mounting the enclosure, which is why I am keeping it at 6" wide).
I build.  I fix.  I fix again.  And again.  And yet again.  (sometimes again once more).  Then I have something that works! (Most of the time!).