Things used in this project

Parts & Materials:
09590 01
LED (generic)
×1
09939 01
Rotary potentiometer (generic)
×1
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
Te connectivity 4 103741 0 image 75px
Male Header 40 Position 1 Row (0.1")
×1
Ardgen mega
Arduino Mega 2560 & Genuino Mega 2560
×1
Software apps and online services:
Ide web
Arduino IDE

Schematics

14_JLvDWhi6Yo.jpg
14 jlvdwhi6yo

Code

UV meter code for arduinoArduino
upload the following sketch through the arduino ide software
//////////////////CREATED BY KJ ELECTRONICS///////////////////////////;
////////////FOLLOW ME ON YOUTUBE BY CLICKING THE LINK BELOW////////////
///////  https://www.youtube.com/channel/UCZE35bOktFxu8dIadxuQPLg /////

int music = A0;
int output,a;
int potval=A1;
int number_of_led[20] = { 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,32,33,34,35,36,37,38,39,40,41}; // Assign the pins for the leds
void setup()
{
for (a = 0; a < 20; a++)  
  pinMode(number_of_led[a], OUTPUT);
}

void loop()
{
potval=analogRead(A1);
output = analogRead(music);
potval=map (potval,0,1024,5,40);
output = output/potval;   

  if (output == 0) 
   {
   for(a = 0; a < 20; a++)
     {
     digitalWrite(number_of_led[a], LOW);
     }
  }
  
  else
  {
   for (a = 0; a < output; a++)
    {
     digitalWrite(number_of_led[a], HIGH);
    }
    
    for(a = a; a < 20; a++) 
     {
      digitalWrite(number_of_led[a], LOW);
    
     }
  }
}

Credits

Logo zolzkzgizy
kj electronics

love to make electronics project and stuffs which glow thorugh led or a 240v lamp. completing the electronics and communication engineering

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

Add projectSign up / Login
Community Projects Magazine Maker Faire Shop Share
Respect project