T ThinkEdge Learn

Ultrasonic — Object Counter

Count things as they pass — like a door sensor or factory line

Ultrasonic Counter State Industrial
Arduino ultrasonic distance sensor project · Tier 3 · Combined Projects · Intermediate · 30 min · Arduino Uno

What you will learn

What you will need

Component
1× Arduino Uno R3
1× HC-SR04 ultrasonic
7× 220Ω resistor
1× green LED
1× red LED
5× yellow LEDs (count display)
1× breadboard
25× jumper wires

Step by step

Take it further

Practise it before you build it

Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.

Open the interactive lab See plans for your class

Related projects

Ultrasonic — Reverse Parking SensorBeep faster as you get closer Ultrasonic — Pitch by DistanceCloser = higher pitch Arduino — Ultrasonic Distance on SerialRead distance with HC-SR04 and print the cm on Serial Monitor Arduino — Ultrasonic Radar ScannerA servo sweeps the ultrasonic sensor to scan the room Police SirenAlternating red + blue LEDs with a wailing 600–1500 Hz buzzer LDR — Light-Following Robot (Solar Tracker)It always faces the brightest spot

Guides that use this project

2 guides on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.

How to Build a RobotHow to build a robot from scratch: one motor and a switch, then sensors, then a line-follower that steers itself. Every stage runs in a browser simulator first. Robotic Lawn Mowers: Boundary, Blades and BalanceHow robotic lawn mowers find the edge of the grass, why the blade motor causes brownouts, and what a $30 ultrasonic sensor can and cannot do.

Where this project sits

It is also part of these lists, which is how a class usually finds it.

Arduino LED projects for beginners36 projects in this list Arduino ultrasonic distance sensor projects10 projects in this list

Try the full simulator with your class

103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.