Tarantula3DIYables
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 hour1,111
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
Ultrasonic Sensor HC-SR04
DIYables Ultrasonic Sensor HC-SR04
×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
DIYables LED
×1
Resistor
DIYables Resistor
×1
Capacitor 100 µF
Capacitor 100 µF
×1
Buzzer
DIYables Buzzer
×1
Relay Module 5V 1-Channel
DIYables Relay Module 5V 1-Channel
×1
Starter Kit
DIYables Starter Kit
×1
Battery Clip
DIYables Battery Clip
×1
Breadboard Shield for Arduino
DIYables Breadboard Shield for Arduino
×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

67 projects • 85 followers
There were 1000+ sperms but I was the fastest one..
DIYables

DIYables

0 projects • 79 followers
I would like to invite you to join and add your projects to DIYables platform https://www.hackster.io/diyables

Comments