You are on page 1of 35

REVERSE VENDING MACHINE

A MAJOR PROJECT PHASE-I REPORT Submitted in partial Fulfillment


of the academic Requirements for the award of the degree of

Bachelor of Technology
IN

ELECTRICAL & ELECTRONICS ENGINEERING


Submitted By

1. G.SAI NIVAS NAIK (19H51A0274)


2. B.VIJAY KUMAR (19H51A0261)
3. G.MANEESH KUMAR (19H51A0268)
4. P.KARUNAKAR REDDY (19H51A0295)

Under the esteemed guidance of


Mrs. R Shirisha M.Tech
Associate Professor

DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

CMR COLLEGE OF ENGINEERING & TECHNOLOGY


(Autonomous)
(NAAC Accredited with ‘A+’ Grade & NBA Accredited)
(Approved by AICTE, Permanently Affiliated to JNTU Hyderabad)
KANDLAKOYA, MEDCHAL ROAD, HYDERABAD – 501401
2022-23

1
CMR COLLEGE OF ENGINEERING & TECHNOLOGY
(Autonomous)
KANDLAKOYA, MEDCHAL ROAD, HYDERABAD - 501401

DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

CERTIFICATE
This is to certify that the major project phase -I entitled “REVERSE VENDING

MACHINE ” is a bonafide work done by 1.G.sai nivas naik(19H51A0274) 2.B.vijay

kumar(19H51A0261) 3.G.Maneesh kumar(19H51A0268) 4.P.Karunakar

reddy(19H51A0297) in partial fulfillment of the academic requirements for the award of the

degree of Bachelor of Technology in Electrical & Electronics Engineering, submitted to the

Department of Electrical and Electronics Engineering, CMR College of Engineering &

Technology, Hyderabad during the period 2022-23.

Mrs. R Shirisha Prof.K.SOUJANYA

Associate Professor HOD/EEE

CMRCET CMRCET

2
DECLARATION
We, the students of IV year B.Tech, ELECTRICAL AND ELECTRONICS ENGINEERING ,
CMR COLLEGE OF ENGINEERING & TECHNOLOGY , KandlaKoya , Hyderabad, hereby
declare, that under the supervision of our course coordinators, we have independently carried out
the project titled “REVERSE VENDING MACHINE ” and submitted the report in partial
fulfillment of the requirement for the award of Bachelor of Technology in by the Jawaharlal
Nehru Technological University, Hyderabad (JNTUH) during the academic year 2022-23.

ROLL NUMBER STUDENT NAME SIGNATURE

19H51A0274 G.SAI NIVAS NAIK

19H51A0261 B.VIJAY KUMAR

19H51A0268 G.MANEESH KUMAR

19H51A0295 P. KARUNAKAR

3
ACKNOWLEDGEMENT
With great pleasure I want to take this opportunity to express my heartfelt gratitude to all
the people who helped in making this project work a grand success.

We are highly indebted and grateful to our guide MRS. R SHIRISHA


Associate Professor, Department of EEE, CMRCET for her excellent guidance and
constant encouragement throughout for the successful completion of the Project.

We are obliged and grateful to thank, Mrs .Prof . K.SOUJANYA , HOD,


Department of EEE, CMRCET, for her cooperation in all respects.

We would like to thank Major Dr.VA NARAYANA, Principal, CMRCET, for his
support in the course of this project work.

We would like to thank Sri Ch. GOPAL REDDY garu, Secretary& Correspondent of
CMRCET, for his cooperation in all respects during the course.

We would like to thank Mr. Ch. SHANKAR RAO Sir , project coordinator ,
Department of EEE CMRCET for their valuable suggestions in each and every review
during the course of my project.

Finally, we would like to thank all teaching & non- teaching staff members of the
department, for their cooperation and support throughout the duration of our course.

