Smart Barrier Gate: Our Latest ESP32 Demo Project
ESP32 & Hardware
At Pacific Custom Engineering, we’re passionate about turning accessible hardware into practical, real-world solutions.
Our latest demo showcases a compact automatic barrier gate system — perfect for educational prototypes — built entirely around the powerful ESP32 microcontroller.

Check out the quick demo in action:
In this short video, you’ll see the system detect an approaching object (simulating a vehicle) and automatically raise the barrier arm. Once the path is clear, the gate lowers again — smooth, reliable, and fully automated.
Key Components Powering the Demo
- ESP32 Development Board — The brain of the operation, handling sensor readings, logic, and servo control with ease.
- HC-SR04 Ultrasonic Sensor — Measures distance in real-time to detect when something comes close (triggering the “open” command).
- Servo Motor (for the barrier arm) — Delivers precise, smooth rotation for the gate movement.
- USB Charging Data Cable – 540° Rotation – 3.3ft Red with 3 Magnetic Tips — Makes prototyping a breeze with quick, secure, solder-free connections during testing and development.
This setup keeps things simple yet highly functional — ideal for makers, students, or anyone exploring IoT and automation.
The complete code is open-source and available on our GitHub repository https://github.com/PacificCustomEngineering/ESP32-BarrierGate. Feel free to download, modify, and adapt it for your own projects!
Pin Layout
#define TRIG_PIN 5 #define ECHO_PIN 18 #define SERVO_PIN 19 #define BUZZER_PIN 27 // GPIO 27
Want to build your own or need custom variations? Drop us a message — we’re here to help with parts, code tweaks, or full custom engineering solutions.
Stay tuned for more demos and tutorials from Pacific Custom Engineering!
#ESP32 #Arduino #IoT #Automation #MakerProjects #PacificCustomEngineering