ArduinoArduino Projects

Arduino objects product counting system designing and programming

Product counting


Product counting –In this tutorial, you’ll learn how to use Arduino,  16×2 LCD and an  IR infrared sensor to create your own Industrial level product counting system. It will also work with Arduino Mega on this venture.

Object counters and product counters are most widely used in industries around the world, the project we are going to be working on today can be used to count various types of items and goods. I’ll also clarify how you can count objects/products that actually touch each other in this tutorial. Through creating SolidWorks 3d, I’ll explain the whole premise.

The Amazon Purchase links are given below:

Arduino Uno:
Mega 2560:
16×2 lcd:
lm7805 Voltage Regulator:
330-ohm resistors pack:
female DC power jack socket:
470uf capacitors:
5×7 cm Vero board:
female headers:
connection wires:
Super Starter kit for Beginners:
Jumper Wires:
Bread Board:
12v Adaptor:
PCB plate:
Variable Supply:
Digital Multimeter:
Vero Board / stripboard:
Soldering iron kit: “best” You guys should definitely purchase this:
Solder wire:
Wire Stripper:
PCB small portable drill machine:


Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Product counting Circuit Diagram:

Product counting

This is the ball counting process simulation. As you can see

  • Pin number of 16×2 LCD is attached to the ground.
  • The number pin is linked to the 5volts.
  • Pin number which is the LCD’s contrast pin should be connected to variable resistor, and the variable resistor can then be used to control the contrast of the lcd. Because this is only simulation, variable resistor does not need to be attached.
  • The LCD’s rs pin is connected to Arduino’s pin number 9.
  • The LCD pin number is attached to the ground.
  • The LCD’s enable pin is connected to Arduino’s pin number 8.
  • The Arduino pins 4, 5,6 and are connected to the LCD data pins D4 to D7.

16×2 LCD essentially has 16 pins, but pin number 15 and pin number 16 are not shown as you can see. You need to connect pin number 15 with volts and pin number 16 to the ground during the actual hardware connections.

The two push buttons attached to pin number and pin number are the infrared sensors.  This  push  button  will  be used to count the balls when resetting this relay with this push button.

In this project 12v relay will be used; if you want, you can also use 5v relay. The 12v relay form use is SPDT. Each form of relay has pins, coil pins, common pin, normally open and normally close pin.The transistor leg of 2n2222 NPN is attached to the ground while the collector is linked to the relay coil. While the relay coil’s other side is connected to the 12v as it’s a 12-volt relay …

The base of the 2n2222 transistor is connected to a 10k resistor. This transistor is checked using Arduino’s pin number 13. The aim of this relay is to activate the other circuits, when the box is full, it can be used to turn on a buzzer, or it can be used to cause the pneumatic cylinder to move the box.

Download:  simulation

Download:  solidworks files

Product counting Programming:

This is the consumer counting system’s full software. The 16×2 LCD is used, as in this task, to show the number of counted products/objects.  And we’ll have to use the Liquid Crystal library to use this LCD. So began  by  adding  the header file for LiquidCrystal.h.# This is a preprocessor directive, whereas.h is a header file. I marked the LCD’s next buttons.

Use this relay to signal another device or turn light or buzzer on. This will signal that the box is complete to the operator or other machine. You can then remove the box manually or drive it through the pneumatic cylinder and so  on.

Then specified two form unsigned integer variable ballcount and tballs and initially set them to zero.   finally  defined two ballf and resetb variables. Such variables belong to the integer type.

First activated the lcd in the void setup function and entered the number of columns and rows. Since this is 16×2 lcd. 16 columns and rows. Then used the lcd to print “Tballs Current” message. Since this is LCD of 16×2. Sixteen columns and two rows. Then used the lcd to print message “Tballs Current.”Action printing. To print strings on the lcd, the lcd.print function is used. Instead, I turned on the Arduino’s pin number 2 interrupt. The Arduino pin number 2 will be used for counting items or objects. And finally using the function pinMode I told the controller which pins are being inputted and which pins are being outputted.

Watch Video Tutorial

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button