4
ABSTRACT
These days the increasing in amount of waste generated by human's and limited landfill
sites for dumping waste, recycling it is one of the novel approaches to manage the waste
effectively. The present recycling practice in which the people need to bring the waste in bulk to
the recycling centre might bother and become a discouraging factor for them to recycle. To
overcome such an issue, an automated recycle bin designed and installed in many countries on
subways, malls etc. with a reward featured is developed from a reverse vending machine (RVM)
concept. In present time, Reverse Vending Machine is become very popular in countries like
Greece, Japan, Europe, South Korea, America and China. Reverse Vending Machine(RVM)
reduce employee work, saves time and energy also motivate human's being, even cost effective.
In this paper we explain about the working of Reverse Vending Machine based on fraud
detection sensors which start to work after inserting the plastic material into it and that plastic is
checked by the series of sensors.All the mentioned process will be controlled by a
microcontroller. The system has been implemented in a small scale user testing and the
framework shows its effectiveness for handling the whole process. The prototype is expected to
aid in accelerating the motivation among Malaysian to recycle their waste, and can be one of the
frameworks to overcome urban poverty issue by using waste to wealth concept.

5
TABLE OF CONTENTS
CHAPTERS DESCRIPTION PAGE No.

1 Introduction 7

2 Problem Definition 8-11

3 Working Principle 12

4 Literature survey 13-16

5 Components Required 17

6 Components Description 19-20

7 Flow Chart 21

8 Advantages 22

9 Conclusion 23

10 Reference 24

6
1.INTRODUCTION
Generally, we see on roads, that plastic is thrown and due to this we face many problems like
decomposition and pollution . So main motto of our project instead of throwing plastic on roads
if they put their bottles in the reverse vending machine if will give one rupee coin in exchange
and not only reducing pollution .It also useful to industries that they can recycle plastic bottles
easily and there is no need of producing new plastic bottles they can recycle easily and
normally , outside an empty plastic bottle sold at a price of rupees 3 . In our project we use image
processing, to see the object to classify. We make environment eco green, this can be used in
public places. In landfills, floating on oceans, or rivers and on sidewalks. It was approximated
that 46, 000 pieces of plastic trash are floating on the ocean per square mile. This plastic is
killing animals, leaking chemicals and disrupting ecosystems. Each bottle can take up to one
thousand years to decompose, leaking dangerous and harmful chemicals during the process.
Some toxins leaked could cause cancer and reproductive disabilities. Burning of plastic generates
toxic emissions such as carbon monoxide, chlorine, hydrochloride acid, fur-Ans, and nitrites.
Unfortunately, the argument of recycling can only do so little for its case since only 12% out of
the thirty-five billion bottles used in one year gets recycled, indicating that only half of what you
place in a recycle bin actually gets recycled.

7
2.PROBLEM DEFINATION

 PROBLEM STATEMENT

The toxins decomposing bottles of what leach into our environment causes a variety of health
issues, including reproductive problems and cancer. 80 percentage of the plastic water bottles we
buy end up in landfills. our main objective is to help collecting the plastic bottles for recycling
and clean the plastic waste. Modern world meets a lot of challenges that includes smart waste
management system. It is becoming a matter of big concern if proper disposal system is not well
managed. Plastic is one of the materials that have the highest percentage to be recycled.
However, most of the Plastic bottle use by consumer ended up in rubbish bin. In this work, a
reverse vending machine is proposed and developed which can reward the user after the user
recycled Plastic bottle into the machine. By using the proper recycling system, the curse of waste
will turn into blessings for the civilization.

Solid waste management is one of the primary services provided by most Governments to their
citizens. Solid waste management is the most important municipal service provided to citizens.
The by-products of rapid urbanization are growing faster than the rate of urbanization. It is
estimated that an average urban person generates about 0.64kg of municipal solid waste (MSW)
per day per person. Most developed countries are efficient in their ways of solid waste
management, some countries also have mandatory recycling policies in place to ensure that
proper waste management occurs. However, waste management is a huge problem in developing
countries

 CONSEQUENCES OF PLASTIC :
