visvesvaraya technological university belgavi 590010 … · visvesvaraya technological university...

54
VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 V S M INSTITUTE OF TECHNOLOGY NIPANI591237, KARNATAKA Department of Electronics and Communication Engineering 2015-16 A Project Report On “SMART MACHINE FOR PLASTIC WASTE DISPOSAL” A Dissertation work submitted in partial fulfillment for the award of the degree of Bachelor of Engineering In Electronics and Communication Engineering Submitted By STUDENT NAME Alpesh V. Upadhye : Sandeep A. Sankpal : Sheetal A. Shinde : Varsharani M. Bhivashe : USN 2VS12EC402 2VS12EC423 2VS12EC022 2VS12EC029 Under the Guidance of Prof. K. G. Vasedar Prof. Chetan Alatagi Department of Electronics and Communication Engineering V S M Institute of Technology Nipani, Karnataka.

Upload: phamkhanh

Post on 26-Jun-2018

244 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

BELGAVI – 590010

V S M INSTITUTE OF TECHNOLOGY

NIPANI– 591237, KARNATAKA

Department of Electronics and Communication Engineering

2015-16

A Project Report On

“SMART MACHINE FOR PLASTIC WASTE DISPOSAL”

A Dissertation work submitted in partial fulfillment for the award of the degree of

Bachelor of Engineering

In

Electronics and Communication Engineering

Submitted By

STUDENT NAME

Alpesh V. Upadhye :

Sandeep A. Sankpal :

Sheetal A. Shinde :

Varsharani M. Bhivashe :

USN

2VS12EC402

2VS12EC423

2VS12EC022

2VS12EC029

Under the Guidance of

Prof. K. G. Vasedar

Prof. Chetan Alatagi

Department of Electronics and Communication Engineering

V S M Institute of Technology

Nipani, Karnataka.

Page 2: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

VSM INSTITUTE OF TECHNOLOGY

NIPANI – 591237, KARNATAKA

Department of Electronics and Communication Engineering

2015-16

Certificate

Certified that the project work entitled

“SMART MACHINE FOR PLASTIC WASTE DISPOSAL” Carried out by Alpesh.

V. Upadhye, Sandeep A. Sankpal, Sheetal A. Shinde, Varsharani M. Bhivashe bearing

USN: 2VS12EC402, 2VS12EC423, 2VS12EC022 ,2VS12EC029 bonafide students of

V S M Institute of Technology, Nipani in partial fulfillment for the award of

Bachelor of Engineering in Electronics and Communication Engineering of the

Visvesvaraya Technological University, Belgaum during the year 2015-16. It is

certified that all corrections/suggestions indicated for Internal Assessment have been

incorporated in the Report deposited in the departmental library. The project report has

been approved as it satisfies the academic requirements in respect of Project work

prescribed for the said Degree.

Project Guide H.O.D Principal

Prof. K. G. Vasedar

Prof. Chetan Alatagi

Prof. G. P. Kadam Dr. U. S. Hampannavar

Page 3: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

Abstract:

A smart machine for plastic waste disposal is a system which accepts Plastic wastes

(bottles) for recycling and in return dispenses money or tickets to the operator who recycles

the waste. The reverse vending machine is equipped with a bar code reader which reads the

barcode on the bottle and collects information about the bottle to distinguish between different

kinds of bottles. It is also equipped with a weight calculator to determine the weight of the

bottles. Depending upon the quantity, weight and type the amount of reimbursement is decided

by the machine.

This invention relates in general to waste management and recycling the plastic waste

(bottles) in the environment. The littering of plastic wastes in the environment and less

willingness to recycle the plastic presents a continuing problem to environment and to all the

living beings.

Page 4: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

ii

ACKNOWLEDGEMENT

We place on record and warmly acknowledge the continuous encouragement, invaluable

supervision, timely suggestions and inspired guidance offered by our guide Prof. K. G.

Vasedar, Prof. Chetan Alatagi Department of Electronics and Communication

Engineering V S M Institute of Technology, Nipani in bringing this project to a successful

completion.

We are grateful to Prof. G. P. Kadam, Head of the Department of Electronics and

Communication Engineering, for permitting us to make use of the facilities available in

the department to carry out the project successfully.

We express our sincere gratitude to Dr. U. S. Hampannavar, Principal, V S M Institute

of Technology, Nipani for his support and encouragement.

We would like to extend our thanks to the teaching and non teaching staff of our

department, friends, parents and well wishers for their timely help either directly or

indirectly for the completion of project.

Finally we extend our gratefulness for all those who are directly or indirectly involved in

the successful completion of this project work.

.

Alpesh V. Upadhye

Sandeep A. Sankpal

Sheetal A. Shinde

Varsharani M. Bhivashe

Page 5: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

“Smart machine for plaStic waSte

diSpoSal”

Page 6: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

DEPARTMENT OF ELECTRONICS AND COMMUNICATION

V S M INSTITUTE OF TECHNOLOGY

NIPANI-591237, KARNATAKA

DECLARATION

We the students, Mr. Alpesh V. Upadhye, Mr. Sandeep A. Sankpal, Miss. Sheetal A. Shinde,

Miss. Varsharani M. Bhivashe bearing USN: 2VS12ec402, 2vs12ec423, 2vs12ec022,

2vs12ec029 do hereby declare that, the project work entitled “SMART MACHINE FOR

PLASTIC WASTE DISPOSAL”, has been independently carried out by us under the guidance

of Mrs. K. G. Vasedar, Asst. Professor & Mr. Chetan Alatagi, Asst. Professor Dept of E&C,

VSM Institute of Technology, Nipani. This project work is submitted to Visvesvaraya

Technological University in partial fulfilment of the requirements for the award of the degree of

Bachelor of Engineering in “Electronics and Communication” during the academic year

2015-2016 I also declare that, I have not submitted this dissertation work to other University for

the award of any degree.

Place: Nipani Signature of the Candidate

Date: Alpesh V. Upadhye (2VS12EC402)

Sandeep A. Sankpal (2VS12EC423)

Sheetal A. Shinde (2VS12EC022)

Varsharani M. Bhivashe (2VS12EC029)

Page 7: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

CONTENTS

Chapter No Particulars

1. Introduction

2. Hardware

2.1) Arduino Mega 2560 microcontroller board:

2.2)The USB host shield:

2.3) Motor driver circuit:

2.4)The L293 D motor driver IC:

2.5) The 16 x 2 character LCD display

2.6) The infrared Obstacle sensor:

2.7) The Servo motor:

2.8) The DC geared motor:

3. Software

3.1) Compile and upload the sketch to arduino board.

4. flow Chart of the project

5. 5.1) Advantages

5.2) Disadvantages

5.3) Applications

6. 6.1) Future scope

6.2) Conclusion

7. References

Page 8: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

TABLE OF FIGURES

Fig 1 Block diagram of the project

Fig 2 Arduino Mega 2560 microcontroller board

Fig 3 Pinout of Atmega 2560

Fig 4 Pin mapping of microcontroller board

Fig 5 USB host shield

Fig 6 Motor driver

Fig 7 H-Bridge circuit

Fig 8 IC L293D Pin diagram

Fig 9 16 x 2 Character LCD

Fig 10 Transmission and reception of IR signal

Fig 11 Servo motor internal structure

Fig 12 Servo motor

Fig 13 DC geared motor

Fig 14 Barcode beam

Fig 15 Flow chart of the project

Page 9: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 1

CHAPTER 1

INTRODUCTION

It is known that the amount of plastic produced daily and usage of such plastic

materials is continuously harming the environment and is threat to the earth. The amount

of bottles used in today’s world is too much and the recycling of such bottles is done in

very less quantity. So to tackle such a huge problem by making the recycling procedure

easy and profitable for a common man, we came up with this idea of smart machine for

plastic waste disposal. The operation of such machine is simple as that of an ATM

machine. This is a machine equipped with an inlet to accept bottles. The inlet is opened

for the operator to place the bottle in it. After the bottle is place inside the inlet, the inlet

is closed. This is done by using an infrared sensor and a motor. Every plastic bottle

produced today has a barcode printed on it. So the smart machine for plastic waste

disposal is also equipped with a bar code reader to extract the data stored in it. This data

is processed by the Atmega2560 controller operating in this machine. So the Atmega2560

will helps this machine decide to accept the bottle for recycling or not. If the bottle is

accepted then the microcontroller will dispense the coins at the outlet. If not, the bottle is

returned to the user.

This project can be advantageous at various locations not limited to railway

stations, bus stands or shopping malls. The huge amount of plastic bottle wasted which is

dumped on these public places can be easily collected if such machines are installed at

these places.

Page 10: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 2

Block Diagram:

Fig 1: Block diagram of the project.

DC motor

Driver

Microcontroller board

Arduino Mega 2560 with

USB host

Barcode sensor

DC motors to

drive the gates

COIN dispensing

mechanism powered by

servo motor

TSOP Based

Obstacle sensor

Page 11: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 3

To simply the way of approaching the project the project is divided into following

phases.

1.1) Interfacing of Barcode sensor

1.2) Interfacing the actuators

1.3) Coin dispensing mechanism

1.1) Interfacing the barcode sensor: This is the most important phase of the

project as the working of entire project depends on interfacing the barcode sensor

and getting the values of barcode. Every bottle in which can be accepted as waste

by the machine has a unique barcode printed on it. When the bottle is places in

machine the barcode sensor reads the value of barcode and sends the string to

microcontroller, which process the data and takes the decision regarding the

accepting or rejecting the bottle.

1.2) Interfacing the actuators: The actuators such as DC motors and servo

motors are requires for bottle accepting mechanisms and coin dispensing

mechanisms of the project. After reading the value from the barcode, if the bottle

is acceptable, the microcontroller sends the signal to the actuator to open the gate

which accepts the bottle and also to the servo motor to actuate to dispense the

coin.

1.3) The coins dispensing mechanism: This is driven by a high precision servo

motor and is use to dispense the coins in return of bottle. This consists of a

mechanical system which is used to dispense the coins.

Page 12: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 4

CHAPTER 2

HARDWARE

This project requires interfacing of different sensors and other hardware components to

make the machine accept the bottles. The following are the different hardware

components used in this project

2.1) Arduino Mega 2560 microcontroller board:

Fig 2: Arduino Mega 2560 microcontroller board

