By Wren Calloway Fact-checked by Hugo Lindgren Published
BUILD
What it is
This is a smart product counter that tallies items as they pass a sensor and shows the running total in a desktop app. The Adafruit Blog spotlighted it on 18 November 2026, and the original build is on Hackster.io. An Arduino Nano handles the sensing, and a Python app on a computer handles the counting display, the logging and a CSV export.
How it works
According to the maker’s Hackster.io write-up, the build has three main pieces:
- Board: An Arduino Nano runs an Arduino sketch.
- Sensor: An IR obstacle sensor sits beside the path the products travel. When an item passes in front of it, the sensor detects it and the Nano registers a detection.
- Motors: There are none. This build only senses and counts. It does not move or sort anything.
- Code: The Nano talks to a Python desktop app over a USB serial connection at 9600 baud. The Python GUI shows the total count, the connection status and a detection log. You can export the log as a CSV report.
The data flow, as the write-up describes it:
IR sensor → Arduino Nano → USB serial (9600 baud) → Python GUI → product count and detection log
This split is the useful idea. The microcontroller does the simple, time-sensitive part, which is watching the sensor. The computer does the parts that need a screen and storage, which are displaying, logging and exporting. Each side stays simple, and you can change the Python side without touching the hardware.
Parts list
The write-up’s cost was not confirmed. The prices below are typical street prices for these parts, not figures from the maker.
| Part | Role | Rough price |
|---|---|---|
| Arduino Nano (or compatible) | Reads the IR sensor and sends detections over serial | ~$5–25 (clone vs. official) |
| IR obstacle sensor module | Detects products passing in front of it | ~$1–3 |
| USB cable for the Nano | Provides power and the serial link to the computer | ~$2–5 |
| Jumper wires | Connect the sensor to the Nano | ~$1–3 |
| Computer running Python | Runs the GUI, keeps the count and log, exports CSV | Whatever you already have |
How to build your own
- Difficulty: Beginner. The parts are a low-cost Nano and a common IR sensor module.
- Time: Our estimate is an afternoon, including setting up the Python side. The write-up’s own estimate was not confirmed.
- Skills: Uploading an Arduino sketch, basic wiring of a three-pin sensor module, and running a Python script that reads a serial port.
High-level steps:
- Wire the sensor. Connect the IR obstacle sensor’s power, ground and output pins to the Nano.
- Flash the sketch. Upload an Arduino sketch that watches the sensor output. It should send a message over serial at 9600 baud each time a product is detected.
- Test the serial output. Open the Arduino serial monitor at 9600 baud. Pass an object in front of the sensor and confirm you see a message for each pass.
- Run the Python app. Close the serial monitor so the port is free. Then start the Python GUI and point it at the Nano’s serial port.
- Check the count and log. Confirm the connection status shows connected, the total count goes up for each item, and each detection appears in the log.
- Export a report. Use the CSV export and open the file in a spreadsheet to confirm the data looks right.
- Mount it. Fix the sensor at a steady height and angle beside your conveyor, chute or table edge so each item breaks the beam once.
Reusing it for other counting jobs: The serial-to-Python pattern works for almost anything you can sense. You could swap the IR sensor for a break-beam pair, a limit switch or a hall-effect sensor and keep the same data flow. As long as the Nano sends one message per event, the Python side can count it, log it and export it.
What we would change
These are our suggestions, not flaws confirmed in the original build:
- Debounce the detection. IR obstacle modules can flicker at the edge of their range, so one item might count twice. A short lockout time after each detection on the Arduino side helps.
- Consider a break-beam sensor. Reflective IR obstacle sensors can be affected by an item’s color, shine and the ambient light. A separate emitter and receiver gives a cleaner on/off signal for counting.
- Handle closely spaced items. If products touch each other as they pass, the sensor may see them as one. Spacing them out, or adding a second sensor, makes counts more reliable.
- Reconnect automatically. If the USB cable is bumped, having the Python app detect the dropout and reconnect on its own would keep a long counting session from being lost.
Credit
This build is the work of the maker saya30459. The original write-up, with the full details, lives on Hackster.io. We spotted it through the Adafruit Blog, which featured it on 18 November 2026. Artoo Maker Lab did not build this project. Head to the Hackster.io page for the maker’s own code and instructions.
Notes on this article
- Fact-checked by Hugo Lindgren before publication.
- Published
Fact-checking
- Every claim is checked by Hugo Lindgren; anything we cannot confirm is corrected, labelled or removed.









