Close
0%
0%

Building a Basketball Hoop Alarm Clock

A client walked into our office with a sketch on a napkin: a miniature basketball hoop mounted above a backboard that doubles as an alarm.

Public Chat
Similar projects worth following
0 followers
To dismiss the alarm, you have to sink a shot. Miss, and it gets louder. We get a lot of unusual requests, but this one stuck with us. It's a genuinely fun mix of mechanical design, sensor fusion, and firmware that has to work reliably at 6 AM when the user is half asleep and mildly annoyed.

The Problem We Were Solving

The alarm needed to detect a ball passing through a hoop reliably. A simple IR beam sensor won't cut it — the ball moves fast, and you get false triggers from hands, arms, and background movement. We needed something that could confirm a real shot, not just motion near the rim.

We also needed it to run for weeks on battery, wake up on schedule, and scream loud enough to wake a heavy sleeper. That combination of constraints shaped almost every hardware decision.

We chose the nRF52840 over an ESP32 because we didn't need WiFi and the Nordic part draws under 3µA in system-off mode. The ESP32 would have worked, but we'd have paid for radio features we weren't using and burned more power.

The VL53L1X was the key call. It gives us distance readings at up to 50Hz with a narrow field of view. We set a detection zone just below the rim plane. A ball crossing that zone produces a specific distance signature over about 150ms — fast enough to catch, slow enough to filter from noise.

What We'd Do Differently

The RTC footprint error cost us a week. We now run a footprint check against the datasheet on every part before sending a board out — a 20-minute review that would have saved five days.

We'd also move to a custom nRF52840 module for v2 instead of the dev kit. The dev kit is fine for firmware work, but it's bulky and the antenna placement inside the enclosure wasn't ideal. A module with a proper ground plane and matched antenna would shrink the board and improve BLE range.

Where This Fits

This project is a good example of what embedded product development services look like end to end — sensor selection, PCB design, firmware on a real RTOS, mechanical design, and a shipped prototype. Every piece had to work together, and the constraints (power, detection reliability, wake-up latency) drove the architecture from the first week.

If you're working on something with similar demands — a device that has to sense the physical world, run on battery, and just work — our embedded application development services team handles this kind of build regularly. We're happy to talk through your sensor and power constraints before you commit to a design.

  • 1 × nRF52840
  • 1 × VL53L1X time-of-flight sensor
  • 1 × MAX98357A I2S amplifier Audio ICs / Audio Amplifiers
  • 1 × DS3231 RTC
  • 1 × 2000mAh LiPo

View all 7 components

  • Week by Week

    Himanshu Dada • an hour ago • 0 comments

    Week 1 — Requirements and feasibility.

    We tested the VL53L1X against a real basketball to check detection reliability. Early results were noisy; we tightened the field of view with a 3D printed baffle and got clean readings.

    Week 2 — Schematic and first PCB.

    Drew the schematic in KiCad, laid out a 4-layer board with a solid ground plane. Sent to JLCPCB for a five-piece run.

    Week 3 — Firmware skeleton.

    Got Zephyr running on the dev kit, brought up the RTC and I2S audio. Confirmed the alarm tone played at the target volume.

    Week 4 — Sensor integration.

    Wired the VL53L1X over I2C, wrote the detection state machine, tuned thresholds with real shots. Hit 97% detection accuracy across 200 test shots — misses were mostly soft layups that barely crossed the zone.

    Week 5 — PCB assembly and bring-up.

    Boards arrived, assembled one by hand. Found a footprint error on the RTC — fixed with a rework and a revised layout.

    Week 6 — Enclosure and integration.

    Printed the enclosure, mounted the sensor and speaker, ran the full system on battery. Got 23 days of standby on a single charge with the alarm firing once daily.

    Week 7 — Field testing and polish.

    Gave it to the client for two weeks of real use. He missed two alarms in that time, both on purpose to test the volume ramp.

View project log

  • 1
    Validate the sensor first

    Before designing any PCB, prove your detection method works with the real object in the real environment. We spent three days on this and it saved us weeks.

  • 2
    Pick an MCU for your power budget, not your feature list

    The nRF52840 was right because idle current mattered more than WiFi.

  • 3
    Structure firmware around tasks from day one

    Zephyr's threading model kept the sensor loop deterministic even while BLE was active.

View all 6 instructions

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates