I created this door chime to let our office know when people come to our Tech Support door. It often isn't readily apparent if anyone is in the suite of offices as we don't have a "receptionist." This quick, simple arduino-based alert system lets us know when someone is enters the room.
This project has an over-ride button (6 second pause) so we can enter/exit quietly, a pause button (pauses detection until the button is pushed again), and a reset button. It is powered by an external power adapter using a standard 5.5mm DC power jack.
Prototyped on a breadboard. The final build used a custom designed 3D printed box.
Step 1: Supplies
- Arduino Nano
- HC-SR04 Ultrasonic Sensor
- LED - Red - 5mm
- LED - Yellow - 5mm
- LED - Blue - 5mm
- PAM8302 2.5W Class D Audio Amplifier
- Mini Speaker (we used a Gikfun 2" 4Ω speaker)
- (3) - 220Ω Resistors
- 3 Buttons (for the final build we used Cylewet 12mm buttons)
- DC Power Port (5mm x 2.1mm)
- Rocker Style Power Switch
There are 4 buttons shown in the photo. We decided that the placement of the buttons on the back side of the project box was inconvenient, so I added a button to the top of the box. The two yellow buttons are both plugged in to the same pin on the arduino, so you can push either of them!
Please note that I used a 4Ω speaker. You could also use an 8Ω speaker with the PAM8302 amplifier, you would get less volume out of it. As it is, the amplifier is turned to a minimum setting, and it is pretty loud!
Step 2: Breadboard Layout
Here's the breadboard layout.
- Change pinouts for audio amplifier to simplify wiring.
- Change pinouts for LED to simplify wiring.
For the final design, I used a mini breadboard with only 1 power rail.
Power is provided by a 5V power adapter with 5.5 x 2.5mm jack. Since this is wired into the VIN port on the Arduino Nano, this port can work with voltage up to 20V.
Step 3: Electrical Schematic
Step 4: Code
This code was written using the Arduino Create website for the Arduino Nano used to power this project.
Step 5: 3D Enclosure
For the 3D printed enclosure, I soldered the resistors to the legs of the LED, and soldered a lead wire to the other leg. I also used the larger buttons and added recesses for mounting nuts on switches and the power port.
In an effort to make this product reproducible for students, I designed the enclosure using Tinkercad.
The button hole on the top right side is for the "override" button. It was inconvenient to push, so I added a second button to the top of the box to make it easier to override so we could leave the office without setting off the alert!
You may notice the aluminum foil wrapped around the wires tucked behind the speaker. There were intermittent stray readings from the sensor. After adding the aluminum foil "shield" sensor readings are very consistent.
This is an entry in the
Arduino Contest 2019