Code- #include Servo myservo; // create servo object to control a servo // twelve servo objects can be created on most boards int pos = 0; void setup() { // put your setup code here, to run once: myservo.attach(11); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(A2, INPUT); Serial.begin(9600); digitalWrite(6, HIGH); } void loop() { // put your main code here, to run repeatedly: int a = analogRead(A0); int b = analogRead(A1); int c = analogRead(A2); Serial.print(a); Serial.print(" "); Serial.print(b); Serial.print(" "); Serial.print(c); Serial.println(" "); delay(50); if (a>=990) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } //delay(200); } else if(b>=800) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } } else if(c>=990) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } } else if(a200) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(100); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); delay(100); digitalWrite(6, HIGH); delay(100); } else if(b400) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(100); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); delay(100); digitalWrite(6, HIGH); delay(100); } else if(c400) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(100); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); delay(100); digitalWrite(6, HIGH); delay(100); } else { digitalWrite(6, LOW); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW);
Hi brother I have made this project relay show green light but water pump not working . Yes I have not connected the motor but water pump is working on normal connection of 9v
#include Servo myservo; // create servo object to control a servo // twelve servo objects can be created on most boards int pos = 0; void setup() { // put your setup code here, to run once: myservo.attach(11); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(A0, INPUT); pinMode(A1, INPUT); pinMode(A2, INPUT); Serial.begin(9600); digitalWrite(6, HIGH); } void loop() { // put your main code here, to run repeatedly: int a = analogRead(A0); int b = analogRead(A1); int c = analogRead(A2); Serial.print(a); Serial.print(" "); Serial.print(b); Serial.print(" "); Serial.print(c); Serial.println(" "); delay(50); if (a>=990) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } //delay(200); } else if(b>=800) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } } else if(c>=990) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15 ms for the servo to reach the position } } else if(a200) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(100); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); delay(100); digitalWrite(6, HIGH); delay(100); } else if(b400) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(100); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); delay(100); digitalWrite(6, HIGH); delay(100); } else if(c400) { digitalWrite(2, LOW); digitalWrite(3,HIGH); digitalWrite(4, HIGH); digitalWrite(5, LOW); delay(100); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW); digitalWrite(6, LOW); delay(100); digitalWrite(6, HIGH); delay(100); } else { digitalWrite(6, LOW); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); digitalWrite(5, LOW);
Code-
#include
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0;
void setup() {
// put your setup code here, to run once:
myservo.attach(11);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
Serial.begin(9600);
digitalWrite(6, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
int a = analogRead(A0);
int b = analogRead(A1);
int c = analogRead(A2);
Serial.print(a);
Serial.print(" ");
Serial.print(b);
Serial.print(" ");
Serial.print(c);
Serial.println(" ");
delay(50);
if (a>=990)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
//delay(200);
}
else if(b>=800)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
}
else if(c>=990)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
}
else if(a200)
{
digitalWrite(2, LOW);
digitalWrite(3,HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(100);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
}
else if(b400)
{
digitalWrite(2, LOW);
digitalWrite(3,HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(100);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
}
else if(c400)
{
digitalWrite(2, LOW);
digitalWrite(3,HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(100);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
}
else
{
digitalWrite(6, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
}
😮
Send circuit diagram
Code copy nahi ho Raha code bej do
Hi brother I have made this project relay show green light but water pump not working . Yes I have not connected the motor but water pump is working on normal connection of 9v
Circuit diagram plus all the components used please name them
Please digram circuit
I want circuit diagram plz send me
Can you send the circuit diagram
bro you have diagram? please send a link tnx
If any issue comes you can ask me
Bro send circuit diagram
please send circuit diagram
Plz circuit diagram
Please bro give me a cirucut diagram
I want a circuit diagram and code bro
Your code totally wrong bro please send correct code please
Hi
plz send circuit diagram
where's the circuit diagram 😢😢
send circuit please
From which line code start ans pls send diagram
Please wait
Bhai diagram de do please
I need the diagram
Bhai circuit diagram
Or explanation
😂
Bro circuit diagram
nahi hai
Plz send code
Sent
Bro plssss
what the heck were is the code
Bro please send the Circuit diagram
Ok wait
Plz send code
Check description
Or
#include
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0;
void setup() {
// put your setup code here, to run once:
myservo.attach(11);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
Serial.begin(9600);
digitalWrite(6, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
int a = analogRead(A0);
int b = analogRead(A1);
int c = analogRead(A2);
Serial.print(a);
Serial.print(" ");
Serial.print(b);
Serial.print(" ");
Serial.print(c);
Serial.println(" ");
delay(50);
if (a>=990)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
//delay(200);
}
else if(b>=800)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
}
else if(c>=990)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
for (pos = 60; pos = 60; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15 ms for the servo to reach the position
}
}
else if(a200)
{
digitalWrite(2, LOW);
digitalWrite(3,HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(100);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
}
else if(b400)
{
digitalWrite(2, LOW);
digitalWrite(3,HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(100);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
}
else if(c400)
{
digitalWrite(2, LOW);
digitalWrite(3,HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(100);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(100);
digitalWrite(6, HIGH);
delay(100);
}
else
{
digitalWrite(6, LOW);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}
}