Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
valnaut
Published © GPL3+

Voltage Led ALERT ⚠️

Based upon the voltage being passed, Identify if the current is safe from a distance with help of leds.

BeginnerFull instructions provided260
Voltage Led ALERT ⚠️

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Resistor 330 ohm
Resistor 330 ohm
×3
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Yellow
5 mm LED: Yellow
×1
5 mm LED: Green
5 mm LED: Green
×1
Male/Male Jumper Wires
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1
Rotary Potentiometer, 10 kohm
Rotary Potentiometer, 10 kohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Voltage Led Alert

Code

Alarm System Volatge

C/C++
Code to this project.
int rPin = 11 ;
int yPin = 12 ;
int gPin = 13 ;
int readPin = A0;
float Val ;
float readVal ;
String myString = "The Potentiometer Voltage is : " ;
int wait = 1000;

void setup() {
  // put your setup code here, to run once:
pinMode(rPin,OUTPUT);
pinMode(yPin,OUTPUT);
pinMode(gPin,OUTPUT);
pinMode(readPin,INPUT);
Serial.begin(9600);
}
void loop() {
  // put your main code here, to run repeatedly:
readVal = analogRead(readPin);
Val = (5./1023.)*readVal;
  if (Val <= 3.00) {
    digitalWrite(gPin,HIGH);
    digitalWrite(yPin,LOW);
    digitalWrite(rPin,LOW);
  }
 if (Val < 4.00 && Val > 3.00) {
    digitalWrite(gPin,LOW);
    digitalWrite(yPin,HIGH);
    digitalWrite(rPin,LOW);
 }

  if (Val > 4.00 && Val<= 6.00) {
    digitalWrite(gPin,LOW);
    digitalWrite(yPin,LOW);
    digitalWrite(rPin,HIGH);
 }

 Serial.print(myString);
 Serial.println(Val);
delay(wait);
}

Credits

valnaut
2 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.