1 / 7
Smart Box - Auto-Opening Box with Ultrasonic Sensor & Servo (Arduino STEM project) — zdjęcie 1
1 / 7

Smart Box - Auto-Opening Box with Ultrasonic Sensor & Servo (Arduino STEM project)

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

Lid opens automatically when the ultrasonic sensor detects your hand. Arduino + HC-SR04 + servo. Made with students.

Ocena
0 / 5
Polubienia
3
Pobrania
16
Wydruki
0
Wyświetlenia
79
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
Electronics
Licencja
Creative Commons — Attribution

Smart Box – Auto-Opening Box

A smart box whose lid opens automatically when you bring your hand close to it. An ultrasonic distance sensor (HC-SR04) detects your hand, and a servo motor lifts the lid through a lever arm. I designed this model myself and built it together with my students at Robotic Edu (Tashkent, Uzbekistan). It's a great first Arduino project for kids learning sensors, servos and if/else logic.

Parts to print

  • SmartBox_Body_Idish – main box body (holes on top for the HC-SR04 sensor)

  • SmartBox_Lid_Qopqoq – hinged lid

  • SmartBox_Lever_Tirsak – 2-part lever arm connecting the servo to the lid

  • SmartBox_Assembly – full assembly for reference (body + lid)

Approximate size: 100 × 122 × 108 mm (assembled).

Electronics

  • Arduino Uno / Nano (or ESP32)

  • HC-SR04 ultrasonic sensor

  • Micro servo motor (e.g. SG90)

  • Jumper wires, USB cable or battery

How it works

The Arduino measures distance with the HC-SR04. If an object is closer than ~15 cm, the servo rotates and opens the lid; after a few seconds it closes again.

Print tips

PLA, 0.2 mm layer height, 15–20% infill. Supports only where needed.

Code

The Arduino sketch is included in the files: SmartBox.ino.

  1. Install the Arduino IDE.

  2. Open SmartBox.ino. The Servo library is built in.

  3. Select Arduino Uno (or Nano) and the correct port, then click Upload.

  4. Open the Serial Monitor (9600 baud) to see the measured distance.

Calibration: the lid is closed at 0° and open at 90°. If it doesn't close fully or opens too far, change SERVO_CLOSED_ANGLE and SERVO_OPEN_ANGLE at the top of the code. The opening distance is set by OPEN_DISTANCE_CM (default 15 cm).

Wiring

  • HC-SR04: VCC → 5V, GND → GND, TRIG → D5, ECHO → D6

  • SG90 servo: red (VCC) → 5V, brown (GND) → GND, orange (signal) → D9

See the wiring diagram in the gallery. Tip: if the servo jitters, power it from a separate 5V supply and connect the GNDs together.

Bill of materials

  • 1× Arduino Uno or Nano

  • 1× HC-SR04 ultrasonic sensor

  • 1× SG90 micro servo

  • ~10× jumper wires

  • USB cable or 5V power bank

What students learn

  • How an ultrasonic sensor measures distance (time of flight)

  • Controlling a servo motor

  • if/else logic, timers with millis(), filtering noisy sensor data

Feel free to print, remix and use it in your classes! Please share your makes 🙂


🇺🇿 O'zbekcha

Qo'lingizni yaqinlashtirsangiz, qopqog'i avtomatik ochiladigan aqlli quti (Smart box). Ultrasonik sensor (HC-SR04) qo'lni aniqlaydi, servo motor esa tirsak orqali qopqoqni ochadi. Modelni o'zim chizganman va Robotic Edu o'quvchilarim bilan birgalikda yasaganmiz. Arduino'ni endi o'rganayotgan bolalar uchun ajoyib loyiha.

  • Idish – qutining asosiy qismi

  • Qopqoq – qopqoq

  • Tirsak – servo va qopqoqni bog'lovchi richag (2 qism)

  • Assembly – yig'ilgan holati

Kerakli qismlar: Arduino Uno/Nano, HC-SR04 ultrasonik sensor, servo motor (masalan SG90), simlar. Bepul yuklab oling, chop eting va darslaringizda foydalaning!

Kod va ulanish

Arduino kodi fayllar ichida: SmartBox.ino. Kodni Arduino IDE'da oching, Arduino Uno platasini tanlang va Upload tugmasini bosing.

  • HC-SR04: VCC → 5V, GND → GND, TRIG → D5, ECHO → D6

  • Servo: qizil sim → 5V, jigarrang sim → GND, to'q sariq sim → D9

Qopqoq 0° da yopiq, 90° da ochiq. To'liq yopilmasa, koddagi SERVO_CLOSED_ANGLE va SERVO_OPEN_ANGLE qiymatlarini o'zgartiring.

Tagi