element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Build a Present
  • Challenges & Projects
  • Project14
  • Build a Present
  • More
  • Cancel
Build a Present
Blog Door alarm
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rpiloverbd
  • Date Created: 13 Jan 2022 11:38 AM Date Created
  • Views 10429 views
  • Likes 9 likes
  • Comments 5 comments
Related
Recommended

Door alarm

rpiloverbd
rpiloverbd
13 Jan 2022
Door alarm

Hello everyone,

Here I come again with another tiny but interesting project.  The project is called ‘Door alarm circuit’. The circuit rings an alarm when somebody opens the door. This circuit is sometimes important to ensure your privacy. The circuit can be attached to any type of door. Even if you’re a villager, living in a hut, you can use this circuit to ensure your safety and security.

Materials needed

Arduino UNO R3 x 1

Hall effect sensor x 1

Buzzer x 1

9V battery x 1

9V Battery to DC jack connector x 1

Ring Magnet x 1

Jumper wires

Scotch tapes

What is hall effect ?:

When a current-carrying conductor is placed in a magnetic field, a potential difference is produced. This phenomenon is called the hall effect. The produced potential difference is called Hall voltage. If you want to study further about the Hall effect, here is a good article.

Working principle of the circuit:

The hall effect sensor and the ring magnet are very close to each other in normal condition. In this condition, the output of the sensor is HIGH. When the door is open, the hall effect sensor can no longer sense the magnet. Its output becomes LOW.  The output pin of the sensor is connected to pin#2 of the Arduino. The Arduino understands the door has been opened. It triggers the buzzer. The buzzer makes a sound continuously as long as the door is open. 

Connections:

Arduino Hall effect sensor
5V +
Gnd -
2 D0

 

 

Arduino UNO Buzer
11 +
GND -

// constants won't change. They're used here to set pin numbers:
const int sensorPin = 2;     // the number of the sensor pin
const int buzzerPin =  11;      // the number of the buzzer pin
// variables will change:
int sensorState = 0;         // variable for reading the sensorpin
void setup() {
  // initialize the singnal pin as an output:
  pinMode(buzzerPin, OUTPUT);
  // initialize the sensor pin as an input:
  pinMode(sensorPin, INPUT_PULLUP);
  Serial.begin(9600);
}
void loop() {
  // read the state of the sensorpin:
  sensorState = digitalRead(sensorPin);

  // check if  there is magnet in front of the hall sensor. If so, the buzzerpin is Low:
  Serial.println(sensorState);
  delay(100); 
   if (sensorState == LOW) {
    // turn sensor off:
    digitalWrite(buzzerPin, HIGH);
  } else {
    // turn sensor on:
    digitalWrite(buzzerPin, LOW);
  }
}

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

  • Sign in to reply
  • rpiloverbd
    rpiloverbd 4 months ago in reply to traylorg

    As beacond dave has already said, you need to add an SD card and store the wav files inside the SD card. Here you may get a better idea. maxoffsky.com/.../

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave 7 months ago in reply to traylorg

    With an Arduino UNO you would normally add an audio player shield. Something like:

       Adafruit "Music Maker" MP3 Shield for Arduino (MP3/Ogg/WAV...)
       https://www.adafruit.com/product/1790

    The audio files are then stored on a SD card inserted into the player shield and then the program running on the UNO selects the desired audio track and starts playback. The shield basically replaces the buzzer.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • traylorg
    traylorg 7 months ago

    I’m curious how to substitute.wav files for alternative sounds. Like “welcome” or text to speech function.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rpiloverbd
    rpiloverbd over 3 years ago in reply to DAB

    Thanks a lot :)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 3 years ago

    I like it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube