Anda di halaman 1dari 17

Design and Construction of a digital object counter

A report on special work submitted in partial fulfilment of the requirements for the 3rd year
ME-3200, Completion in Department of Mechanical Engineering, KUET

Supervised By Submitted By

Mr. Md. Golam Kader A.T.M.Masud

Professor Roll No-1205103

Department of Mechanical Engineering


Khulna University of Engineering & Technology
Khulna-9203, Bangladesh.

Khulna University of Engineering & Technology

Khulna-9203, Bangladesh

February, 2016
ACKNOWLEDGEMENT

Thanks to Almighty Allah for enabling and helping the authors to carry out this project work.

I would like to express deep and sincere gratitude to my supervisor Engr. Mr. Md. Golam Kader,
Professor, Department of Mechanical Engineering, KUET, for his consultation and discussion
which were essential to carry out this work. His perpetual energy and enthusiasm in research had
motivated the authors through his advices a lot. In addition, he was always accessible and willing
to help them to carry out this project.

I want to express my sincere gratitude to Prof. Dr. Nawsher Ali Morol, Head, Department of
Mechanical Engineering, KUET, who gave them permission to work in machine shop, welding
shop and heat engine laboratory.

My thanks are also extended to Vice-chancellor of Khulna University of Engineering &


Technology (KUET), Khulna, Bangladesh for providing support.

A.T.M.Masud

ii
ABSTRACT

This experiment focuses on the design and construction of a digital counter. Counter is used to
count thing anything that pass through them. Generally it can be used industrial purposes or
mechanical purposes where a large and fast process is included.

For this reason, Arduino Uno is used to process the data. Arduino is used as the processor of the
project. Different ir is used to measure sensitivity and on pair is chosen for this job. The sensitivity
of ir is a major issue in here. A sensible value of ir is set so that the possibility of error may be less.

There are many function in Arduino. Specially one is Interrupt. Interrupt can be used in many
ways. In this project interrupt is used to count the objects.

iii
Contents

Title Page
Acknowledgement ii
Abstract iii
Content iv
List of figures v

Chapter I Introduction
1.1 Overview 1
1.2 Objectives 1

Chapter II Apparatus
2.1 Name of the apparatus 2
2.2 Description of the apparatus 2

Chapter III Methodology


3.1 Circuit Overview and principles 6
3.2 Program 7

Chapter IV Discussion 9

Chapter V Conclusions 10

References 11

iv
LIST OF Figures

Title Page

Fig 2.2.1 : IR receiver and transmitter 3

Fig 2.2.2: Arduino Uno 3

Fig 2.2.3 : A 16x2 LCD Display 4

Fig2.2.4 : LM-7805 5

Fig 3.1 : Circuit diagram 6

v
Chapter- I
Introduction

1.1 Overview:
Today in the era of mass production the production is massive. But a need also arises to count the
products made. This can be done by either recruiting a person to count it or by using technology.
Sometimes it is tiresome and possibility of error is very high when the speed is high. Generally if
speed is too high, it is somehow impossible to count.

Also sometimes revolution of disk or rollers should be known. To test any newly created machine,
calculate work or efficiency rpm must be known in some cases. A large portion of mechanical
work is done by rotational work. So a counter is needed.

In the era of integrated circuits and processor it can be made using the chip. To solve this problem
Arduino can be used. Arduino is an open-source computer hardware and software company,
project and user community that designs and manufactures microcontroller-based kits for building
digital devices and interactive objects that can sense and control objects in the physical world. To
count an object or revolution an interrupt is triggered and a LCD display the number of the
interrupt. There are many types of interrupt in Arduino. They are rising edge, falling edge, logical
changes etc. As here we have to count when the signal is lost in ir receiver, falling edge interrupt
is used.

1.2 Objectives :
1. To Count the objects passing through the channel.
2. To count the revolution of a disk or fan.

1
Chapter - II
Apparatus

2.1 Name of the apparatus:


1.IR receiver and transmitter
2. Arduino Uno
3. LCD display
4. Jumpers as connector
5. 9V battery
6. Resistor (10k, 1k, 220)
7. LM7805

2.2 Description of the main apparatus:

2.2.1 IR receiver and transmitter :


The IR transmitter sends an IR radiation(in the infrared wavelength region),which is reflected of a
surface and falls upon a receiver. Due to the falling of light on the receiver a potential difference
is created across the ends. This potential difference is recognized by a microcontroller as HIGH or
LOW.

