Introduction: Count Objects Using Arduino and Ultrasonic Sensor on a Production Conveyor

Intro:

This instructable explains how to use an ULTRASONIC SENSOR with Arduino to count/ log different packages on a conveyor. The instrucable will cover the physical setup and the program in Arduino.

There will NOT be any information about how to build the lasercutted conveyor that is powered by a stepper motor.

The result will a log over the counted packages in the serial monitor.

Step 1: Partlist

· Arduino UNO board

· SR04 Ultrasonic Sensor

· USB cable type A/B

· Universal 4 pin Grove Cable

Step 2: Connecting the Ultrasonic Sensor to Your Arduino Board

Use the Universal 4 pin Grove Cable to connect the Ultrasonic Sensor to your Arduino board in pin D7. Use the USB A/B cable to connect the Arduino board to your computer. The distance between the sensor and the floor is 128 mm.

Step 3: Write Your Code – or Download It From Here.

When you have uploaded the code to your Arduino you should see something similar to this when opening the serial monitor.

You can edit the intervals in the if-statement to match the objects you want to count. In the example the height of the packages is 40 mm, 53 mm and 72 mm.

Hope you enjoy!

/ Simon Larsson

Comments

author
WaniS2 made it!(author)2016-02-16

can i use ir sensor ??

About This Instructable

13,937views

46favorites

License:

Bio: 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 ... More »
More by KEAprojects:Bosch Uneo Cordless Rotary Hammer project - Group 5 - 1.A - 2016the autopsied printerReverse Engineering Gruppe 5 IBM Monitor
Add instructable to: