Skip to the content
2 layers68.6 × 53.5 mmHC SR04 Alarm Shield, the printed circuit board in 3D

An Arduino UNO R3 proximity alarm shield with a custom KiCAD PCB layout

Size
68.6 × 53.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
12
Nets
33
Pads
46
Tracks, vias
31, 0
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
5 Jun 2026
Updated
5 Jun 2026

Overview

HC SR04 Alarm Shield is an open-source printed circuit board by ebubeofochukwu, from the ebubeofochukwu/HC-SR04_Alarm_Shield repository on GitHub, published under the MIT licence. It is a 2-layer board of 68.6 × 53.5 mm with 12 parts on 33 nets, routed with 31 tracks and 0 vias.

Its parts include 5 connectors, 1 resistor and 1 diode.

README

README.md

HC-SR04_Alarm_Shield

An Arduino UNO R3 proximity alarm shield with a custom KiCAD PCB layout

HC-SR04 Ultrasonic Alarm Shield

A custom Arduino Uno R3 shield that triggers an audible and visual alarm when an object enters a 50-centimeter threshold. This project combines embedded C++ programming, ultrasonic sensor integration, and a custom PCB designed in KiCad.

Features:

Precision Tracking: Uses the HC-SR04 ultrasonic sensor to calculate real-time distance.

Dual Alert System: Triggers a high-output active buzzer and a bright red LED simultaneously.

Custom Shield Form Factor: Designed to plug directly onto an Arduino Uno R3 without messy jumper wires.

Safety Threshold: Hardcoded 50cm boundary zone for immediate proximity alerts.

Hardware Components:

Microcontroller: Arduino Uno R3

Sensor: HC-SR04 Ultrasonic Distance Sensor

Indicators: 1x Active Buzzer, 1x Red LED

Passives: 1x 220Ω Resistor (for LED protection)

PCB: Custom designed dual-layer board

Pin Mapping:

VCC: Connect to the 5V pin on the Arduino.

Trig: Connect to digital Pin 9.

Echo: Connect to digital Pin 10.

GND: Connect to any GND pin on the Arduino.

Buzzer / LED (Positive): Connect to digital Pin 13 (through a 220Ω resistor for LEDs).

Buzzer / LED (Negative): Connect to GND

Software & Engineering Challenges

The coding phase was the most challenging aspect of this project. Specifically, managing the precise timing required by the HC-SR04 sensor and handling signal bouncing issues required significant troubleshooting.

How I Solved It:

1. Pulse Timing: I utilized the pulseIn() function to accurately measure the microsecond travel time of the sound wave, converting it to centimeters using the speed of sound formula: Distance = (Time \* 0.0343) / 2.

2. Logic Optimization: I implemented a strict conditional threshold check to prevent the buzzer and LED from lagging or stuttering when an object hovers exactly at the 50cm line.

Gallery & Design Files

PCB Layout (KiCad)

[KiCad PCB Layout](images/pcb_layout.png)

Figure 1: 2D/3D render of the custom shield designed in KiCad.

You can prototype this project on a breadboard.

Installation & Usage

1. Clone this repository:

```bash

git clone https://github.com

```

2. Open src/YOUR\_CODE\_FILE\_NAME.ino in the Arduino IDE.

3. Connect your Arduino Uno R3 via USB.

4. Select Tools > Board > Arduino Uno** and the correct COM port.

5. Click Upload.

Parts

12
QtyValueFootprintReferences
4MountingHole_3.2mmArduino_MountingHole:MountingHole_3.2mmMH1, MH2, MH3, MH4
1AnalogConnector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_VerticalJ3
1BuzzerBuzzer_Beeper:Buzzer_12x9.5RM7.6BZ1
1Conn_01x04_SocketConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalJ5
1Digital/PWMConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ4
1Digital/PWMConnector_PinSocket_2.54mm:PinSocket_1x10_P2.54mm_VerticalJ2
1LEDLED_THT:LED_D5.0mmD1
1PowerConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ1
1RResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1

Similar boards

  • 2 layersNrf bga, the printed circuit board in 3D

    Nrf bga

    github-linguist/linguist

    Language Savant. If your repository's language is being reported incorrectly, send us a pull request!

    12 parts14kMIT
  • 2 layers66.9 × 74.5 mmDeskHop, the printed circuit board in 3D

    DeskHop

    hrvach/deskhop

    Fast Desktop Switching Device

    12 parts7.9kGPL-3.0
  • 2 layers40 × 15 mmSensors, the printed circuit board in 3D

    Sensors

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    12 parts3kApache-2.0
  • 2 layers42.7 × 56.5 mmTle6240 driver, the printed circuit board in 3D

    Tle6240 driver

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    12 parts1.2k
  • 2 layers49 × 25 mm5v boost regulator, the printed circuit board in 3D

    5v boost regulator

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    12 parts915
  • 2 layers28.3 × 10.3 mmTap Photosensor PCB, the printed circuit board in 3D

    Tap Photosensor PCB

    VoronDesign/Voron-Tap

    Tap is a nozzle-based z-probe for the V2 and Trident printer designs. The entire toolhead moves to trigger an optical switch. Tap offers many advantages:

    12 parts716GPL-3.0
  • 2 layers25.4 × 70.4 mmTpmsniffer, the printed circuit board in 3D

    Tpmsniffer

    stacksmashing/pico-tpmsniffer

    A simple, very experimental TPM sniffer for LPC bus

    12 parts696

Questions

How big is the HC SR04 Alarm Shield PCB?

It measures 68.6 × 53.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the HC SR04 Alarm Shield use?

12 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the HC SR04 Alarm Shield KiCad files?

From the ebubeofochukwu/HC-SR04_Alarm_Shield repository on GitHub, at the commit this page was made from: the board is hardware/HC_SR04_Alarm_Shield.kicad_pcb and its schematic hardware/HC_SR04_Alarm_Shield.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the HC SR04 Alarm Shield design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).