Components and supplies
Resistor 330 ohm
Connector Accessory, Hex Nut
Male/Male Jumper Wires
Arduino UNO
Machine Screw, M2.5
Jumper wires (generic)
RGB LCD Shield Kit, 16x2 Character Display
Breadboard (generic)
Rotary potentiometer (generic)
Male/Female Jumper Wires
Tools and machines
Multitool, Screwdriver
Apps and platforms
Arduino IDE
Project description
Code
Github Repository - VU_Meter
VU.ino
arduino
1/* 2 Mechanical VU meter 3 Author: Marco Croce 4 Version: 1.0 - 09/2021 5*/ 6 7// library used for the LCD display 8#include <LiquidCrystal.h> 9 10/* 11 Bit / Pixel Mapping to create the letters 12 and the symbols to show on the display 13*/ 14 15byte c0[8] = { 16 B11111, 17 B00000, 18 B00000, 19 B00000, 20 B00000, 21 B00000, 22 B00000, 23 B11111 24}; 25 26byte c1[8] = { 27 B11111, 28 B00000, 29 B10000, 30 B10000, 31 B10000, 32 B10000, 33 B00000, 34 B11111 35}; 36 37byte c2[8] = { 38 B11111, 39 B00000, 40 B11000, 41 B11000, 42 B11000, 43 B11000, 44 B00000, 45 B11111 46}; 47 48byte c3[8] = { 49 B11111, 50 B00000, 51 B11100, 52 B11100, 53 B11100, 54 B11100, 55 B00000, 56 B11111 57}; 58 59byte c4[8] = { 60 B11111, 61 B00000, 62 B11110, 63 B11110, 64 B11110, 65 B11110, 66 B00000, 67 B11111 68}; 69 70byte c5[8] = { 71 B11111, 72 B00000, 73 B11111, 74 B11111, 75 B11111, 76 B11111, 77 B00000, 78 B11111 79}; 80 81byte C[8] = { 82 B11100, 83 B11110, 84 B11111, 85 B11111, 86 B11111, 87 B11111, 88 B11110, 89 B11100 90}; 91 92byte R[8] = { 93 B00000, 94 B11110, 95 B10001, 96 B10001, 97 B11110, 98 B10100, 99 B10010, 100 B10001 101}; 102 103byte L[8] = { 104 B00000, 105 B10000, 106 B10000, 107 B10000, 108 B10000, 109 B10000, 110 B10000, 111 B11111 112}; 113 114// Set the LCD's pin number through the constructor 115LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 116// Range of dB values 117int valori[] = {-75, -50, -40, -30, -20, 0, 5, 10}; 118 119/* 120 Variables: 121 - valore -> The value of volts read using Arduino 122 - i -> A simple counter 123 - dbVU -> The value of dbVU obtained by valore 124 - livello -> A counter for the rectangles of the VU Meter 125 */ 126int valore = 0, i = 0; 127double dbVU; 128int livello; 129 130void setup() 131{ 132// set up the LCD's number of columns and rows 133 lcd.begin(16, 2); 134// set up the pin from which to read the value 135 pinMode(A1, INPUT); 136 137/* 138 Creation of the custom characters to be used 139 on the display 140*/ 141 lcd.createChar(1, c1); 142 lcd.createChar(2, c2); 143 lcd.createChar(3, c3); 144 lcd.createChar(4, c4); 145 lcd.createChar(5, c5); 146 lcd.createChar(6, c0); 147 lcd.createChar(7, C); 148 lcd.createChar(8, L); 149 lcd.createChar(9, R); 150 151// Loading initial screen 152 lcd.setCursor(0, 0); 153 lcd.print(" VU METER "); 154 delay(500); 155 156// Loading line 157 for ( livello = 0; livello < 16; livello++ ) 158 { 159 lcd.setCursor(livello, 1); 160 lcd.write(5); 161 delay(100); 162 } 163 164 delay(500); 165 166 lcd.clear(); 167 168 delay(500); 169 170} 171 172void loop() 173{ 174// Letter L - LEFT 175 lcd.setCursor(0,0); 176 lcd.write(8); 177// Letter R - RIGHT 178 lcd.setCursor(0,1); 179 lcd.write(9); 180 181// Delimitation symbol C 182 lcd.setCursor(15,0); 183 lcd.write(7); 184 lcd.setCursor(15,1); 185 lcd.write(7); 186 187 delay(100); 188 189// Voltage reading from the pin A1 190 do 191 { 192 valore = analogRead(A1); 193 } while ( valore <= 5 ); 194 195/* 196 1) valore*0.0049 -> Arduino reads 4.9 mV to unit, so this is 197 the conversion to volt 198 More info at: https://www.arduino.cc/reference/it/language/functions/analog-io/analogread/ 199 2) valore*0.0049/1.2 -> 1.2 represents the value of SOL ( Standard Operative Level ), used 200 to indicate the maximum level to avoid the saturation, for VU Meter is 1.2 Volt 201 3) 20*log( valore*0.0049/1.2 ) -> This is the formula to converts values from volt to 202 db for VU Meter, dbVU 203 */ 204 dbVU = (log10((double)valore*0.0049/1.2))*20; 205 206 // Setting the new rectangles 207 for (int i = 0, livello = 1; i < 7; i++) { 208 if (valori[i] < dbVU) { 209 lcd.setCursor(livello, 0); 210 lcd.write(5); 211 lcd.setCursor(livello++, 1); 212 lcd.write(5); 213 delay(50); 214 lcd.setCursor(livello, 0); 215 lcd.write(5); 216 lcd.setCursor(livello++, 1); 217 lcd.write(5); 218 } 219 } 220 221 // Removing the old rectangles 222 for (int i = 7, livello = 14; i > 0; i--) { 223 if (valori[i] > dbVU) { 224 lcd.setCursor(livello, 0); 225 lcd.write(6); 226 lcd.setCursor(livello--, 1); 227 lcd.write(6); 228 delay(50); 229 lcd.setCursor(livello, 0); 230 lcd.write(6); 231 lcd.setCursor(livello--, 1); 232 lcd.write(6); 233 } 234 } 235 236 delay(100); 237 238} 239
Github Repository - VU_Meter
VU.ino
arduino
1/* 2 Mechanical VU meter 3 Author: Marco Croce 4 Version: 5 1.0 - 09/2021 6*/ 7 8// library used for the LCD display 9#include <LiquidCrystal.h> 10 11/* 12 13 Bit / Pixel Mapping to create the letters 14 and the symbols to show on the 15 display 16*/ 17 18byte c0[8] = { 19 B11111, 20 B00000, 21 B00000, 22 B00000, 23 24 B00000, 25 B00000, 26 B00000, 27 B11111 28}; 29 30byte c1[8] = { 31 32 B11111, 33 B00000, 34 B10000, 35 B10000, 36 B10000, 37 B10000, 38 B00000, 39 40 B11111 41}; 42 43byte c2[8] = { 44 B11111, 45 B00000, 46 B11000, 47 48 B11000, 49 B11000, 50 B11000, 51 B00000, 52 B11111 53}; 54 55byte c3[8] 56 = { 57 B11111, 58 B00000, 59 B11100, 60 B11100, 61 B11100, 62 B11100, 63 64 B00000, 65 B11111 66}; 67 68byte c4[8] = { 69 B11111, 70 B00000, 71 72 B11110, 73 B11110, 74 B11110, 75 B11110, 76 B00000, 77 B11111 78}; 79 80byte 81 c5[8] = { 82 B11111, 83 B00000, 84 B11111, 85 B11111, 86 B11111, 87 B11111, 88 89 B00000, 90 B11111 91}; 92 93byte C[8] = { 94 B11100, 95 B11110, 96 B11111, 97 98 B11111, 99 B11111, 100 B11111, 101 B11110, 102 B11100 103}; 104 105byte R[8] 106 = { 107 B00000, 108 B11110, 109 B10001, 110 B10001, 111 B11110, 112 B10100, 113 114 B10010, 115 B10001 116}; 117 118byte L[8] = { 119 B00000, 120 B10000, 121 B10000, 122 123 B10000, 124 B10000, 125 B10000, 126 B10000, 127 B11111 128}; 129 130// Set 131 the LCD's pin number through the constructor 132LiquidCrystal lcd(12, 11, 5, 4, 133 3, 2); 134// Range of dB values 135int valori[] = {-75, -50, -40, -30, -20, 0, 5, 136 10}; 137 138/* 139 Variables: 140 - valore -> The value of volts read using 141 Arduino 142 - i -> A simple counter 143 - dbVU -> The value of dbVU obtained 144 by valore 145 - livello -> A counter for the rectangles of the VU Meter 146 */ 147int 148 valore = 0, i = 0; 149double dbVU; 150int livello; 151 152void setup() 153{ 154// 155 set up the LCD's number of columns and rows 156 lcd.begin(16, 2); 157// set up 158 the pin from which to read the value 159 pinMode(A1, INPUT); 160 161/* 162 Creation 163 of the custom characters to be used 164 on the display 165*/ 166 lcd.createChar(1, 167 c1); 168 lcd.createChar(2, c2); 169 lcd.createChar(3, c3); 170 lcd.createChar(4, 171 c4); 172 lcd.createChar(5, c5); 173 lcd.createChar(6, c0); 174 lcd.createChar(7, 175 C); 176 lcd.createChar(8, L); 177 lcd.createChar(9, R); 178 179// Loading initial 180 screen 181 lcd.setCursor(0, 0); 182 lcd.print(" VU METER "); 183 delay(500); 184 185// 186 Loading line 187 for ( livello = 0; livello < 16; livello++ ) 188 { 189 lcd.setCursor(livello, 190 1); 191 lcd.write(5); 192 delay(100); 193 } 194 195 delay(500); 196 197 198 lcd.clear(); 199 200 delay(500); 201 202} 203 204void loop() 205{ 206// Letter 207 L - LEFT 208 lcd.setCursor(0,0); 209 lcd.write(8); 210// Letter R - RIGHT 211 212 lcd.setCursor(0,1); 213 lcd.write(9); 214 215// Delimitation symbol C 216 lcd.setCursor(15,0); 217 218 lcd.write(7); 219 lcd.setCursor(15,1); 220 lcd.write(7); 221 222 delay(100); 223 224// 225 Voltage reading from the pin A1 226 do 227 { 228 valore = analogRead(A1); 229 230 } while ( valore <= 5 ); 231 232/* 233 1) valore*0.0049 -> Arduino reads 4.9 234 mV to unit, so this is 235 the conversion to volt 236 More info at: https://www.arduino.cc/reference/it/language/functions/analog-io/analogread/ 237 238 2) valore*0.0049/1.2 -> 1.2 represents the value of SOL ( Standard Operative 239 Level ), used 240 to indicate the maximum level to avoid the saturation, for VU 241 Meter is 1.2 Volt 242 3) 20*log( valore*0.0049/1.2 ) -> This is the formula to 243 converts values from volt to 244 db for VU Meter, dbVU 245 */ 246 dbVU = (log10((double)valore*0.0049/1.2))*20; 247 248 249 // Setting the new rectangles 250 for (int i = 0, livello = 1; i < 7; i++) { 251 252 if (valori[i] < dbVU) { 253 lcd.setCursor(livello, 0); 254 lcd.write(5); 255 256 lcd.setCursor(livello++, 1); 257 lcd.write(5); 258 delay(50); 259 260 lcd.setCursor(livello, 0); 261 lcd.write(5); 262 lcd.setCursor(livello++, 263 1); 264 lcd.write(5); 265 } 266 } 267 268 // Removing the old rectangles 269 270 for (int i = 7, livello = 14; i > 0; i--) { 271 if (valori[i] > dbVU) { 272 273 lcd.setCursor(livello, 0); 274 lcd.write(6); 275 lcd.setCursor(livello--, 276 1); 277 lcd.write(6); 278 delay(50); 279 lcd.setCursor(livello, 0); 280 281 lcd.write(6); 282 lcd.setCursor(livello--, 1); 283 lcd.write(6); 284 285 } 286 } 287 288 delay(100); 289 290} 291
Downloadable files
Schematics and circuit diagrams of Mechanical VUMETER - PDF
Schematics and circuit diagrams of Mechanical VUMETER - PDF
Schematics and circuit diagrams of Mechanical VUMETER - PDF
Schematics and circuit diagrams of Mechanical VUMETER - PDF
Documentation
Case with cover (AutoCAD project)
Case with cover (AutoCAD project)
Comments
Only logged in users can leave comments