A microcontroller is a self-contained system with peripherals, memory and a

processor that can be used as an embedded system for processing signals. Most

programmable microcontrollers that are used today are embedded in other consumer

products or machinery including phones, peripherals, automobiles and household

appliances for computer systems. Due to that, another name for a microcontroller is

"embedded controller." Some embedded systems are more sophisticated, while others

have minimal requirements for memory and programming length and a low software

complexity. Input and output devices include solenoids, LCD displays, relays, switches

and sensors for data like humidity, temperature or light level, amongst others.

Page 13: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 5

A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer

on a single integrated circuit containing a processor core, memory, and programmable

input/output peripherals. Program memory in the form of Ferroelectric RAM , NOR flash

or OTP ROM is also often included on chip, as well as a typically small amount of RAM.

Microcontrollers are designed for embedded applications, in contrast to the

microprocessors used in personal computers or other general purpose applications.

Microcontrollers are used in automatically controlled products and devices, such

as automobile engine control systems, implantable medical devices, remote controls,

office machines, appliances, power tools, toys and other embedded systems. By reducing

the size and cost compared to a design that uses a separate microprocessor, memory, and

input/output devices, microcontrollers make it economical to digitally control even more

devices and processes. Mixed signal microcontrollers are common, integrating analog

components needed to control non-digital electronic systems.

Some microcontrollers may use four-bit words and operate at clock rate

frequencies as low as 4 kHz, for low power consumption (single-digit milliwatts or

microwatts). They will generally have the ability to retain functionality while waiting for

an event such as a button press or other interrupt; power consumption while sleeping

(CPU clock and most peripherals off) may be just nano-watts, making many of them well

suited for long lasting battery applications. Other microcontrollers may serve

performance-critical roles, where they may need to act more like a digital signal processor

(DSP), with higher clock speeds and power consumption.

The microcontroller used in this project is Arduino Mega consisting of Atmega

2560.

The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller

combines 256KB ISP flash memory, 8KB SRAM, 4KB EEPROM, 86 general purpose

I/O lines, 32 general purpose working registers, real time counter, six flexible

timer/counters with compare modes, PWM, 4 USARTs, byte oriented 2-wire serial

interface, 16-channel 10-bit A/D converter, and a JTAG interface for on-chip debugging.

The device achieves a throughput of 16 MIPS at 16 MHz and operates between 4.5-5.5

volts. By executing powerful instructions in a single clock cycle, the device achieves a

Page 14: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 6

throughput approaching 1 MIPS per MHz, balancing power consumption and processing

speed.

2.1.1) Atmega 2560 features:

High Performance, Low Power AVR® 8-Bit Microcontroller

Advanced RISC Architecture

135 Powerful Instructions – Most Single Clock Cycle Execution

o 32 x 8 General Purpose Working Registers

o Fully Static Operation

o Up to 16 MIPS Throughput at 16 MHz

o On-Chip 2-cycle Multiplier

High Endurance Non-volatile Memory Segments

o 64K/128K/256K Bytes of In-System Self-Programmable Flash

o 4K Bytes EEPROM

o 8K Bytes Internal SRAM

o Write/Erase Cycles: 10,000 Flash/ 100,000 EEPROM

o Data retention: 20 years at 85°C/ 100 years at 25°C

o Optional Boot Code Section with Independent Lock Bits

In-System Programming by On-chip Boot Program

True Read-While-Write Operation

o Programming Lock for Software Security Endurance: Up to 64K Bytes

Optional External Memory Space

JTAG (IEEE std. 1149.1 compliant) Interface

o Boundary-scan Capabilities According to the JTAG Standard

o Extensive On-chip Debug Support

Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG

Interface

Peripheral Features

Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode

Four 16-bit Timer/Counter with Separate Prescaler, Compare- and Capture Mode

Real Time Counter with Separate Oscillator

Page 15: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 7

Four 8-bit PWM Channels

Six/Twelve PWM Channels with Programmable Resolution from 2 to 16 Bits

(ATmega1281/2561, ATmega640/1280/2560)

Output Compare Modulator

8/16-channel, 10-bit ADC (ATmega1281/2561, ATmega640/1280/2560)

Two/Four Programmable Serial USART

(ATmega1281/2561,ATmega640/1280/2560)

Master/Slave SPI Serial Interface

Byte Oriented 2-wire Serial Interface

Programmable Watchdog Timer with Separate On-chip Oscillator

On-chip Analog Comparator

Interrupt and Wake-up on Pin Change

Special Microcontroller Features

Power-on Reset and Programmable Brown-out Detection

Internal Calibrated Oscillator

External and Internal Interrupt Sources

Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,

Standby and Extended Standby

I/O and Packages

54/86 Programmable I/O Lines (ATmega1281/2561, ATmega640/1280/2560)

64-pad QFN/MLF, 64-lead TQFP (ATmega1281/2561)

100-lead TQFP, 100-ball CBGA (ATmega640/1280/2560)

Temperature Range:

o -40°C to 85°C Industrial

Ultra-Low Power Consumption

Active Mode: 1 MHz, 1.8V: 500 µA

Power-down Mode: 0.1 µA at 1.8V

Page 16: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 8

