Tarantula3
Published

COVID-Free Contactless Cordless Bell Using

Year 2020, has taught us many new things. Our lifestyle has changed and we have adopted to many new and safe ways of livelihood.

BeginnerProtip1 hour499
COVID-Free Contactless Cordless Bell Using

Things used in this project

Hardware components

ELEGOO UNO R3 Board ATmega328P ATMEGA16U2 with USB Cable
ELEGOO UNO R3 Board ATmega328P ATMEGA16U2 with USB Cable
×1
ELEGOO HC-SR04 Ultrasonic Distance Sensor Kits
ELEGOO HC-SR04 Ultrasonic Distance Sensor Kits
×1
IR Module
×1
9V battery (generic)
9V battery (generic)
×1
434 MHz RF Transmitter Module
×1
434 MHz RF Receiver Module (RX470C-V01)
×1
Antennas
×2
LED (generic)
LED (generic)
×1
Through Hole Resistor, 200 kohm
Through Hole Resistor, 200 kohm
×1
Capacitor 100 µF
Capacitor 100 µF
×1
Buzzer
Buzzer
×1
1-Channel Signal Relay 1A SPDT I²C Mini Module
ControlEverything.com 1-Channel Signal Relay 1A SPDT I²C Mini Module
×1
ELEGOO UNO R3 Project Complete Starter Kit
ELEGOO UNO R3 Project Complete Starter Kit
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

5_i7UnPljdQW.png

Code

UltraSonic_Code.ino

Arduino
int trigPin = 2;  // Sensor Trip pin connected to Arduino pin D3
int echoPin = 3;  // Sensor Echo pin connected to Arduino pin D2
int dataOut = 13; // RF Module connects here
long duration, Distance;

void setup() {
  Serial.begin(115200);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(dataOut, OUTPUT);
}

void loop() {
  digitalWrite(trigPin, LOW);   delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  Distance = (duration/2) / 74;       // Distance in Inches
 
  if(Distance < 10){                  // When an object is at a close proximity of 20 Inches
    digitalWrite(dataOut, LOW);
    delay(200);
  }
  else{
    digitalWrite(dataOut, HIGH);
    delay(200);
  }      
  Serial.println(Distance);
}

IR_Code.ino

Arduino
int IRmodule = 2;  // IR Module connected to Arduino pin D2
int dataOut  = 13; // RF Module connects here

void setup(){
  pinMode(dataOut,  OUTPUT);
  pinMode(IRmodule, INPUT);
}

void loop(){
  if(digitalRead(IRmodule) == LOW){
    digitalWrite(dataOut, HIGH);
  }
  else{
    digitalWrite(dataOut, LOW);
  }
}

Credits

Tarantula3

Tarantula3

32 projects • 59 followers
There were 1000+ sperms but I was the fastest one..

Comments