mohammadsohail0008
Published © GPL3+

Smart Mirror

Magic Mirror

IntermediateFull instructions provided4,485
Smart Mirror

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Relay Module (Generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED Strip, 5 m
LED Strip, 5 m
×1
Led strip adapter
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Circuit Diagram

Code

Code

Arduino
// https://www.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g  //
// Smart Touchless Mirror//
// By MOHD SOHAIL //


int relay = 9;
int Trig = 6;
int Echo = 5;

void setup() 
{
  Serial.begin(9600);
  pinMode(relay, OUTPUT);
  pinMode(Trig, OUTPUT);
  pinMode(Echo, INPUT);
}

void loop() 
{
  long tim;
  long dist;

  digitalWrite(Trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(Trig, LOW);

  tim = pulseIn(Echo , HIGH);

  dist =((0.0343)*tim)/2;
  delay(10);

  if (dist < 30)
  {
    digitalWrite(relay, HIGH);
  }
  else if (dist >= 30)
  {
    digitalWrite(relay, LOW);
  }
}

Credits

mohammadsohail0008

mohammadsohail0008

42 projects • 31 followers

Comments