2.1.2) Atmega 2560 pin diagram:

Fig 3: Pinout of Atmega 2560

Page 17: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 9

2.2) The USB host shield:

The USB host shield is required to make the microcontroller interact with the

USB devices. Since the barcode sensor used in this project is a USB device, there needs

to be a way to make the microcontroller interact with the barcode sensor and get the

readings.

The USB host shield used in this project is as shown below.

Fig 5: USB host shield.

The Keyes USB Host Shield allows you to connect a USB device to your Arduino

board. It is based on the MAX3421E (datasheet), which is a USB peripheral/host

controller containing the digital logic and analog circuitry necessary to implement a full-

speed USB peripheral or a full-/low-speed host compliant to USB specification rev 2.0.

Page 18: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 10

This is based on revision 2.0 of USB Host Shield. Thanks to new interface layout

it is now compatible with more Arduino - not only UNO and Duemilanove, but also Mega

and Mega 2560 work with Standard variant of this shield out of the box. No more SPI re-

wiring and code modifications - just solder included stackable connectors (2x3 ICSP

connector's female side should be facing down), plug and play!

Specifications

Works with standard (dual 5/3.3V) and 3.3V-only (for example, Arduino Pro)

boards.

Operates over the extended -40°C to +85°C temperature range

Complies with USB Specification Revision 2.0 (Full-Speed 12Mbps Peripheral,

Full-/Low-Speed 12Mbps/1.5Mbps Host)

The following device classes are currently supported by the shield:

HID devices, such as keyboards, mice, joysticks, etc.

Mass storage devices, such as USB sticks, memory card readers, external hard

drives (FAT32 Type File System - Arduino Mega only)

USB Host shields are available in two form factors – full size and Mini. Full size

shield is designed to fit on top of “Standard” Arduinos, such as Uno, Duemilanove, Mega

1280/2560, and compatible clones. Full size shield has been designed for ease of use; it

has plenty of empty space, features extra pads, solder jumpers and extensive silkscreen

markings, simplifying board modification and troubleshooting. Full size shield is

recommended for basic prototyping and simple projects. Mini shield main advantages are

low size, weight and cost. Ideally, it should be used together with Arduino Pro Mini 3.3V

board. It can be mated with other Arduino and non-Arduino MCU boards, but it takes

more work. Small size, dense part placement and lack of silkscreen markings make this

board more suitable for advanced projects, as well as semi-permanent and permanent

installations, when basic functionality and wiring is already confirmed on larger

prototype. Generally, modification and troubleshooting of Mini shield board is more

difficult. Full-size shield USB Host Shield 2.0 exists in 2 configurations – “Standard”

and “3.3V”. The layout of Standard board is depicted on the right. The board contains

Maxim MAX3421E USB host controller, 12MHz crystal, level shifters, resistors,

Page 19: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 11

capacitors, Reset button and USB A-type connector. There are also a number of solder

pads and jumpers, which are marked with red arrows.

2.3) Motor driver circuit:

Fig 6: Motor driver

1) Power Select: 2 solder jumpers marked “5V” and “3.3V”. They are used for

different power configurations. The configuration shown, when both jumpers are closed,

is suitable for official Arduino, such as UNO, Duemilanove, Mega and Mega 2560. See

Power Options section for detailed explanation.

2) Power pins: These are used to connect to power pins of Arduino board. RESET,

3.3V, 5V and GROUND signals from this connector are used.

Page 20: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 12

3) Analog pins: are not used by the shield. They are provided to simplify mounting

and provide pass-through for shields mounted atop of USB Host Shield in a stack.

4) GPIN pins: Eight 3.3V general-purpose digital input pins of MAX3421E. They are

used primarily to interface with buttons, rotary encoders and such. GPIN pins can also be

programmed as a source of MAX3421E interrupt. An example of GPIN use can be seen

in digital camera controller project.

5) ICSP connector: is used by the shield to send/receive data using SPI interface.

SCK, MOSI, MISO and RESET signals from this connector are used.

6) GPOU T pins: are eight 3.3V general-purpose digital output pins of MAX3421E.

They can be used for many purposes; I use it to drive HD44780-compatible character

LCD, as can be seen in digital camera controller circuit, as well as this keyboard example.

Max LCD library which is part of standard USB Host library software package uses some

of GPOUT pins.

7) Digital I/O pins 0-7: like already mentioned analog pins are not used by the shield

and provided only for convenience.

8) Digital I/O pins 8-13: In this group, the shield in its default configuration uses

pins 9 and 10 for INT and SS interface signals. However, standard-sized Arduino boards,

such as Duemilanove and UNO have SPI signals routed to pins 11-13 in addition to ICSP

connector, therefore shields using pins 11-13 combined with standard-sized Arduino will

interfere with SPI. INT and SS signals can be re-assigned to other pins (see below); SPI

signals can not be re-assigned.

9) MAX3421E interface pads: are used to make shield modifications easier. Pads

for SS and INT signals are routed to Arduino pins 10 and 9 via solder jumpers. In case

pin is taken by other shield an re-routing is necessary, a trace is cut and corresponding

pad is connected with another suitable Arduino I/O ping with a wire. To undo the

operation, a wire is removed and jumper is closed. See interface modifications section for