1. OCEAN POLLUTION:
In many places, the ocean has become a rubbish dump. Millions of tons of litter end up in the
sea. According to the United Nations Environmental Program up to 12.7 million metric tons of
plastic made its way into the ocean in just one year. Oil spills kill indiscriminately. The 2010
Deepwater Horizon oil spill in the Gulf of Mexico impacted more than 14 species of whales and
dolphins, killing more than 5,000 of these majestic creatures. While noise from shipping, oil and
gas drilling, military sonar, and marine construction interfere with whale and dolphin
communication, their ability to find food, and increase their stress levels. Increased stress levels
impacts their immune systems and ability to reproduce.We live on a Blue Planet. A massive 70%
of the Earth’s surface is water, yet just 5% of the ocean is protected from damaging human
activities. With your help, we can protect the areas that are important to whales and dolphins, so
they can live long and healthy lives.

8
9
2. IMPACT ON HUMANS:
Society has become completely dependent on plastic, yet we rarely stop and wonder how this
material might be affecting our health. Toxic additives are often added to plastic in order to
improve its properties. Many of these additives do not bind to the chemical chain of plastic
which means they can be released in the environment when exposed to various atmospheric
conditions. These additives can be absorbed by the skin, evaporate into the air or absorbed via
the food or drinks we consume. It is important to know exactly what additives are used and take
steps to avoid them to reduce the harmful effects of plastic on human health as all of them are
highly toxic in nature.

10
3. IMPACT ON CLIMATE CHANGES:
Plastics are threatening the ability of the global community to keep global temperature rise below
1.5°C, as greenhouse gases (GHG) are emitted throughout the plastic life cycle. Indeed,
extraction, refining and manufacture of plastics are all carbon intensive activities. At the disposal
stage, incineration of plastic waste releases significant GHG into the atmosphere, alongside toxic
pollutants. Other disposal methods, including recycling, also come with their share of GHG
emissions. The rapid global growth of the plastic industry, largely fueled by natural gas,
undermines efforts to reduce carbon pollution and prevent a climate catastrophe. Estimates
indicate that GHG emissions from plastics could reach about 13% of the entire remaining carbon
budget by 2050. Plastic in the oceans may also interfere with the oceans capacity to absorb and
sequester carbon dioxide, thus creating another pathway through which plastic pollution
contributes to accelerate climate change. Various ecosystems, such as the ocean and mountain
areas, are particularly vulnerable to both climate change and plastic pollution, and the
combination of both is a significant stress factor on biodiversity.

11
3. WORKING PRINCIPLE
A Reverse Vending Machine is a device that accepts used beverage containers and returns
money to the user (the reverse of the typical vending cycle). The machines are popular in places
that have mandatory recycling laws or container deposit legislation. The basic operations involve
steps where the recycler places the empty bottle/can into the receiving aperture; the horizontal in-
feed system allows the user to insert containers one at a time. The bottle/can is then
automatically scanned with the help of capacitive and inductive proximity sensors. If the sensor
value of inductive sensor is 1 then the object is plastic and if the sensor value of inductive sensor
is 0and capacitive sensor value is 1 then the object is plastic.

The customer requirements are identified by creating a marketing survey, which serves as a
starting point and is targeted toward end users of the product and is very efficient for solving
new design problems [16]. The survey questionnaire was created in one of the commonly used
platforms, Google Forms. The link to the questionnaire was distributed among the general public
of Nur-Sultan city, the capital of Kazakhstan via e-mails and social network platforms. The
questionnaire contained 11 general questions about the demographic background information
and recycling habits of ordinary individuals, their incentive and location preferences as well as
their opinion on RVMs.

The total number of collected responses was 577. The minimum required sample size was
calculated using parameters such as population size, confidence interval, error margin and
standard deviation.

12
4.LITERATURE SURVEY
Reverse vending technology is one of the technologies being used by other countries, particularly
in the USA and Europe, that can be considered as an effective technology in the collection of
waste PET bottles. A reverse vending machine accepts empty plastic bottle or can containers and
returns incentive in the form of cash coupon or point card. The basic operations involve a step
where the consumer/waste generator places the empty bottle into the receiving aperture; the
horizontal in-feed system allows the user to insert containers one at a time

The literature review focuses on solid waste management and recommends ways of disposing
them through methods such as incineration and composting, however it ignores sustainable ways
of disposing plastics. The papers that do address plastic and disposal through recycling discuss
the parameters which may influence recycling behavior but lacks in understanding the reasons
why available and sustainable recycling methods are not used. A field study was also conducted
to see if the variables chosen for the study are valid. Field Study A field study was conducted to
reconfirm the interpretations of the literature and to verify if the variables play a role in adoption
of RVM. The field study was divided into two phases – to check the functionality and efficiency
of RVMs and to observe the citizens‟ perspective towards the RVM. The existing RVMs which
were installed in Cantonment Railway Station (Central Bangalore), Majestic Metro Station
(Central Bangalore), Yeshwanthpur Railway Station (North Bangalore) and KSR Railway
Station (East Bangalore). A sample of both citizens and retailers selling plastic bottle around the
installed RVMs were interviewed to understand their knowledge about all the aspects of RVMs.
The observations made were divided into three categories – Inefficiency, Dysfunctionality and
Partial Dysfunctionality. Inefficiency: The RVMs were initially difficult to locate, since the
citizens were unaware of their existence. Upon locating them, it was observed that there were
three screens playing videos on each side of the machine and none of them were allotted for
instructions on how to redeem the cashback. The instructions, however, on how to use the RVM
were written in English, making it difficult for the local citizens to understand its usage.
Dysfunctionality: Lack of maintenance of the machines was also observed in the Yeshwanthpur
Railway Station, since the slot for inserting the plastic bottles was filled to the brim, blocking the
entrance for more bottles. The machines were also observed to be irresponsive and showed no
acknowledgement of any transaction. Partial Dysfunctionality: In the Majestic Metro Station, a
message is generated to the mobile number entered, to which the cashback was still not received.
These problems, when combined, make the process of disposing plastic waste through the RVMs
extremely inconvenient and lead to the failure of the adoption. We note that field study also
validates the variables selected from literature influences the usage of RVMs. Hence the
following objectives were framed.

13
Existing solutions
 Manual collection:Manual collection: Manual sorting is suitable when plastic component
are present in large amount but it is a labor intensive process.

 Scavengers:
Scavengers not only reduce the waste but also supply secondary materials to recycling
industry,save the expenditures of sweeping,transportation and disposing of waste.The overall
impact of scavengers is positive economically and environmentally.

14
 A Reverse Vending Machine To Deposit A
Plastic Bottle For Recycling In Delhi

‘reverse vending machines’ being installed in different parts of the country for the purpose of
discarding plastic bottles, if they actually work and if people truly use these. For the uninitiated a
reverse vending machine is one which instead of dispensing something on inserting money, takes
in plastic bottle and doles out some sort of goodies or incentives for the user. Basically reversing
the process of a dispenser. numerous people on how to use a reverse vending machine and get a
reward for dropping a plastic bottle, but even then It was doubtful about if it really works.I went
to the machine, read the instructions which were fairly simple – touch the screen to start the
process, dump the plastic bottle, choose coupon, confirm it and get the reward. As soon as I
dumped the bottle, on the screen three blank coupons were displayed and so without knowing
what was on offer, I chose one randomly and received a reward.

15
Disadvantage of existing model
 While using the machine, the machine takes in bottle with bar code only.

 All the instructions were in English so using this kind of machine might bb difficult for non-
educated people and labours, who usually have plenty of plastic bottles. Though it is not
rocket science you just have to tap, but people who know nothing about the machine and its
functionality can do with instructions in local language.

 It is not portable

 Each machine costs around 5 lacks, which is quiet costly.

 Over loading of bottles can occur because of no proper intimating feature to the user.

16
5. COMPONENTS REQUIRED

 HARDWARE REQUIREMENTS
The Raspberry pi is a low cost, credit-card size computer. The Raspberry pi has a tool to create
or to communicate by sending and receiving the information. It is widely used in robotics and as

minicomputer .
1.Raspberry pi
2. Raspberry pi Camera
3.Servo motors
4.IR sensor
5.UV sensor
6.Load sensor
7.Fire base cloud server

17
18
6. COMPONENTS DESCRIPTION.

 RASPBERRY PI.

 The Raspberry pi is a low cost, credit card size computer.


 The Raspberry pi has a tool to create or to communicate by sending and receiving the
information.

 RASPBERY PI CAMERA

19
The Raspberry Pi Camera Board is a custom designed add-on module for Raspberry Pi
hardware. It attaches to Raspberry Pi hardware through a custom CSI interface. The sensor has

5- megapixel native resolution in still capture mode. In video mode it supports capture
resolutions up to 1080p at 30 frames p

 SERVO MOTOR:

 This is servo motor which works on PWM signal input.


 This has gears inside the motor to provide effective torque.
 This can be controlled by giving the rotation degree angle.

IR SENSOR:

20
 An infrared (IR) sensor is an electronic device that measures and detects infrared
radiation in its surroundings environment ….... IR is invisible to the human eyes, as its
wavelength is longer than that of visible light (Through it is still on the same
electromagnetic spectrum).

7.FLOW CHART:

PLASTIC BOTTLE

IR SENSOR

RASPBERRY PI CAM

RASPBERRY PI POWER SUPPLY(5V)

SERVO MOTOR OPEN SERVER UPDATE

REWARD OUT MOBILE APPLICATION

21
8.ADVANTAGES:
 This helps to clean the plastic in the city's
 It is used for collecting plastic bottles in the city, it reduces the collecting work.
 The user can earn money.
 Low Overhead Costs. Vending machines are a convenient way to feed a large staff with
minimal overhead

 Easy Maintenance & Management


 Keeps Employees Happy
 Improves Team Productivity
 Employees Stay On-Site
 Customizable Options
 Promotes Health & Wellness
 Quick & Easy Access.

22
9. CONCLUSION:
A reverse vending machine can increase recycling rates at your work place, which will lead
to sending less to landfill, having a hugely positive impact on the environment. It can make
environment eco-friendly. The study has been conducted to learn the impacts of RVM on
consumer behavior in terms of the change in quantity and quality of recycled PET bottles.
The results show that only placing separate bin for PET bottles along with other bins for
recyclable wastes does not cause positive impacts on quantity and quality of recycled PET
bottles. On the other hand, when the bins are accompanied with a RVM, approximately 26%
of PET bottles were recycled more. The RVM was also able to improve quality of recycled
PET bottles due to its weight sensor and the fact that it only receives PET bottles.
Homogeneousness of PET bottles was improved; bottles with caps, residual contents, and
alien materials were completely rejected. However, the machine was not able to separate
labels from recycled bottles. Due to its functions and capability in improving quantity and
quality of wastes, RVM should be used as part of reverse logistics process and recycle in
Thailand. The RVM used for the study, however, experienced some reliability issues. This is
likely to be the cause of lower bottle depositions recorded in the 2nd week of data collection
period in Phase III of the study. More bottles were rejected than the ones accepted by the
machine.

23
REFERENCE:
1.https://www.arduino.cc/en/Main/arduinoBoardMega2560
2.http://www.engineersgarage.com/electronic-components/16x2-lcd-
module-datasheet

3.http://www.allaboutcircuits.com/projects/interface-an-lcd-with-an-
arduino/
4.https://www.arduino.cc/en/Main/ArduinoUSBHostShield
5.www.ti.com/lit/ds/symlink/l293.pdf
6.forum.researchdesignlab.com/datasheet/sensREFERENCES
7.https://www.arduino.cc/en/Main/arduinoBoardMega2560
8.http://www.engineersgarage.com/electronic-components/16x2-lcd-
module-datasheet
9.http://www.allaboutcircuits.com/projects/interface-an-lcd-with-an-
arduino/
10.https://www.arduino.cc/en/Main/ArduinoUSBHostShield
11www.ti.com/lit/ds/symlink/l293.pdf

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

