Thursday, 30 April 2020

Interfacing of Multiple Ultrasonic Sensors (3 HC-SR04 ) With Arduino


Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9
Block diagram:
Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9
HC-SR04 ULTRASONIC SENSOR:
SCHEMATIC DIAGRAM:

FINAL SOFTWARE CODE:
----------------------------------------
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,10,11,12,13);
#define trigPin1 A0
#define echoPin1 A1
#define trigPin2 A2
#define echoPin2 A3
#define trigPin3 A4
#define echoPin3 A5
int ALARM = 7;
long duration, distance, FIRSTSensor,SECONDSensor,THIRDSensor;
void setup()
{
lcd.begin(16,2);
Serial.begin (9600);
lcd.clear(); 
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(trigPin3, OUTPUT);
pinMode(echoPin3, INPUT);
pinMode(ALARM, OUTPUT);
digitalWrite(ALARM, LOW);
 lcd.setCursor(0,0);lcd.print("Interfacing ");
lcd.setCursor(0,1);lcd.print("of Multiple ");
delay(3000);lcd.clear();  
lcd.setCursor(0,0);lcd.print("3 HC - SR04 ");
lcd.setCursor(0,1);lcd.print("Ultrasonic  ");
delay(3000);lcd.clear();
lcd.setCursor(0,0);lcd.print("SensorS With ");
lcd.setCursor(0,1);lcd.print("Arduino ");
delay(3000);lcd.clear();
}

void loop() 
{
/////////////////////////////////////////////////////// 
SonarSensor(trigPin1, echoPin1);
FIRSTSensor = distance;
SonarSensor(trigPin2, echoPin2);
SECONDSensor = distance;
SonarSensor(trigPin3, echoPin3);
THIRDSensor = distance;
/////////////////////////////////////////////////////////////
digitalWrite(ALARM, LOW);
//////////////////////////////////////////////////////////////////////////////////////
Serial.print("S1:");Serial.println(FIRSTSensor); delayMicroseconds(10);
Serial.print("S2:");Serial.println(SECONDSensor);delayMicroseconds(10);
Serial.print("S3:");Serial.println(THIRDSensor); delayMicroseconds(10);
///////////////////////////////////////////////////////////////////////////////////////
lcd.setCursor(0,0);lcd.print("S1:");lcd.setCursor(4,0);lcd.print(FIRSTSensor);
lcd.setCursor(9,0);lcd.print("S2:");lcd.setCursor(12,0);lcd.print(SECONDSensor);
lcd.setCursor(0,1);lcd.print("S3:");lcd.setCursor(4,1);lcd.print(THIRDSensor);
delay(1000);lcd.clear();
///////////////////////////////////////////////////////
if((FIRSTSensor >= 10) & (FIRSTSensor <= 50)) 
{digitalWrite(ALARM, HIGH);delay(500);}
///////////////////////////////////////////////////////
if((SECONDSensor >= 10) & (SECONDSensor <= 50)) 
{digitalWrite(ALARM, HIGH);delay(500);}
///////////////////////////////////////////////////////
if((THIRDSensor >= 10) & (THIRDSensor <= 50)) 
{digitalWrite(ALARM, HIGH);delay(500);}
///////////////////////////////////////////////////////
}
/////////////////////////////////////////////////////////////////////////////////
void SonarSensor(int trigPin,int echoPin)
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
}
------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9 Slice--►http://www.svskits.in/ blog --►http://www.svskit.com/ site --►http://www.svsembedded.com/ ------------------------------------------------------------------------- ✽ FOLLOW ME! Twitter: --►https://bit.ly/2Vms5Eq Facebook: --►https://bit.ly/2wyQkH0 linkedin: --►https://bit.ly/3ekwccQ flickr: --►http://bit.ly/29nunKE Pinterest: --►http://bit.ly/29A4Ocq Thumbs up if you want to see more projects! *What would you like to see next?! Links: Android projects:--► http://bit.ly/29nlAs5 GSM Based Projects:--► http://bit.ly/29nA0Y7 Bluetooth Based Projects:--► http://bit.ly/29G93nV women safety projects:--► http://bit.ly/29BEhNv Touchscreen+Restaurant:--► http://bit.ly/29tB2oz LabVIEW Projects:--► http://bit.ly/29IlY8W Agriculture Projects:--►http://bit.ly/29ATa0z Touch Screen Home Automation:--►http://bit.ly/29po3RN IOT Based Projects:--►http://bit.ly/29Cai60 ♥ Business Email:--► info@svsembedded.com, Email:--► svsembedded@gmail.com *Feel free to send me a mail about u r project abstract/synopsis! :]





