Conveyor Counter With an Ultrasonic Sensor (by Jeppe Andersen)





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

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!



    • Epilog Challenge 9

      Epilog Challenge 9
    • Trash to Treasure

      Trash to Treasure
    • Pro Tips Challenge

      Pro Tips Challenge

    We have a be nice policy.
    Please be positive and constructive.





    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.

    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.

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

    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.