Count Objects Using Arduino and Ultrasonic Sensor on a Production Conveyor

by KEAprojects in Circuits > Arduino

30174 Views, 52 Favorites, 0 Comments

Count Objects Using Arduino and Ultrasonic Sensor on a Production Conveyor

11.jpg

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.

Partlist

· Arduino UNO board

· SR04 Ultrasonic Sensor

· USB cable type A/B

· Universal 4 pin Grove Cable

Connecting the Ultrasonic Sensor to Your Arduino Board

IMG_20150921_151216.jpg

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.

Write Your Code – or Download It From Here.

Transportband.png

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