Arduino Industrial level Product counting system objects counting

(Last Updated On: October 19, 2019)

Product counting

Description:

Arduino based Product Counting system- In this tutorial, you will learn how to make your own Industrial level product counting system using Arduino, 16×2 LCD and an IR infrared sensor. This Project will also work with Arduino Mega. Object counters or Product counters are most commonly used in industries throughout the world, the project that we will work on today can be used to count different types of objects and products. In this tutorial, I will also explain how you can count objects/products that are actually touching each other. I will explain the whole idea through a SolidWorks 3d design.



The components and tools used in this project can be purchased from Amazon, the components Purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
2n2222 npn transistors: https://amzn.to/2EmXsIb
10k Resistor: https://amzn.to/2KTd6OW
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm Vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / stripboard: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wirecutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

DISCLAIMER:

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!

 

Circuit Diagram:

Product counting

This is the simulation of the balls counting system. As you can see the

  • 16×2 LCD pin number 1 is connected with the ground.
  • Pin number 2 is connected with the 5volts.
  • Pin number 3 which is the contrast pin of the LCD should be connected with a variable resistor, then the variable resistor can be used to control the lcd’s contrast. As this is just a simulation so that’s why there is no need to add a variable resistor.
  • The rs pin of the LCD is connected with pin number 9 of the Arduino.
  • Pin number 5 of the LCD is connected with the ground.
  • The enable pin of the LCD is connected with pin number 8 of the Arduino.
  • Pins 4, 5,6 and 7 of the Arduino are connected with the data pins D4 to D7 of the LCD.


16×2 LCD has basically 16 pins but as you can see pin number 15 and pin number 16 are not shown. During the real hardware connections, you need to connect pin number 15 with 5 volts and pin number 16 with the ground.

These two push buttons which are connected with pin number 2 and pin number 3 represents the infrared sensors. So this push button will be used for counting the balls, while this push button will be used to reset this relay.

A 12v relay will be used in this project; if you want you can also use a 5v relay. The type of the 12v relay I am using is SPDT. This type of the relay has 5 pins, two coil pins, common pin, normally open and normally closed pin. The 2n2222 NPN transistor emitter leg is connected with the ground while the collector is connected with the relay coil. While the other side of the relay coil is connected with the 12v as it’s a 12-volt relay…

A 10k resistor is connected with the base of the 2n2222 transistor. This transistor is controlled using pin number 13 of the Arduino. The purpose of this relay is to trigger the other circuits, it can be used to turn on a buzzer when the box is filled, or this relay can be used to trigger the pneumatic cylinder to push the box. For the Solidworks model explanation watch video given at the end of the Programming.


Download:  Proteus Simulation

simulation

Download:  SolidWorks model

solidworks files

Product counting Arduino Programming :

This is the complete Program of the product counting system. As in this project, the 16×2 LCD is used for displaying the number of the Products/objects counted. So to use this LCD we will need to include the LiquidCrystal library. So I started by adding the LiquidCrystal.h header file. # means that this is a preprocessor directive while .h means that this is a header file. The next I defined pins of the LCD.

This relay will be used to signal another machine or turn on a light or a buzzer. This will signal the operator or another machine that the box is full. Then you can manually remove the box, or push it through pneumatic cylinder etc.

Then I defined two variables ballcount and tballs of the type unsigned integer and initially set these variable to zero.  Finally, I defined two variables ballf and resetb. These variables are of the type integer.


In the void setup function, first I activated the LCD and entered the number of columns and rows. As this is a 16×2 LCD. 16 columns and 2 rows. Then I printed a message “Tballs    Current” using the lcd.print function. the lcd.print function is used to print strings on the LCD. Then I activated the interrupt on pin number 2 of the Arduino. Pin number 2 of the Arduino will be used for the products or objects counting. And finally using the pinMode function I told the controller which pins are input and which pins are output.

Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Close