more information.GPX pin is not used and is available on a separate pad to facilitate

further expansion. It can be used as a second interrupt pin of MAX3421E.

Page 21: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 13

10) VBUS power pad: This pad is used in advanced power configurations, described

in Power Options section.

2.4) The L293 D motor driver IC:

The L293 D motor driver IC is used in this project is operate the gate to accept or

reject the bottle. If the bottle placed in the machine is accepted by the microcontroller,

then the motor driver activates the motor thereby accepting the bottle. Thus the direction

control is required for operating the gate of the motor to and fro.

L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as

current amplifiers since they take a low-current control signal and provide a higher-

current signal. This higher current signal is used to drive the motors.

2.4.1) what is an H-Bridge?

An H bridge is an electronic circuit that enables a voltage to be applied across a

load in either direction. These circuits are often used in robotics and other applications to

allow DC motors to run forwards and backwards.

Fig 7: H-Bridge circuit

Page 22: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 14

Most DC-to-AC converters (power inverters), most AC/AC converters, the DC-to-

DC push–pull converter, most motor controllers, and many other kinds of power

electronics use H bridges. In particular, a bipolar stepper motor is almost invariably

driven by a motor controller containing Two H Bridges.

H bridges are available as integrated circuits, or can be built from discrete

components. The term H Bridge is derived from the typical graphical representation of

such a circuit. An H bridge is built with four switches (solid-state or mechanical). When

the switches S1 and S4 (according to the first figure) are closed (and S2 and S3 are open)

a positive voltage will be applied across the motor. By opening S1 and S4 switches and

closing S2 and S3 switches, this voltage is reversed, allowing reverse operation of the

motor.

Using the nomenclature above, the switches S1 and S2 should never be closed at

the same time, as this would cause a short circuit on the input voltage source. The same

applies to the switches S3 and S4. This condition is known as shoot-through.

S1 S2 S3 S4 Result

1 0 0 1 Motor moves right

0 1 1 0 Motor moves left

0 0 0 0 Motor free runs

0 1 0 1 Motor brakes

1 0 1 0 Motor brakes

1 1 0 0 Shoot-through

0 0 1 1 Shoot-through

1 1 1 1 Shoot-through

Page 23: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 15

Table 1: Motor driven conditions.

The H-bridge arrangement is generally used to reverse the polarity of the motor,

but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the

motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is

effectively disconnected from the circuit. The following table summarizes operation, with

S1-S4 corresponding to the diagram above.

L293D contains two inbuilt H-bridge driver circuits. In its common mode of

operation, two DC motors can be driven simultaneously, both in forward and reverse

direction. The motor operations of two motors can be controlled by input logic at pins 2

& 7 and 10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10

will rotate it in clockwise and anticlockwise directions, respectively.

Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to

start operating. When an enable input is high, the associated driver gets enabled. As a

result, the outputs become active and work in phase with their inputs. Similarly, when the

enable input is low, that driver is disabled, and their outputs are off and in the high-

impedance state. The pin out of L293 is as given below.

Page 24: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 16

Fig 8: L293D Pin diagram.

Pin

No

Function Name

1 Enable pin for Motor 1; active high Enable 1,2

2 Input 1 for Motor 1 Input 1

3 Output 1 for Motor 1 Output 1

4 Ground (0V) Ground

5 Ground (0V) Ground

Page 25: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 17

6 Output 2 for Motor 1 Output 2

7 Input 2 for Motor 1 Input 2

8 Supply voltage for Motors; 9-12V (up to 36V) Vcc2

9 Enable pin for Motor 2; active high Enable 3,4

10 Input 1 for Motor 1 Input 3

11 Output 1 for Motor 1 Output 3

12 Ground (0V) Ground

13 Ground (0V) Ground

14 Output 2 for Motor 1 Output 4

15 Input2 for Motor 1 Input 4

16 Supply voltage; 5V (up to 36V) Vcc1

Table 2: Pin description of L293D

2.5) The 16 x 2 character 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.

Page 26: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 18

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 9: Pin Diagram of 16 x 2 Characters LCD

Pin

No Function Name

1 Ground (0V) Ground

2 Supply voltage; 5V (4.7V – 5.3V) Vcc

3 Contrast adjustment; through a variable resistor VEE

4 Selects command register when low; and data

register when high

Register

Select

Page 27: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 19

5 Low to write to the register; High to read from the

register

Read/write

6 Sends data to data pins when a high to low pulse is

given

Enable

7

8-bit data pins

DB0

8 DB1

9 DB2

10 DB3

11 DB4

12 DB5

13 DB6

14 DB7

15 Backlight VCC (5V) Led+

16 Backlight Ground (0V) Led-

Table 3: Pin description of 16 x 2 LCD.

2.6) The infrared Obstacle sensor:

The obstacle sensor is used to detect if the bottle is placed in the machine for

detection. In this project an infrared obstacle sensor is used which detects the presence of

bottle below obstacle sensor.

2.6.1) Detecting Obstacle with IR (Infrared) Sensor

Page 28: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 20

The basic concept of IR (infrared) obstacle detection is to transmit the IR

signal(radiation) in a direction and a signal is received at the IR receiver when the IR

radiation bounces back from a surface of the object.