PROGRAM:
import RPi. GPIO as gpio

import time

#15 ,16, 18, 22

pin_1 = 18

pin_2 = 22

pin_3 = 16

pin_4 = 15

#t = 1

'''

Gpio. setup (18, gpio.OUT)

gpio.setup(16, gpio.OUT)

gpio.setup(15, gpio.OUT)

gpio.output(18, False)

gpio.output(22, False)

gpio.output(18, False)

'''

def slider_one_open(t):

gpio.setmode(gpio.BOARD)

gpio.setwarnings(False)

25
gpio.setup(pin_3, gpio.OUT)

gpio.output(pin_3, t)

def slider_one_close(t):

gpio.setmode(gpio.BOARD)

gpio.setwarnings(False)

gpio.setup(pin_4, gpio.OUT)

gpio.output(pin_4, t)

def slider_two_open(t):

gpio.setmode(gpio.BOARD)

gpio.setwarnings(False)

gpio.setup(pin_1, gpio.OUT)

gpio.output(pin_1, t)

def slider_two_close(t):

gpio.setmode(gpio.BOARD)

gpio.setwarnings(False)

gpio.setup(pin_2, gpio.OUT)

gpio.output(pin_2, False)

gpio.output(pin_2, t)

#Time. sleep (1)

#Time. sleep(t)

#gpio.output(pin_2, t_2)

'''

slider_two_close(1)

slider_one_open(1)

slider_one_close(1)

26
slider_two_open(0)

gpio.cleanup()

'''

'''

for i in range (0,1):

gpio.output(pin_1, True)

time.sleep(t)

gpio.output(pin_1, False)

time.sleep(t)

gpio.output(pin_2, True)

time.sleep(t)

gpio.output(pin_2, False)

time.sleep(t)

gpio.output(pin_3, True)

time.sleep(t)

gpio.output(pin_3, False)

time.sleep(t)

gpio.output(pin_4, True)

time.sleep(t)

gpio.output(pin_4, False)

time.sleep(t)

gpio.cleanup()

'''

'''

def in it ():

27
gpio.setmode(gpio.BCM)

gpio.setwarnings(False)

gpio.setup(15, gpio.OUT)

gpio.setup(16, gpio.OUT)

gpio.setup(18, gpio.OUT)

gpio.setup(22, gpio.OUT)

def slider_1(tim):

init()

#time = float(tim)

#gpio.output(15, False)

#gpio.output(16, True)

#gpio.output(18, False)

#gpio.output(22, True)

time.sleep(tim)

gpio.cleanup()

slider_1(4)

'''

import RPi.GPIO as GPIO

import time

# Servo Motor Angle is set to 0 to 180 degrees

def setAngle_servo_1(angle):

GPIO.setmode(GPIO.BOARD)

GPIO.setwarnings(False)

GPIO.setup(11, GPIO.OUT)

p_1 = GPIO.PWM (11,50)

28
p_1. start (0)

duty = angle / 18 + 2

GPIO.output(11, True)

p_1. ChangeDutyCycle(duty)

time.sleep(1)

GPIO.output(11, False)

p_1. ChangeDutyCycle(0)

p_1. stop ()

print ('rotate Motor - 1 with an angle: '+ str(angle))

GPIO.cleanup()

def setAngle_servo_2(angle):

GPIO.setmode(GPIO.BOARD)

GPIO.setwarnings(False)

GPIO.setup(13, GPIO.OUT)

p_2 = GPIO.PWM (13,50)

p_2. start (0)

duty = angle / 18 + 2

GPIO.output(13, True)

p_2. ChangeDutyCycle(duty)

time.sleep(1)

GPIO.output(13, False)

p_2. ChangeDutyCycle(0)

p_2. stop ()

