gitwtfhub

wtf is -smart-surgical-counter?

sanskarghongade/-smart-surgical-counter — explained in plain English

Analysis updated 2026-05-18

0C++Audience · developerComplexity · 4/5LicenseSetup · hard

TL;DR

An ESP32-powered device that counts and weighs surgical instruments to catch missing tools before a patient is closed up.

Mindmap

mindmap
  root((smart surgical counter))
    What it does
      Counts instruments
      Weighs tray for cross check
      Flags mismatches
    Tech stack
      ESP32
      HX711 load cell
      IR sensors
      OLED display
    Use cases
      Operating room safety check
      Live web dashboard
      Event logging
    Audience
      Hardware developers
      Embedded hobbyists
    Setup
      Assemble electronics
      Flash with PlatformIO
      Calibrate load cell

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a hardware counter that tracks surgical instruments taken from a tray during an operation.

REASON 2

Cross-check instrument counts against tray weight to catch mismatches automatically.

REASON 3

Monitor live status and event history from a Wi-Fi web dashboard instead of a paper log.

REASON 4

Use the REST API to tare the scale or reset the count from another system.

What's in the stack?

C++ESP32PlatformIOHX711OLEDWi-FiREST API

How it stacks up

sanskarghongade/-smart-surgical-counterachanana/mavsdkalange/llama.cpp
Stars00
LanguageC++C++C++
Last pushed2024-05-20
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/54/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1day+

Requires assembling physical electronics (ESP32, load cell, sensors, OLED) and flashing firmware with PlatformIO.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

This project is a physical device, not just software. It uses a small computer chip called an ESP32 to keep track of surgical instruments during an operation, so a nurse or surgical team can be sure that every tool taken out of a tray is put back before the patient is closed up. Missing instruments after surgery are a real and serious problem, and this build tries to catch that mistake automatically instead of relying only on a manual headcount. The system uses two ways of checking at once. Four infrared sensors watch for instruments passing by and count them, while a load cell, which is a small scale, weighs the tray to confirm the count makes sense. If the count and the weight do not agree, the system flags a mismatch instead of assuming everything is fine. A small screen shows the live status, and lights and a buzzer give quick visual and audio signals. There is also a Wi-Fi dashboard in a web browser, with a simple set of web addresses (an API) to check status, view a log of past events, zero out the scale, or reset the count. Inside, the code is organized in layers: one part talks directly to the hardware, another part handles the sensors and buttons, a logic layer runs the counting and weighing rules through a six-step state machine, and a top layer runs the web server and dashboard. Building it requires assembling the actual electronics, roughly $32 in parts including the chip, sensors, screen, and scale hardware, then flashing the code using a tool called PlatformIO inside VS Code. The README includes a full parts list, wiring pin numbers, and a calibration process for the scale. It is released under the MIT license, which allows free use and modification.

Yoink these prompts

Prompt 1
Explain how the state machine in this smart surgical counter moves between IDLE, COUNTING, VERIFYING, OK, MISMATCH, and ERROR.
Prompt 2
Walk me through wiring the IR sensors, HX711 load cell, and OLED display to an ESP32 for this project.
Prompt 3
Help me calibrate the HX711 load cell using the steps in this README.
Prompt 4
Show me how to call the /api/status and /api/events routes from this project's web dashboard.
Prompt 5
Suggest how to adapt this dual-verification counting approach for tracking a different kind of small parts.

Frequently asked questions

wtf is -smart-surgical-counter?

An ESP32-powered device that counts and weighs surgical instruments to catch missing tools before a patient is closed up.

What language is -smart-surgical-counter written in?

Mainly C++. The stack also includes C++, ESP32, PlatformIO.

What license does -smart-surgical-counter use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is -smart-surgical-counter to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is -smart-surgical-counter for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.