Thursday, 23 April 2020

Wireless DC Motor Speed and Direction Control using Arduino with IR Remote


Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9
PROJECT VIDEO LINK:

Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9
Block diagram:
 Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9
 Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9
SAMPLE SOFTWARE CODE:
----------------------------------------
#include <IRremote.h>
const int RECV_PIN=11;
IRrecv irrecv(RECV_PIN);
decode_results results;
///////////////////////////////////////////////////////////
int P1=A0;
int P2=A1;
int P3=A2;
int P4=A3;
int P5=A4;
///////////////////////////////////////////////////////////
int aa=0;int bb=0;
int PWM1Pin = 9;
int PWM2Pin = 10;  
int motor1Speed = 0;
int motor2Speed = 0;
int fr=0;
int br=0;
///////////////////////////////////////////////////////////
void setup()
{
pinMode(P1, OUTPUT);
pinMode(P2, OUTPUT);
pinMode(P3, OUTPUT);
pinMode(P4, OUTPUT);
pinMode(P5, OUTPUT);

irrecv.enableIRIn();
irrecv.blink13(true);
analogWrite(PWM1Pin, motor1Speed);analogWrite(PWM2Pin, motor2Speed);
digitalWrite(P1,LOW);digitalWrite(P2,LOW);digitalWrite(P3,LOW);
digitalWrite(P4,LOW);digitalWrite(P5,LOW);
}
///////////////////////////////////////////////////////////
void loop() 
{
if (irrecv.decode(&results)) 
{
delay(100);
///////////////////////////////////////////////////////////////////////////
if(results.value==0x11111111)////forwad
{
fr=1;br=0;aa=bb;
}
///////////////////////////////////////////////////////////////////////////
if(results.value==0x22222222)////backward
{
br=1;fr=0;bb=aa;
}
///////////////////////////////////////////////////////////////////////////
if(fr==1)
{
if(results.value==0x33333333)
{
aa=aa+1;br=0;
}
///////////////////////////////////////////////////////////////////////////////////////////////
if(results.value==0x44444444)
{
aa=aa-1;br=0;
if(aa<0){motor1Speed=0;motor2Speed=0;
analogWrite(PWM1Pin, motor1Speed);
analogWrite(PWM2Pin, motor2Speed);
aa=0;digitalWrite(P1,LOW);
digitalWrite(P2,LOW);
digitalWrite(P3,LOW);
digitalWrite(P4,LOW);
digitalWrite(P5,LOW);}
}
}
///////////////////////////////////////////////////////////////////////////
if(br==1)
{
if(results.value==0x55555555)
{
bb=bb+1;fr=0;
}
///////////////////////////////////////////////////////////////////////////////////////////////
if(results.value==0x66666666)
{
bb=bb-1;fr=0;
if(bb<0){motor1Speed=0;motor2Speed=0; 
analogWrite(PWM1Pin, motor1Speed);
analogWrite(PWM2Pin, motor2Speed);
bb=0;digitalWrite(P1,LOW);
digitalWrite(P2,LOW);
digitalWrite(P3,LOW);
digitalWrite(P4,LOW);
digitalWrite(P5,LOW);}
}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(results.value==0x7777777)
{
motor1Speed=0;motor2Speed=0; analogWrite(PWM1Pin, motor1Speed);analogWrite(PWM2Pin, motor2Speed);aa=0;bb=0;br=0;fr=0;
digitalWrite(P1,LOW);digitalWrite(P2,LOW);digitalWrite(P3,LOW);digitalWrite(P4,LOW);digitalWrite(P5,LOW);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
irrecv.resume(); // Receive the next value
delay(100);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Please Subscribe For More Project Videos --► http://bit.ly/29vPrS9 Slice--►http://www.svskits.in/ blog --►http://www.svskit.com/ site --►http://www.svsembedded.com/ ------------------------------------------------------------------------- ✽ FOLLOW ME! Twitter: --►https://bit.ly/2Vms5Eq Facebook: --►https://bit.ly/2wyQkH0 linkedin: --►https://bit.ly/3ekwccQ flickr: --►http://bit.ly/29nunKE Pinterest: --►http://bit.ly/29A4Ocq Thumbs up if you want to see more projects! *What would you like to see next?! Links: Android projects:--► http://bit.ly/29nlAs5 GSM Based Projects:--► http://bit.ly/29nA0Y7 Bluetooth Based Projects:--► http://bit.ly/29G93nV women safety projects:--► http://bit.ly/29BEhNv Touchscreen+Restaurant:--► http://bit.ly/29tB2oz LabVIEW Projects:--► http://bit.ly/29IlY8W Agriculture Projects:--►http://bit.ly/29ATa0z Touch Screen Home Automation:--►http://bit.ly/29po3RN IOT Based Projects:--►http://bit.ly/29Cai60 ♥ Business Email:--► info@svsembedded.com, Email:--► svsembedded@gmail.com *Feel free to send me a mail about u r project abstract/synopsis! :]

Wednesday, 22 April 2020

IoT Project : Home Automation and Weather Monitor Using NodeMCU with Cayenne

PROJECT VIDEO LINK:
Pin diagram:


software app LINK:



SAMPLE SOFTWARE CODE:
----------------------

#include <Adafruit_Sensor.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiAP.h>
#include <ESP8266WiFiGeneric.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266WiFiScan.h>
#include <ESP8266WiFiSTA.h>
#include <ESP8266WiFiType.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>
//////////////////////////////////////////////////////////////////////
char ssid[] = "svskits";
char wifiPassword[] = "123456";
//////////////////////////////////////////////////////////////////////
char username[] = "54fab1d0-749b-11ea-9915-d7baa233c";
char password[] = "1b47fcc0cacabd471e6c80d590eaa9322ce";
char clientID[] = "6736db70-749c-11ea-9179-a737487a4";
//////////////////////////////////////////////////////////////////////
unsigned long lastMillis = 0;
#include "DHT.h"
#define DHTPIN D4     
#define DHTTYPE DHT11  
DHT dht(DHTPIN, DHTTYPE);
float h,t,f,hic,hif;
////////////////////////////////////////////////////////////////////////
void setup()
{
dht.begin();
Serial.begin(9600);
Cayenne.begin(username, password, clientID, ssid, wifiPassword);
pinMode(D0,OUTPUT);
pinMode(D1,OUTPUT);
pinMode(D2,OUTPUT);
pinMode(D3,OUTPUT);
}
///////////////////////////////////////////////////////////////////////
void loop()
{
Cayenne.loop();
if (millis() - lastMillis > 10000)
{
lastMillis = millis();
Cayenne.virtualWrite(0, h);
Cayenne.virtualWrite(1, t);
Cayenne.virtualWrite(2, hic);
}
h = dht.readHumidity();
t = dht.readTemperature();
f = dht.readTemperature(true);
if (isnan(h) || isnan(t) || isnan(f))
{
Serial.println("Failed to read from DHT sensor!");
return;
}
hif = dht.computeHeatIndex(f, h);
hic = dht.computeHeatIndex(t, h, false);
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hic);
Serial.print(" *C ");
Serial.print(hif);
Serial.println(" *F");
}
//////////////////////////////////////////////////////////////////////
CAYENNE_IN(3)
{
int currentValue=getValue.asInt();
if(currentValue==1){digitalWrite(D0,LOW);}
else{digitalWrite(D0,HIGH);}
}
//////////////////////////////////////////////////////////////////////
CAYENNE_IN(4)
{
int currentValue=getValue.asInt();
if(currentValue==1){digitalWrite(D1,LOW);}
else{digitalWrite(D1,HIGH);}
}
//////////////////////////////////////////////////////////////////////
CAYENNE_IN(5)
{
int currentValue=getValue.asInt();
if(currentValue==1){digitalWrite(D2,LOW);}
else{digitalWrite(D2,HIGH);}
}
//////////////////////////////////////////////////////////////////////
CAYENNE_IN(6)
{
int currentValue=getValue.asInt();
if(currentValue==1){digitalWrite(D3,LOW);}
else{digitalWrite(D3,HIGH);}
}
//////////////////////////////////////////////////////////////////////





A Novel Approach for Vehicular Accident Detection and Rescue Alert Syste...

A Novel Approach for Vehicular Accident Detection and Rescue Alert System using IoT | A Novel Approach to Automatic Road-Accident Detection ...