Conveyor Counter With an Ultrasonic Sensor (by Jeppe Andersen)




Introduction: Conveyor Counter With an Ultrasonic Sensor (by Jeppe Andersen)

About: KEA is located in the Danish capital of Copenhagen where we teach more than 9000 students in the disciplines within design and technology. These instructables are created by students as documentation of their …

Have you ever wanted to count some going by for some statistics reason.

Then this is maybe the 'droid' your looking for.

With this guide you can only not count objects going by, but also timestamp the objects.

For the following guide you will need the this equipment.

  • 1 x Arduino Uno R3
  • 1 x Groove kit
    • Use the Groove shield and the ultrasonic sensor
  • USB cable (USB-A to USB-B - male & male) - you might know this as a standard printer cable.
  • Conveyor (instruction for this is NOT included in this guide).
  • Some objects to count - I use some 38x57mm wood in different lengths. (mine was about 40, 50 and 70mm)

Step 1: Assemble the Components

With the Groove kit you can easily assemble this kit.

Start by adding the Groove board to the Arduino UNO R3.

Next - insert the Groove cable into D7 (digital pin no. 7) and insert the other end to the Ultrasonic Sensor.

At last, connect the Adafruit SD shield to the Groove kit.

Watch this gif I made: Assemble displayed with a gif

Optional: Insert a CR1220 batteri in the battery slot for the RTC to function correctly.

Step 2: Insert the Code

Please note that the file is commentet a lot. This is generally not a bad thing, but the comments are in danish. I suggest that you simply delete all the text side the // or */ /*

I did not include day, month, year for my experiment. I have included the code in a comment section for the first if function.

Download the .ino file (arduino IDE software generate file).

I have made a small screen record of the serial monitor. Here you can see the code in use.

If you like to expand the project, you can add the SD logging function. Sadly I didn't get mine to work, but maybe you have more luck!

Be the First to Share


    • CNC and 3D Printing Contest

      CNC and 3D Printing Contest
    • Lamps Challenge

      Lamps Challenge
    • Rice & Grains Challenge

      Rice & Grains Challenge



    4 years ago

    You know I have a small production of confectionery products in New Zealand and I use Dyno conveyors system. Their company accepted all my demands and provided for me the best possible solution. As a result it speeds up the working process.


    4 years ago

    this looks awesome, but too complicated to make on my own


    4 years ago


    I am working on a similar project but a smaller one, I have made a conveyor using a NEMA-17 stepper motor along a with a simple LDR based LCD counter.

    But I am stuck to code properly, what exactly I need is:

    Counter should start counting every time object passes the LDR beam, and stops the motor when the number on counter reaches 100.

    Can you help me with the code.


    Reply 4 years ago

    Hi, the students that made this project have graduated. I am Christopher, the teacher of this course. Maybe I can help you? Please send me your code and indicate in it, where it is things go wrong.


    7 years ago

    awesome !!!! can i use it if the conveyer belt is moving at a high speed?


    Reply 7 years ago

    I guess you could. The ping sensor send out a signal every 5 microsecond. Visually you wouldn't be able to read it from the Serial.monitor, as it's coming so fast.