Wet & Dry Waste Smart Dustbin for House | Best science Project | Harish Projects

Image
 Watch Full Detailed video πŸ‘‡πŸ» Diagram in VideoπŸ‘† //Arduino Code// //YouTube: Harish Projects //Order Electronic Parts & Project kit:  HarishProjects.com // #include <Servo.h> Servo servo1; const int trigPin = 12; const int echoPin = 11; long duration; int distance=0; int potPin = A0; //input pin int soil=0; int fsoil; void setup()  {   Serial.begin(9600); //Serial.print("Humidity"); pinMode(trigPin, OUTPUT);  pinMode(echoPin, INPUT);  servo1.attach(8); } void loop()  { //YouTube: Harish Projects //Order Electronic Parts & Project kit:  HarishProjects.com //      int soil=0;   for(int i=0;i<2;i++)   { digitalWrite(trigPin, LOW); delayMicroseconds(7); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); delayMicroseconds(10); duration = pulseIn(echoPin, HIGH); distance= duration*0.034/2+distance; delay(10);   }   distance=distance/2;   Serial.println(distance); if (distance <20 && distance>1) {   delay(1000); for(int i

How to make Audio spectrum light Amazing πŸ”₯ Project

 


                            Project Diagram



...............................Arduino Code.................................

int soundPin = A0;
int LED1 = 2;
int LED2 = 3;
int LED3 = 4;
int LED4 = 5;
int LED5 = 6;
int LED6 = 7;
int LED7 = 8;
int LED8 = 9;

void setup()
{
Serial.begin(9600);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(LED8, OUTPUT);
}

void loop()
{
long sum = 0;
for(int i=0; i<100; i++) // taking 100 sample of sound
{
sum += analogRead(soundPin);
}

sum = sum/100; // average the sample of sound

if (sum>=100) digitalWrite(LED1, HIGH); else digitalWrite(LED1, LOW);
if (sum>=200) digitalWrite(LED2, HIGH); else digitalWrite(LED2, LOW);
if (sum>=300) digitalWrite(LED3, HIGH); else digitalWrite(LED3, LOW);
if (sum>=350) digitalWrite(LED4, HIGH); else digitalWrite(LED4, LOW);
if (sum>=400) digitalWrite(LED5, HIGH); else digitalWrite(LED5, LOW);
if (sum>=450) digitalWrite(LED6, HIGH); else digitalWrite(LED6, LOW);
if (sum>=500) digitalWrite(LED7, HIGH); else digitalWrite(LED7, LOW);
if (sum>=550) digitalWrite(LED8, HIGH); else digitalWrite(LED8, LOW);
delay(10); 
Serial.println(sum);
}

Comments

Popular posts from this blog

Smart Bridge - Automatic Hight increase when flooding | Best science Project

How to make Phone control RC car using Arduino #phoneControlCar

Inspire Award Project | Train accident Prevention project | Best science Project / Harish Projects