Fig 10: Transmission and reception of IR signal.

Here in the figure the object can be anything which has certain shape and size, the

IR LED transmits the IR signal on to the object and the signal is reflected back from the

surface of the object. The reflected signals are received by an IR receiver. The IR receiver

can be a photodiode / phototransistor or a readymade module which decodes the signal.

In order to implement the IR obstacle detection, we need to understand the

following.

We need to understand how to transmit IR signal using commercially available

electronic components.

Same way we also need to understand the IR receiver.

Our main focus in this document is to explain the implementation of IR based obstacle

detection in detail.

IR Transmitter

Page 29: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 21

In general, the basic building block of any IR transmitter is modulation of the information

signal with carrier signal, because the receiver modules which are available off-the-shelf

are made for a particular carrier frequency. So it is clear that when you chose a particular

IR receiver module, you also need to transmit the the modulated wave with the same

carrier frequency of that of a IR receiver module.

Modulating a 38 Khz carrier signal.

ON state = 10ms

OFF state = 90ms

The figure above explains the modulation process, this is similar to OOK (ON-OFF

Keying) modulation, where the carrier signal is ON for certain period of time. When

transmitting a signal for obstacle detection, it is necessary that the carrier signal is

transmitted for a short while and remains OFF for longer period of time.

If the transmission of the carrier signal is prolonged, in other words, instead of having a

short transmission period(10 milliseconds in our case, as explained in the figure) of

carrier signal, if we have it for a long period of time then the receiver module will treat it

as a noise and ignores receiving the transmitted signal.

Now let us have a look at the IR transmitter using 7555 timer IC

Page 30: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 22

Here in the figure 5k ohms pot is used instead of 1200 ohms resister, so that it can

be adjusted for 38 kHz frequency. This adjustment is required because of the tolerance

value of the components used in the circuit. The best way to overcome this is to connect

the circuit to the oscilloscope and trim the pot to get 38 kHz. In case you don’t have

access to oscilloscope, still you can check it with IR receiver circuit. Secondly you can

trim the 500 ohms pot depending on the distance you intend to operate the sensor. It’s

observed that, by adjusting the 500 ohms pot to 200 ohms, it is possible to detect

obstacles with in 50 cms of range from the sensor.

It is quite simple to construct a IR receiver with readily available off-the-shelf

modules. These modules are nothing but the IC packages, referred as TSOP (Thin small-

outline package). In this document, the receiver is designed for 38 kHz carrier signal;

hence the IC selected should work for the same frequency. The IC TSOP4838 will serve

as a receiver module, which is compatible with both TTL and CMOS logic. This means

that we can directly get digital signal from the receiver module and then connect it to the

microcontroller.

The Implementation of IR receiver is explained using an LED as

an indicator:

Page 31: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 23

Here in the circuit the LED blinks whenever the TSOP4838 module receives a

signal from the transmitter. The same circuit can be altered to work with microcontroller;

the circuit below has both IR transmitter and IR receiver modules integrated with the

microcontroller.

2.7) The Servo motor:

Fig 11: Servo motor internal structure.

Servos are controlled by sending them a pulse of variable width. The control wire

is used to send this pulse. The parameters for this pulse are that it has a minimum pulse, a

maximum pulse, and a repetition rate. Given the rotation constraints of the servo, neutral

is defined to be the position where the servo has exactly the same amount of potential

rotation in the clockwise direction as it does in the counter clockwise direction. It is

Page 32: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 24

important to note that different servos will have different constraints on their rotation but

they all have a neutral position, and that position is always around 1.5 milliseconds (ms).

The angle is determined by the duration of a pulse that is applied to the control

wire. This is called Pulse width Modulation. The servo expects to see a pulse every 20

ms. The length of the pulse will determine how far the motor turns. For example, a 1.5 ms

pulse will make the motor turn to the 90 degree position (neutral position).

When these servos are commanded to move they will move to the position and

hold that position. If an external force pushes against the servo while the servo is holding

a position, the servo will resist from moving out of that position. The maximum amount

of force the servo can exert is the torque rating of the servo. Servos will not hold their

position forever though; the position pulse must be repeated to instruct the servo to stay in

position.

When a pulse is sent to a servo that is less than 1.5 ms the servo rotates to a

position and holds its output shaft some number of degrees counterclockwise from the

neutral point. When the pulse is wider than 1.5 ms the opposite occurs. The minimal

width and the maximum width of pulse that will command the servo to turn to a valid

position are functions of each servo. Different brands, and even different servos of the

same brand, will have different maximum and minimums. Generally the minimum pulse

will be about 1 ms wide and the maximum pulse will be 2 ms wide.

Page 33: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 25

Another parameter that varies from servo to servo is the turn rate. This is the time it

takes from the servo to change from one position to another. The worst case turning time

is when the servo is holding at the minimum rotation and it is commanded to go to

maximum rotation. This can take several seconds on very high torque servos.

The servo used in our project is 9 gram servo. Figure below shows the 9 gram

servo used in our project.

Fig 12: Servo motor.

Page 34: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 26

The servo motor is used in the coin dispensing mechanism. The servo motor gives

precision control to the coin dispensing systems.

2.8) The DC geared motor:

Fig 13: DC geared motor.