print ('rotate Motor - 2 with an angle: '+ str(angle))

GPIO.cleanup()

29
def setAngle_servo_3(angle):

duty = angle / 18 + 2

GPIO.output(15, True)

GPIO.setup(15, GPIO.OUT)

p_3 = GPIO.PWM (15,50)

p_3. start (0)

p_3. ChangeDutyCycle(duty)

time.sleep(1)

GPIO.output(15, False)

p_3. ChangeDutyCycle(0)

p_3. stop ()

print ('rotate Motor - 3 with an angle: '+ str(angle))

'''

setAngle_servo_1(90)

time.sleep(1)

setAngle_servo_2(0)

time.sleep(1)

setAngle_servo_1(0)

time.sleep(1)

setAngle_servo_2(100)

time.sleep(1)

'''

# Main File:

# SIP Project.

import cv2 as c

30
from time import sleep

import capture_Fruit_Colour as capture

import motors as sm

import sliders

#Import ultrasonic Sensor as us

Name_of_Fruit_pic = 'fruits.jpg'

sm. setAngle_servo_1(90)

sleep (1)

sm. setAngle_servo_2(180)

sleep (1)

sliders.slider_two_close(True)

sleep (1)

sliders.slider_two_close(False)

while True:

sleep (3)

sliders.slider_one_open(True)

sleep (1)

sliders.slider_one_open(False)

sleep (2)

capture. Capture(Name_of_Fruit_pic)

a = Name_of_Fruit_pic

if capture. Tomato(a):

print ('tomato is found')

sliders.slider_one_close(True)

sleep (1)

31
sliders.slider_one_close(False)

sleep (1)

sliders.slider_two_open(True)

sleep (0.1)

sliders.slider_two_open(False)

sm. setAngle_servo_1(0)

sleep (1)

sm. setAngle_servo_2(0)

sleep (1)

sm. setAngle_servo_1(90)

sleep (1)

sm. setAngle_servo_2(100)

sleep (1)

sliders.slider_two_close(True)

sleep (1)

sliders.slider_two_close(False)

Elif capture.lemon_yellow(a):

print ('YELLOW lemon is found')

sliders.slider_one_close(True)

sleep (1)

sliders.slider_one_close(False)

sleep (1)

sm. setAngle_servo_2(90)

sleep (1)

sm. setAngle_servo_1(170)

32
sleep (1)

sliders.slider_two_open(True)

sleep (0.3)

sliders.slider_two_open(False)

sleep (1)

sm. setAngle_servo_1(0)

sleep (1)

sm. setAngle_servo_2(0)

sleep (1)

sm. setAngle_servo_1(90)

sleep (1)

sm. setAngle_servo_2(100)

sleep (1)

'''

sm. setAngle_servo_2(100)

sleep (1)

sm. setAngle_servo_1(90)

sleep (1)

sm. setAngle_servo_2(100)

sleep (1)

'''

sliders.slider_two_close(True)

sleep (1)

sliders.slider_two_close(False)

33
Elif capture.capsicum_green(a):

print ('GREEN capsicum is found')

sliders.slider_one_close(True)

sleep (1)

sliders.slider_one_close(False)

sleep (1)

sliders.slider_two_open(True)

sleep (0.1)

sliders.slider_two_open(False)

sm. setAngle_servo_1(90)

sleep (1)

sm. setAngle_servo_2(0)

sleep (1)

sm. setAngle_servo_1(0)

sleep (1)

sm. setAngle_servo_2(100)

sleep (1)

'''

sm. setAngle_servo_1(90)

sleep (1)

sm. setAngle_servo_2(100)

sleep (1)

'''

sliders.slider_two_close(True)

sleep (1)

34
sliders.slider_two_close(False)

else:

print ('no furit is detected')

sleep (4)

sliders.slider_one_close(True)

sleep (1)

sliders.slider_one_close(False)

#c. wait Key (0)

#c. destroyAllWindows ()

'''

Waitley (0)

c.destroyAllWindows()

''

35

You might also like