Things used in this project

Schematics

Schema
Lcd keypad shield diagram pinout wiring configuration schematics fxxj3m2wn3

Code

Analog VisualizerC/C++
#include <LiquidCrystal.h>
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
void setup() {
  // put your setup code here, to run once:
  //initialize the custom characters
  lcdcharinitiate();
  //Loading Basic Screen
  LoadFirstScreen();
}
void loop() {
  // put your main code here, to run repeatedly:
  //start the visualization
  StartVisualization();
}
//initiate the lcd custom charcters
void lcdcharinitiate()
{
    byte C1[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F};
    byte C2[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x1F};
    byte C3[8] = {0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x1F};
    byte C4[8] = {0x00,0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F};
    byte C5[8] = {0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x1F};
    byte C6[8] = {0x00,0x00,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
    byte C7[8] = {0x00,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
    
    lcd.createChar(1 , C1);
    lcd.createChar(2 , C2);
    lcd.createChar(3 , C3);
    lcd.createChar(4 , C4);
    lcd.createChar(5 , C5);
    lcd.createChar(6 , C6);
    lcd.createChar(7 , C7);

    lcd.begin(16 , 2);

}
//load first screen view
void LoadFirstScreen()
{
  //print the fixed things on the screen
  lcdah(9);
  lcdal(9);
  lcdmax(7);
  lcdmin(7);
  
}
// this function is the core of the display wich will display the 
// values and bars
void StartVisualization()
{
  int x[6];
  int v[6];
  for(int i = 0 ; i < 6 ; i++)
  {
    v[i] = analogRead(i);
    x[i] = map(v[i], 0, 1023, 0, 16);
    levelvisualizer(x[i],i);
  }
  int themax = MaximumValue(v);
  int themin = MinimumValue(v);
  int themaxa = MaximumValueA(v);
  int themina = MinimumValueA(v);
  lcdmaxvalue(12,themax);
  lcdminvalue(12,themin);
  lcdmaxavalue(10,themaxa);
  lcdminavalue(10,themina);
}
//get maximum value
int MaximumValue(int maximum[6])
{
  int themaximum = maximum[0];
  for(int i = 1 ; i < 6 ; i++)
  {
    if(maximum[i] > themaximum)
    {
      themaximum = maximum[i];
    }
  }
  return themaximum;
}
//get maximum value analog input
int MaximumValueA(int maximum[6])
{
  int themaxi = 0;
  int themaximum = maximum[0];
  for(int i = 0 ; i < 6 ; i++)
  {
    if(maximum[i] > themaximum)
    {
      themaximum = maximum[i];
      themaxi = i;
    }
  }
  return themaxi;
}
//get minimum value
int MinimumValue(int minimum[6])
{
  int theminimum = minimum[0];
  for(int i = 1 ; i < 6 ; i++)
  {
    if(minimum[i] < theminimum)
    {
      theminimum = minimum[i];
    }
  }
  return theminimum;
}
//get minimum value analog input
int MinimumValueA(int minimum[6])
{
  int themini = 0;
  int theminimum = minimum[0];
  for(int i = 1 ; i < 6 ; i++)
  {
    if(minimum[i] < theminimum)
    {
      theminimum = minimum[i];
      themini = i;
    }
  }
  return themini;
}
//find the needed characer and added it to the needed position
void levelvisualizer(int num , int pos)
{
  if(num == 0)
  {
    lcdlevel0(pos);
  }
  if(num == 1)
  {
    lcdlevel1(pos);
  }
  if(num == 2)
  {
    lcdlevel2(pos);
  }
  if(num == 3)
  {
    lcdlevel3(pos);
  }
  if(num == 4)
  {
    lcdlevel4(pos);
  }
  if(num == 5)
  {
    lcdlevel5(pos);
  }
  if(num == 6)
  {
    lcdlevel6(pos);
  }
  if(num == 7)
  {
    lcdlevel7(pos);
  }
  if(num == 8)
  {
    lcdlevel8(pos);
  }
  if(num == 9)
  {
    lcdlevel9(pos);
  }
  if(num == 10)
  {
    lcdlevel10(pos);
  }
  if(num == 11)
  {
    lcdlevel11(pos);
  }
  if(num == 12)
  {
    lcdlevel12(pos);
  }
  if(num == 13)
  {
    lcdlevel13(pos);
  }
  if(num == 14)
  {
    lcdlevel14(pos);
  }
  if(num == 15)
  {
    lcdlevel15(pos);
  }
  if(num == 16)
  {
    lcdlevel16(pos);
  }
}

//lcd draw character functions
void lcdah(int startposition)
{
  lcd.setCursor(startposition,0);
  lcd.print("A");
}
void lcdal(int startposition)
{
  lcd.setCursor(startposition,1);
  lcd.print("A");
}
void lcdmax(int startposition)
{
  lcd.setCursor(startposition,0);
  lcd.print("H:");
}
void lcdmin(int startposition)
{
  lcd.setCursor(startposition,1);
  lcd.print("L:");
}
void lcdmaxavalue(int startposition,int thevalue)
{
  lcd.setCursor(startposition,0);
  lcd.print(String(thevalue));
}
void lcdminavalue(int startposition,int thevalue)
{
  lcd.setCursor(startposition,1);
  lcd.print(String(thevalue));
}
void lcdmaxvalue(int startposition,int thevalue)
{
  lcd.setCursor(startposition,0);
  lcd.print(String(thevalue) + "   ");
}
void lcdminvalue(int startposition,int thevalue)
{
  lcd.setCursor(startposition,1);
  lcd.print(String(thevalue) + "   ");
}

//levels for visual view from 0 to 16 level

void lcdlevel0(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(32));
}
void lcdlevel1(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(1));
}
void lcdlevel2(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(2));
}
void lcdlevel3(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(3));
}
void lcdlevel4(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(4));
}
void lcdlevel5(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(5));
}
void lcdlevel6(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(6));
}
void lcdlevel7(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(7));
}
void lcdlevel8(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(32));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel9(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(1));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel10(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(2));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel11(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(3));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel12(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(4));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel13(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(5));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel14(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(6));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel15(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(7));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}
void lcdlevel16(int startposition)
{
    lcd.setCursor(startposition,0);
    lcd.write(byte(255));
    lcd.setCursor(startposition,1);
    lcd.write(byte(255));
}

Credits

Antu arduino icon small svg iwumdlklvy
Arduino World

15 Years Embedded System Programming and Development Experience

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Direction Indicators for Bikes
Intermediate
  • 64
  • 3

Full instructions

Riding bike is a little dangerous. With the Direction Indicators for a bike, car's know if you want to turn right or left. Make biking safe!

Third Eye for The Blind
Intermediate
  • 518
  • 8

Full instructions

An innovative wearable technology for visually impaired peoples.

The Trump Button
Intermediate
  • 526
  • 4

Full instructions

The famous connected button to order your favorite drink using Sigfox network.

Starry Night Prom
Intermediate
  • 420
  • 4

How did I stand out at prom? In a light up dress of course!

Arduino: Switching ON/OFF Appliances Using IR Remote
Intermediate
  • 10
  • 1

Press 'Power' to switch everything ON/OFF. Press '1' for the fan and '2' for the lights.

One Button Restart of a Stalled Raspberry Pi Zero W
Intermediate
  • 2,057
  • 15

Full instructions

Avoid SD card corruption on a non-responsive RPi using an Arduino to log into the serial console and restart your RPi from the root account.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login