The DC geared motor is used for opening and closing the gates of the bottle

accepting mechanism. For this purpose a 10 RPM DC geared motor is used in this

project.

The specifications of the motor are:

10RPM 12V DC motors with Gearbox

6mm shaft diameter with internal hole

125gm weight

Same size motor available in various rpm

5kgcm torque

No-load current = 60 mA 0(Max), Load current = 300 mA (Max).

Page 35: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 27

2.9) USB barcode sensor:

Barcode scanners begin by illuminating the code with red light. The sensor of the

barcode scanner detects the reflected light from the illumination system and generates an

analog signal with varying voltage that represent the intensity (or lack of intensity) of the

reflection. The converter changes the analog signal to a digital signal which is fed to the

decoder. The decoder interprets the digital signal, does that math required to confirm and

validate that the barcode is decipherable, converts it into ASCII text, formats the text and

sends it to the computer the scanner is attached to.

Sensor and Converter - A photo detector senses the reflected light and generates an

analog signal with varying voltage. The voltage fluctuates based on whether the sensor

sees the reflected light from the white spaces because the black bars absorb the red light.

The technology used in the sensor can vary depending on the illumination method.

The output is always the same - a voltage wave form with peaks for the white spaces, and

troughs for the black spaces in the barcode.

In an imaging barcode scanner, the sensor covers the entire scan target and

generates a 2-dimensional wave form. In both cases, this analog signal is sent to the

converter. The converter changes the analog signal to a digital signal. This signal is the

digital representation of what the sensor detected from the reflected light. Now that the

barcode scanner has a digital signal, the signal is transferred to the barcode scanner

decoder. .

Page 36: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 28

CHAPTER 3

SOFTWARE

The project uses Arduino IDE as software to program microcontroller. The program is

written in Arduino IDE and compiled and fed into the microcontroller. The following

steps are involved into programming a microcontroller using Arduino IDE.

Before you can start doing anything with the Arduino, you need to download and

install the Arduino IDE (integrated development environment). From this point on we

will be referring to the Arduino IDE as the Arduino Programmer.

Page 37: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 29

The Arduino Programmer is based on the Processing IDE and uses a variation of the C

and C++ programming languagesPlug your Arduino to your computer using the

programmer as shown before.

Select the board:

Before compiling the programmer and feeding it onto the arduino board you need

to select the appropriate board into which you are feeding the program.

To set the board, go to the following:

Tools --> Boards

Select the version of board that you are using. Since I have an Arduino Mega

plugged in, I obviously selected "Arduino Mega."

To set the serial port, go to the following:

Tools --> Serial Port

Page 38: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 30

3.1) Compile and upload the sketch to arduino board:

Page 39: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 31

3.2) Program

#include <Servo.h>

#include <hid.h>

#include <hiduniversal.h>

#include <usbhub.h>

#include <LiquidCrystal.h>

#include <avr/pgmspace.h>

#include <Usb.h>

#include <usbhub.h>

#include <avr/pgmspace.h>

#include <hidboot.h>

//initialize the LCD library with the numbers of the interface pins//

LiquidCrystal lcd(22,24,26,28,30,32);

String inputString = "";

//boolean stringComplete = false;

int valuelength=14;

USB Usb;

USBHub Hub(&Usb);

Page 40: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 32

HIDBoot<HID_PROTOCOL_KEYBOARD>

Keyboard(&Usb);

int bottlesensor=14;

int buzzer=15;

int motoroneA=16;

int motoroneB=17;

int motortwoA=18;

int motortwoB=19;

Servo myServo;

int doorpin=45;

boolean doorstate=true;

class KbdRptParser : public KeyboardReportParser

{

void PrintKey(uint8_t mod, uint8_t key);

protected:

virtual void OnKeyDown (uint8_t mod, uint8_t key);

virtual void OnKeyPressed(uint8_t key);

};

Page 41: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 33

void KbdRptParser::OnKeyDown(uint8_t mod, uint8_t key)

{

uint8_t c = OemToAscii(mod, key);

if (c)

OnKeyPressed(c);

}

/* what to do when symbol arrives */

void KbdRptParser::OnKeyPressed(uint8_t key)

{

static uint32_t next_time = 0;

static uint8_t current_cursor = 0;

if(inputString.length()<=13)

{

inputString+=(char)key ;

}

//Add char to print correct number in ASCII

// lcd.print( (char)key );

//Add char to print correct number in ASCII

Page 42: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 34

};

KbdRptParser Prs;

void setup()

{

Serial.begin( 115200 );

Serial.println("Start");

pinMode(bottlesensor,INPUT);

pinMode(buzzer,OUTPUT);

pinMode(motoroneA,OUTPUT);

pinMode(motoroneB,OUTPUT);

pinMode(motortwoA,OUTPUT);

pinMode(motortwoB,OUTPUT);

pinMode(doorpin,INPUT);

myServo.attach(49);

if (Usb.Init() == -1) {

Serial.println("OSC did not start.");

Page 43: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 35

}

delay( 200 );

// Hid.SetReportParser(0, (HIDReportParser*)&Prs);

myServo.write(0);

delay(500);

doorstate=false;

// set up the LCD's number of columns and rows:

lcd.begin(16,2);

lcd.clear();

lcd.print("Start");

delay( 2000 );

inputString.reserve(200);

lcd.setCursor(0,0);

lcd.print("Insert Bottle");

lcd.setCursor(0,1);

lcd.print("Press Button");

lcd.clear();

delay(50);

Page 44: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 36

}