2
Fig 2.2.1 : IR receiver and transmitter
2.2.2 Arduino Uno:
Arduino is an open-source computer hardware and software company, project and user community
that designs and manufactures microcontroller-based kits for building digital devices and
interactive objects that can sense and control objects in the physical world.
The project is based on microcontroller board designs, manufactured by several vendors, using
various microcontrollers. These systems provide sets of digital and analog I/O pins that can be
interfaced to various expansion boards ("shields") and other circuits. The boards feature serial
communications interfaces, including USB on some models, for loading programs from personal
computers. For programming the microcontrollers, the Arduino project provides an integrated
development environment (IDE) based on the Processing project, which includes support for the
C and C++ programming languages.

Fig 2.2.2: Arduino Uno

3
2.2.3 LCD Display :
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of
applications. A 16x2 LCD display is very basic module and is very commonly used in various
devices and circuits. These modules are preferred over seven segments and other multi segment
LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of
displaying special & even custom characters (unlike in seven segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD
each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command
and Data.
The command register stores the command instructions given to the LCD. A command is an
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the
cursor position, controlling display etc. The data register stores the data to be displayed on the
LCD. The data is the ASCII value of the character to be displayed on the LCD.

Fig 2.2.3 : A 16x2 LCD Display

2.2.4 LM7805:
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage
regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed
voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx
in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated
power supply. Capacitors of suitable values can be connected at input and output pins depending
upon the respective voltage levels.

4
Fig 2.2.4 : LM-7805

Among the other component there is 9v battery which is an ordinary battery that gives constant
9v. To regulate the circuit easily some resistors are connected. Jumpers are used to connect
different component of the project.

5
Chapter –III
Methodology

3.1 Circuit Overview and principles:


When light falls on some materials it generates a voltage. This voltage is so little but it is
significant. This property is used in this project. But there are many kinds of light in atmosphere.
So in this project infrared ray is used. This light is invisible to human eye but it is detected by IR
receiver.
When receiver is generated enough voltage it send a signal to Arduino Uno. But if the signal is
interrupted by any object then receiver can’t get enough light to produce enough voltage. In this
state a interrupt is created which increases the value of a integer variable.
The circuit diagram of the project is given below (this figure is drawn by use of fritzing software)

Fig 3.1 : Circuit diagram

6
3.2 Program :

The program of the project is given below


/*AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

This example code is in the public domain.


*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 6);
int counter=-1;
void setup() {
pinMode(2, INPUT_PULLUP);
attachInterrupt(0, counterFunction, FALLING);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);

7
// print out the value you read:
Serial.println(sensorValue);
lcd.setCursor(0, 1);
// print the number of seconds since reset:
if( sensorValue < 512)
{
digitalWrite(7 , LOW);
digitalWrite(8 , HIGH);
}
else
{
digitalWrite(7 , HIGH);
digitalWrite(8 , LOW);
}
}
void counterFunction()
{
lcd.print(counter);
counter=counter+1;
}

8
Chapter-IV
Discussion

In this project, a counter is made to count objectives or revolution. Something were taken into
account when making this project. The battery power is one of the most vital issue in this because
available battery is so poor to operate tis circuit. Another major issue is IR sensitivity.
IR gives analog input to the Arduino. It is basically hard to give an exact value so that it can
understand when a object is passing or not. In this case the value is given as 512 which is almost
half of the full value when ir receiver can get full light from the transmitter. It is pretty much
correct for every situation but it can be changed if we have to.
When connecting LCD display there is a problem with the basic library function and interrupt
function. A port had to be changed besides the library ports of a LCD to use the interrupt. But it
works just fine.
As 5v battery are not available in market a 9v Battery is used and convert the value into 5v using
the chip LM7805.

9
Chapter –V

Conclusion

A digital counter is made according to the objectives and several tests are done using that device.
The counter works just fine and count everything that crosses the line. It can be used in many
places and project. To count the visitor of a place, to count the product etc. It can be used as a base
project for different application like electricity control or waste reduce. By changing the circuits
and sensor a tachometer can be made. The project uses some cheap sensors which is easy to change
in any circumstances. By changing the analog value any distance can be set to count

10
References

[1] https://www.arduino.cc/en/Guide/Introduction
[2] http://circuitdigest.com/electronic-circuits/ir-transmitter-and-receiver-circuit
[3] http://fritzing.org/projects/ir_sensor
[4] Wikipedia.org/ir_sensor
[5] www.quora.com

11
12

Anda mungkin juga menyukai