void loop()

{

lcd.setCursor(0,0);

lcd.print("Insert Bottle");

lcd.setCursor(0,1);

lcd.print("Press Buttons");

delay(50);

lcd.clear();

if(digitalRead(doorpin)==HIGH)

{

if(doorstate==false)

{

myServo.write(90);

delay(1000);

doorstate=true;

}

else

{

Page 45: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 37

myServo.write(0);

delay(1000);

doorstate=false;

}

}

if(inputString.length()==14 && doorstate==true)

{

// if()

Serial.println(inputString);

lcd.clear();

delay(30);

lcd.print("Processing");

delay(2000);

if(inputString.substring(3,6)=="795")

{

if(digitalRead(bottlesensor)==LOW)

{

lcd.clear();

delay(30);

lcd.print("Accepted");

Page 46: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 38

delay(2000);

buzzerbeep();

buzzerbeep();

buzzerbeep();

buzzerbeep();

buzzerbeep();

opengate();

servoactivate();

openthedoor();

lcd.clear();

}

else

{

lcd.clear();

delay(30);

lcd.print("Error");

delay(2000);

openthedoor();

}

}

else

Page 47: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 39

{

lcd.clear();

delay(30);

lcd.print("Rejected");

delay(2000);

buzzerbeep();

buzzerbeep();

buzzerbeep();

buzzerbeep();

buzzerbeep();

buzzerbeep();

openthedoor();

}

inputString="";

}

else

{

Serial.println("Insert bottle");

}

}

Page 48: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 40

/*Usb.Task();

inputString.trim();

//Serial.println(inputString);

//Serial.println(inputString.charAt(3));

Serial.println(inputString);

if(inputString.substring(3,6)=="192")

{

Serial.println("Accepted");

}*/

void opengate()

{

digitalWrite(motoroneA,HIGH);

digitalWrite(motoroneB,LOW);

delay(500);

digitalWrite(motoroneA,LOW);

digitalWrite(motoroneB,HIGH);

delay(500);

digitalWrite(motoroneA,LOW);

digitalWrite(motoroneB,LOW);

Page 49: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 41

}

void servoactivate()

{

digitalWrite(motortwoA,HIGH);

digitalWrite(motortwoB,LOW);

delay(5380);

digitalWrite(motortwoA,LOW);

digitalWrite(motortwoB,HIGH);

delay(5380);

digitalWrite(motortwoA,LOW);

digitalWrite(motortwoB,LOW);

}

void buzzerbeep()

{

digitalWrite(buzzer,HIGH);

delay(300);

digitalWrite(buzzer,LOW);

delay(300);

}

Page 50: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 42

void openthedoor()

{

if(doorstate==true)

{

myServo.write(0);

delay(1000);

doorstate=false;

}

}

Page 51: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 43

CHAPTER 4

THE FLOW CHART

Fig 14: Flow chart of the project

Page 52: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 44

CHAPTER 5

ADVANTAGES AND DISADVANTAGES

5.1) Advantages:

The Machine is useful for waste management

The plastic bottles collected are sent for recycling which is environment friendly

The individual recycling the waste is rewarded in the desired means.

This system can be installed at various places just like ATMs.

Also can be installed at places where high amount of plastic is disposed in

environment.

Can be installed at public transportation stations like railway stations and bus

stops to issue tickets in return of plastic bottles.

5.2) Disadvantages:

The system needs proper maintenance and care.

Need to install the equipment in every place.

Initial investment of system is high.

5.3) Applications:

Helpful for the plastic waste management.

Page 53: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 45

CHAPTER 6

FUTURE SCOPE AND CONCLUSION

6.1) Future scope:

Can dispense drinking water in return of plastic bottles.

Can implement ticket vending in return of plastic bottles

Can interlink online bank accounts for funds transfer

Can issue Cards (like debit cards)

Solar energy can be used for power supply

6.2) Conclusion:

This project aims at reducing the plastic wastes at public places by giving

currency in return of plastic bottle wastes. Today the plastic bottle waste is increasing and

is non-biodegradable. So this project aims at reducing the plastic bottle waste by installing

such vending machines at public places where people can dispose bottles into such

machines in exchange of coins.

Page 54: VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI 590010 … · VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELGAVI – 590010 ... TABLE OF FIGURES Fig 1 Block diagram of the project ... Fig

SMART MACHINE FOR PLASTIC WASTE DISPOSAL

Dept of E&CE .VSMIT NIPANI Page 46

REFERENCES

https://www.arduino.cc/en/Main/arduinoBoardMega2560

http://www.engineersgarage.com/electronic-components/16x2-lcd-module-datasheet

http://www.allaboutcircuits.com/projects/interface-an-lcd-with-an-arduino/

https://www.arduino.cc/en/Main/ArduinoUSBHostShield

www.ti.com/lit/ds/symlink/l293.pdf

forum.researchdesignlab.com/datasheet/sensors/IR%20obstacle%20sensor.pdf