You are on page 1of 28
CHAPTER-1 INTRODUCTION 11 Introduction The launch of the “Digital India Program” of the Goverment aims at transforming India into digital empowered society and knowledge economy and towards this IOT would play a very vital role. One of the key aspects of Smart City is ‘Smart Garbage Management which involves monitoring Garbage in city towards removal appropriately and also disposing off Nowadays we are experiencing the problem of garbage which gets accumulated in cities and societies. There is no proper supervision from Corporation towards monitoring the activity of Garbage collection. Currently Intemet of Things (IoT) is expected to offer advanced connectivity of devices, systems, and services that goes beyond machine-to-machine (2M) communication and covers a variety of protocols, domains, and applications. The interconnection of these embedded devices (including smart objects), is expected to ‘usher in automation in nearly all fields, while also enable advanced applications like a smart grid, and expanding to areas such as smart cities Bad waste management can easily result in air pollution and soil contamination. ‘They have an adverse effect on human health. It is leamt from the primary survey done in Guwabati,a city in Assam that garbage accumulation causes 41% of the air pollution, They cause air pollution which generally leads to various respiratory problems like COPD, asthma etc. Breeding of mosquitoes and houseflies occur mainly in garbage which are a major cause for various diseases like malaria, dengue, chikungunya etc This also causes headache, nauseous sensation and increase in the stress level. A city ‘with poor sanitation and smelly environment can never bea healthy place to live in. There are about 235 million people currently suffering from asthma for which foul smelling of garbage is also a vital reason. Almost 90% of chronic obstructive pulmonary disease (COPD) occur in low and middle-income countries which is caused ‘by foul smelling More than 3 million people died of COPD in 2005. Improper management of garbage is identified to be one of the major causes for 22 human diseases causing premature death every year 1 CHAPTER-2 ARDUINO 2.1 What is Arduino? Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, ora Twitter message - and tum it into an output - activating a motor, tuning on anLED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing Over the years Arduino has been the brain of thousands of projects, from everyday objectsto complex scientificinstruments. A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike 2.2 Why Arduino? Thanks to its simple and accessible user experience, Arduino has been used in thousands of different projects and applications. The Arduino software is easy-to-use for beginners, yet flexible enough for advanced users. It runs on Mac, Windows, and Linux. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems: ‘© Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50 ‘© Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows. ‘© Simple, clear programming environment - The Arduino Software (IDE) is easy- to-use for beginners, yet flexible enough for advanced users to take advantage In 2003 Hemando Barragan created the development platform Wiring as a ‘Master's thesis project at IDII, under the supervision of Massimo Banzi and CaseyReas, ‘who are known for work on the Processing language. The project goal was to create simple, low-cost tools for creating digital projects ‘by non-engineers. The Wiring platform consisted of printed circuit board (PCB) with ‘an ATmegal 68 microcontroller, an IDE based on Processing and library functions to easily program the microcontroller. In 2003, Massimo Banzi, with David Mellis, another IDII student, and David Cuartielles, added support for the cheaper ATmega8 microcontroller to Wiring But instead of continuing the work on Wiring, they forked the project and renamed it Arduino. Early Arduino boards used the FTDI USB-to-serial driver chip and an ATmegal68. The Uno differed from all preceding boards by featuring the A Tmega328P microcontroller and an ATmegal 6U2 (Atmega8U? up to version R2) programmed as aUSB-to-serial converter. 2.3.2 Automatic Software Reset Rather than requiring a physical press of the reset button before an upload, the Arduino/Genuino Uno board is designed in a way that allows it to be reset by software running ona connected computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2 is connected to the reset line of the ATmega328 via a 100 nano- farad capacitor. When this line is asserted (taken low), the reset line drops long enough to reset the chip This setup has other implications. When the Uno is connected to a computer sunning Mac OS X or Linus, it resets each timea connection is made to it from software (via USB). For the following half-second or so, the bootloader is running on the Uno ‘While it is programmed to ignore malformed data (i.e. anything besides an upload of ‘new code), it will intercept the first few bytes of data sent to the board aftera connection is opened. + GND: Ground pins + IOREF. This pin on the Arduino/Genuino board provides the voltage reference with ‘which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the SV or 3.3V. + Reset: Typically used to add a reset button to shields which block the one on the board 2.4.2 Special pin functions Each of the 14 digital pins and 6 analog pins on the Uno can be used asan input or output, using pinMode 0), digitallWrite Q, and digitalRead () functions. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an intemal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller. The Uno has 6 analog inputs, labeled AO through AS, each of which provide 10 bits of resolution (i.e. 1024 different values). By default, they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference () function Inaddition, some pins have specialized functions: + Serial / UART: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data, These pins are connected to the corresponding pins of the A Tmega8U2 USB-to-TTL serial chip. + External interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt ona low value, a rising or falling edge, ora change in value + PWM @ulsewidth modulation): 3, 5, 6, 9, 10, and 11. Can provide 8-bit PWM output with the analog\Write Q function. + SPI (Serial Peripheral Interface): 10 (SS), 11 (MOSH, 12 (MISO), 13 (SCK) ‘These pins support SPI communication using the SPI library. + TWI (swo-wire interface) / FC: A4 or SDA pin and AS or SCL pin. Support TWI communication using the Wire library. + AREF (analog reference): Reference voltage for the analog inputs 2.5 Technical Specifications Table 2.1 Technical Specifications of Arduino UNO Microcontroller ATmega328P — 8-bit AVR family microcontroller Operating Voltage sv Recommended Input Tw Voltage Input Voltage Limits 6-200 Analog Input Pins 6(AD-AS) Digital /O Pins DC Current on 1/0 Pins 14 (Out of which 6 provide PWM output) 40 mA DC Current on 3.3V Pin 50mA Flash Memory 32 KB (0.5 KB is used for Bootloader) SRAM 2KB EEPROM 1KB Frequency (Clock Speed) 16 MHz, 2.6 Communication The Arduino/Genuino Uno has a number of facilities for communicating witha computer, another Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX and | (TX). An ATmegal6U?2 on the board channels this serial communication over USB and appears as a virtual com port to software on the computer. The 16U2 firmware uses the standard USB COM drivers, and no extemal driver is needed. However, on Windows, a inf file is required. The Arduino Software (IDE) includes a serial monitor which allows simple textual data to be sent to and from the board. ‘The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins O and 1). A Software Serial library allows serial communication onany of the Uno's digital pins 2.1 Applications of Arduino UNO ATmega328 The applications of Arduino Uno include the following ‘© Arduino Uno is used in Do-it-Yourself projects prototyping ‘© In developing projects based on code-based control, © Development of Automation System ‘+ Designing of basic circuit designs. © Robotics ‘© Intemet of things 28 Other Arduino Boards There are several Arduino boards. Some of them are * Arduino NANO © Arduino RS232 © Arduino Mega © Arduino Lilypad © Arduino Pro © Arduino Leonardo 10 3.2 Main Features of Ultrasonic Sensor Table 3.1 Main Features of Ultrasonic Sensor Parameter Value Main Parts Transmitter & Receiver Technology Used Non-Contact Technology Operating Voltage sv Operating Frequency 4MHz Detection Range 2am to 400em ‘Measuring Angle 30° Resolution 3mm. Operating Current <15mA Sensor Dimensions 45mm x 20mm x 15mm It gives precise measurement details and comes with accuracy (resolution) around 3mm, terming there might bea slight difference in the calculated distance from the object and the actual distance. 3.3 Ultrasonic Sensor Pinout & Description. Ultrasonic Sensor contains 4 pins in total. [have labelled these HC-SR04 Pinout in below figure for better visualization: 2 3.3.1 Crystal Oscillator Accrystal oscillator is an electronic oscillator circuit which is used for the mechanical resonance of a vibrating crystal of piezoelectric material, It will create an lectrical signal witha given frequency. This frequency is commonly used to keep track of time for example: wrist watches are used in digital integrated circuits to provide a stable clock signal and also used to stabilize frequencies for radio transmitters and receivers. Quartz crystal is mainly used in radio-frequency (RF) oscillators. Quartz crystal is the most common type of piezoelectric resonator, in oscillator circuits we are using them so it became known as crystal oscillators. Crystal oscillators must be designed to provide a load capacitance Figure 3.3 Crystal Oscillator ay oureut an ourout Oscillator with Crystal Operating Figure 3.4 Crystal Oscillator Circuit Diagram Fry Generally bipolar transistors or FETs are used in construction of Crystal oscillator circuits. This is because operational amplifiers can be used in different low frequency oscillator circuits which are below 100KHz but operational amplifiers do not have the bandwidth to operate Usually quartz crystal oscillators are highly stable, consists of good quality factor(Q), they are small in size, and are economically related Hence, quartz crystal oscillator circuits are more superior compared to other resonators like LC circuits, tuming forks. Generally, in Microprocessors and Micro controllers we are using an MHz crystal oscillator 3.3.2 Ultrasonic transmitter circuit The transmitter circuit is built around two CD4017 decade counter ICs (IC1 and IC2), D-type flip-flop IC CD4013 (IC3) and a few discrete components. The arrangement generates stable 40kHz signals, which are transmitted by transducer TX Nv ‘T= 40k ULTRASON ‘TRANSMITTER oo Figure 3.5 Ultrasonic transmitter circuit The crystal-controlled radio-frequency (RF) oscillator built around transistor T 1 (BC549) generates an 8MHz signal, which serves as input to the first decade counter ‘built around IC1. The decade counter divides the oscillator frequency to 800 kHz The 15 output of IC! is fed to the second CD4017 decade counter (IC2), which further divides the frequency to 80 kHz The flip-flop (IC3) divides 80kFiz signal by 2 to give 40ktiz signal, which is transmitted by ultrasonic transducer TX Coil L is made with 36SWG enameled copper wire that is wound 15 times around an 8mm-diameter plastic former as used for radio oscillators, which hasa ferrite ‘bead, The transmitter circuit works off 9-12V DC. 3.33 Ultrasonic receiver circuit The receiver circuit (Fig.2) is built around a single decade counter CD4017 (IC4) and a few discrete components. To check the working of the transmitter, it is necessary to down-convert the 40kHz signal into 4kFiz to bring it in the audible range RX = 40kHz ULTRASONIC >= RECEIVER Figure 3.6 Ultrasonic receiver circuit By using the receiver, the 40kHz ultrasonic trans er can be tested quickly ‘The receiver's transducer unit (RX) is kept near the ultrasonic transmitter under test. It detects the transmitted 40k#z signal, which is amplified by the amplifier built around transistor BC549 (72), The amplified signal is fed to decade counter IC4, which divides 16 ‘will be generating if the Trig pin is kept High for 10 uss. These waves will travel at the speed of sound, creating 8 cycle sonic burst that will be collected in the Echo pin The echo pin remains tumed on for the time these waves take to travel and ‘bounce back to the receiving end. This sensor is mainly incorporated with Arduino to measure the required distance Following formula is used to calculate the distance of the object Ss=(Vxt2 ‘Where Sis the required distance, Vis the speed of sound and tis the time sound waves take to come back after hitting the object. ‘Weneedto divide the value by 2 because time will be doubleas the waves travel and bounce back from the initial point Dividing it by 2 will give the actual distance of the target object. 3.5 Interfacing Ultrasonic Sensor with Arduino In order to get the precise distance measurement, HC-SRO4 is mostly used in combination with different Arduino Modhules like Arduino Uno and Arduino Mega. You can connect Arduino with this sensor in the following way. First, you need to power up the sensor using SV DC regulated input to the sensor. Connect the ground pin with the ground of the voltage source. You can also power the sensor module using the Arduino SV pinsas the current drawn by the sensor is less than 15mA, won't be affecting the current ratings of the Arduino Module. After setting up the initial arrangement, connect both Trig and Echo pins to the VO pins of the Arduino Board. As mentioned earlier, in order to initialize the ‘measurement process, the Trig pin must be kept high for 10us in the start. The sensor ‘module will start generating sound waves with the frequency around 40,000 Hz per second from the transmitter. As the waves bounce back, consequently, the Echo pin will tum on until the sound waves are received by the receiver. This time will be calculated using Arduino Module 18 3.6 Applications HC-SR04 comes with a wide range of applications mainly targeting distance and direction measurements. Following are the major applications it can be used for. ‘© Speed and direction measurement © Wireless charging © Humidifiers © Medical ultrasonography © Burglar alams + Embedded system © Depth measurement ‘© Non-destructive testing 19 CHAPTER-4 SERVO MOTOR 4.1 What is Servo motor? Servo implies an error sensing feedback control which is utilized to correct the performance of a system. It also requires a generally sophisticated controller, often a dedicated module designed particularly for use with servomotors. Servo motors are DC ‘motors that allows for precise control of angular position. They are actually DC motors whose speedis slowly lowered by the gears. The servo motors usually havea revolution cutoff from 90° to 180° A few servo motors also have revolution cutoff of 360° or ‘more, But servo motors do not rotate constantly. Their rotation is limited in between the fixed angles A servo motor is an electrical device which can push or rotate an object with great precision The servo motor is actually an assembly of four things: a normal DC ‘motor, a gear reduction unit, a position-sensing device anda control circuit. Ifyou want to rotate and object at some specific angles or distance, then you use servo motor. Itis just made up of simple motor which run through servo mechanism. If motor is used is DC powered then it is called DC servo motor, and ifit is AC powered motor then it is called AC servo motor. We can get a very high torque servo motor in a small and light ‘weight packages. Due to these features they are being used in many applications like toy car, RC helicopters and planes, Robotics, Machine etc. The function of the servo motor is to receive a control signal that represents a desired output position of the servo shaft and apply power to its DC motor until its shaft tums to that position. It uses the position sensing device to figure out the rotational position of the shaft, so it knows which way the motor must tum to move the shaft to the instructed position. The shaft commonly does not rotate freely around similar to a DC motor, however rather can just tum 200 degrees From the position of the rotor, a rotating magnetic field is created to efficiently generate toque. Current flows in the winding to create a rotating magnetic field. The shaft transmits the motor output power. The load is driven through the transfer mechanism A high-function rare earth or other permanent magnet is positioned 20 difference between reference input signal and reference output signal. So, the main tasie of servomechanism is to maintain output of a system at desired value at presence of noises 43 Wire configuration Table 4.1 Wire configuration of Servo Motor Wire Wire Color —_| Description ‘Number 1 Brown Ground wire connected to the ground of system 2 Red Powers the motor typically +5V is used 3 Orange WWM signal is given in through this wire to drive the motor 44 Tower Pro SG-90 Features © Operating Voltage is +5V typically © Torque: 2.Skg/em © Operating speed is 0.15/60" © Gear Type Plastic © Rotation: 0°-180° © Weight of motor: 9gm ‘+ Package includes gear homs and screws 45 Working principle of Servo Motors A servo consists ofa Motor (DC or AC), a potentiometer, gear assembly anda controlling circuit, First of all, we use gear assembly to reduce RPM and to increase torque of motor. Say at initial position of servo motor shaft, the position of the potentiometer knob is such that there is no electrical signal generated at the output port of the potentiometer. Now an electrical signal is given to another input terminal of the 2 error detector amplifier. Now difference between these two signals, one comes from potentiometer and another comes from other source, will be processed in feedback ‘mechanism and output will be provided in term of error signal. This error signal acts as the input for motor and motor starts rotating Now motor shaft is connected with potentiometer and as motor rotates so the potentiometer and it will generate a signal So, as the potentiometer’s angular position changes, its output feedback signal changes. After sometime the position of potentiometer reaches at a position that the output of potentiometer is same as external signal provided. At this condition, there will ‘be no output signal from the amplifier to the motor input as there is no difference ‘between extemal applied signal and the signal generated at potentiometer, and in this situation motor stops rotating * anguiar Rotation Figure 4.2 Angular Rotation of Servo Motor Servo motor is controlled by PWM (Pulse with Modulation) which is provided by the control wires. Thereisa minimum pulse, a maximum pulse and a repetition rate Servo motor can tum 90 degree from either direction form its neutral position. The servo motor expects to see a pulse every 20 milliseconds (ms) and the length of the pulse will determine how far the motor tums. For example, a 1. Sms pulse will make the ‘motor tum to the 90° position, such as if pulse is shorter than 1.5ms shaft moves to 0° and ifit is longer than 1 Sms than it will tum the servo to 180° 23 Servo motor works on PWM (Pulse width modulation) principle, means its angle of rotation is controlled by the duration of applied pulse to its Control PIN, Basically, servo motoris made up of DC motor whichis controlled by a variable resistor (potentiometer) and some gears. High speed force of DC motoris converted into torque by Gears. We lnow that WORK= FORCE X DISTANCE, in DC motor Force is less and distance (speed) is high and in Servo, force is High and distance is less Potentiometer is connected to the output shaft of the Servo, to calculate the angle and stop the DC motion on required angle 46 Advantages ‘© Ifa heavy load is placed on the motor, the driver will increase the current to the motor coil asit attempts to rotate the motor. Basically, there is no out-of-step condition. ‘© High-speed operation is possible 4.7 Applications of Servo Motors Servomotors are used in applications requiring rapid variations in speed without the motor getting overheated. ‘© In Industries they are used in machine tools, packaging, factory automation, material handling, printing converting, assembly lines, and many other demanding applications robotics, CNC machinery or automated manufacturing ‘© They are also used in radio-controlled airplanes to control the positioning and movement of elevators. ‘© They are used in robots because of their smooth switching on and off and accurate positioning. ‘© They are also used by aerospace industry to maintain hydraulic fluid in their hydraulic systems, ‘© They are used in many radio-controlled toys. ‘© They are used in electronic devices such as DVDs or Blue ray Disc players to extend or replay the disc trays. ‘© They are also being used in automobiles to maintain the speed of vehicles 24 48 Application Circuit of Servo Motor From below application circuit: Each motor has three inputs: VCC, ground and. aperiodic square wave signal. The pulse width of the square wave determines the speed ‘and direction of the servo motors. Vee Servo Motor ccnp Figure 4.3 Application Circuit of Serve Motor In our case, we just need to change the direction to allow the device to move forward, backward and tum left and right. If the pulse width is under a certain time frame, the motor will drive ina clockwise direction. Ifthe pulse width exceeds that time frame, the motor will drive in a countercloclowise direction The middle time frame can be adjusted through a built-in potentiometer inside the motor. 25 CHAPTER-5 ARDUINO IDE SOFTWARE 5.1 Arduino IDE Software The Arduino integrated development environment (IDE) is a cross-platform application (for Windows, macOS, Linux) that is written in the programming language Java, It is used to write and upload programs to Arduino compatible boards, but also, ‘with the help of 3rd party cores, other vendor development boards. The source code for the IDE is released under the GNU General Public License, version 2. The Arduino IDE supports the languages C and C++ using special rules of code structuring. The Arduino IDE supplies software library from the Wiring project, which provides many common input and output procedures. It is designed to introduce programming to artists and other newcomers ‘unfamiliar with software development. It includes a code editor with features such as syntax highlighting, brace matching, and automatic indentation, and provides simple one-click mechanism to compile and load programs to an Arduino board. A program ‘written with the IDE for Arduino is called a "sketch" User-vritten code only requires two basic functions, for starting the sketch and the main program loop, that are compiled and linked with a program stub main() into an executable cyclic executive program with the GNU toolchain, also included with the IDE distribution. The Arduino IDE employs the program to convert the executable code into text file in hexadecimal encoding that is loaded into the Arduino board bya loader program in the board's firmware 5.2 Arduino IDE Software Installation To set up the Arduino IDE on our computer and prepare the board to receive the program via USB cable 5.2.1 Arduino Connection First you must have your Arduino board (you can choose your favorite board) anda USB cable In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino ‘Mega 2560, or Diecimila, you will need a standard USB cable (A plug to B plug), the and you would connect to a USB printeras shown in the following image 26 5.2.3 Power up your board The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from either, the USB connection to the computer or an extemal power supply. If you are using an Arduino Diecimila, you have to make sure that the board is configured to draw power from the USB connection. The power source is selected with a jumper, a small piece of plastic that fits onto two of the three pins between the USB and power jacks. Check that it is on the two pins closest to the USB port Connect the Arduino board to your computer using the USB cable. The green power LED (labeled PWR) should glow. 5.24 Launch Arduino IDE After your Arduino IDE software is downloaded, you need to unzip the folder Inside the folder, you can find the application icon with an infinity label (application exe). Double-click the icon to start the IDE. 1 rot ™ ie 1 beieep Dove Oa tmetes 5) Gores ae ie Braet Einewe bcos vee oune coer agen wre Boao Sopa iam Sees Benin eakaer wee Figure 5.3 Launch Antuino IDE 5.25 Open your first project Once the software starts, you have two options ~ + Createa new project. 28 + Openan existing project example. To create a new project, select File —» New Shece me rere Figure 5.4 New project To open an existing project example, select File — Example —» Basics —» Blink. Figure 5.5 Existing project 29 Here, we are selecting just one of the examples with the name Blink It tums the LED on and off with some time delay. You can select any other example from the list. 5.2.6 Select your Arduino board To avoid any error while uploading your program to the board, you must select the correct Arduino board name, which matches with the board connected to your computer. Go to Tools + Board and select your board. coer Feeney 20 File st Seetch Tai) Help Toersy-+ 20 AutoFormet ‘ier Shi rckine Ouemianovew/ ATIegR28 Archive kath tink trea eset ‘Axcino Oicimils r Dueanove w/ ATmegat6E eae ceiosnitens, dno Nano wi ATmegs326 ‘Arcino Nono wi ATmeas66 ee oe Sein Port * —Arcine Mess (ATnese129) PU speed eee ae brain Ninf Tine 323 ore Aicino Min w/ATrneget Aecino Ethernet sraino Fe Aedine Tw) ATeg2t ‘reno ST w/ATmegal6t Lia Aine USB liye ino Tmegss28 c tia Arne w/ ATmess68 ‘Arcino Pro or Pr Mini 16 MHS) w/ AT megan26 Figure 5.6 Selecting Arduino Board Here, we have selected Arduino Uno board according to our tutorial, but you must select the name matching the board that you are using 5.2.7 Select your serial port Select the serial device of the Arduino board, Go to Tools — Serial Port menu. This is likely to be COMG or higher (COMI and COM? are usually reserved for hardware serial ports). To find out, you can disconnect your Arduino board and re- 30 open the menu, the entry that disappears should be of the Arduino board, Reconnect the board and select that serial port S blink| Arduino 106 os) File Fait Sketch Hep ‘Ato Format Archive Sketch Fix Encoding &Reload Serial Monitor Cire shittota inks CPU Speed cons Burn Bootloader Figure 5.7 Selecting Serial Port 5.28 Upload the program to your board Before explaining how we can upload our program to the board, we must demonstrate the function of each symbol appearing in the Arduino IDE toolbar a Figure 5.8 Uploading the program to Arduino A- Used to check if there is any compilation error. B - Used to upload.a program to the Arduino board. C Shortcut used to create a new sketch D - Used to directly open one of the example sketch E - Used to save your sketch, F - Serial monitor used to receive serial data from the board and send the serial data to the board. ‘Now, simply click the "Upload" button in the environment. Waita few seconds, you will see the RX and TX LEDs on the board, flashing Ifthe upload is successful, the message "Done uploading" will appear in the status bar 5.2.9 Arduino IDE default window This is the Arduino IDE once it's been opened. It opens into a blank sketch where you can start programming immediately. First, we should configure the board and port settings to allow us to upload code. Connect your Arduino board to the PC via the USB cable Figure 59 Arduino IDE default window 32 CHAPTER-6 IMPLEMENTATION 6.1 Concept behind Smart Dustbin using Arduino The main concept behind the Smart Dustbin using Arduino project is Object Detection. We have already used Ultrasonic Sensor in Object Avoiding Robot, where upon detecting an object, the Robot will change its course of direction. A similar methodology is implemented here, where the Ultrasonic Sensor is, placed on top of the dustbin’s lid and when the sensor detects any object like a human hand, it will trigger Arduino to open the lid. 6.2 Hardware Components Required © Arduino UNO + HC-SR04 Ultrasonic Sensor Module ‘© Tower Pro SG90 Servo Motor © Jump Wires + 5V Power Supply © A small dustbin with hinged lid ‘+ Miscellaneous (glue, plastic tube, etc.) 6.3 Software Required © Arduino IDE 6.4 Jump Wires Jump wires (also called jumper wires) for solderless breadboarding can be obtained in ready-to-use jump wire sets or can be manually manufactured. The latter can become tedious work for larger circuits. Ready to-use jump wires come in different qualities, some even with tiny plugs attached to the wire ends. Jump wire material for ready-made or homemade wires should usually be 22 AWG (0.33 mm2) solid copper, tin-plated wire - assuming no tiny plugs are to be attached to the wire ends. The wire ends should be stripped 3/16 to 5/16 in (4.8 to 7.9 mm), Shorter stripped wires might result in bad contact with the board's spring clips (insulation being caught in the 33 68 Arduino Code The code for the project How to Smart Dustbin using Arduino is given below. #nclude Servo myservo, int pos = 20; const int tigPin = 5; const int echoPin = 6, const int led = 13; ong duration; float distance, ‘void setup() ce myservo.attach(11), pinMode(tngPin, OUTPUT), pinMode(echoPin, INPUT), pinMode(led, OUTPUT), smyservo.wmite(pos), ) void loop Serial. begin(9600), digital\Wnite(trigPin, LOW), delayMicroseconds(2), 36 digitalWnite(trigPin, HIGH), delayMicroseconds(10), digital\Wnite(trigPin, LOW), duration = pulseln(echoPin, HIGH); distance = 0.034*(duration/2); Serial printin( distance), if (distance < 27) € digitalWnite(led HIGH), myservo write(post 160), delay(1000), d ase € digitalWnite(led LOW); myservo write(pos), d delay(300), d 6.9 Working After setting up the Smart Dustbin and making all the necessary connections, upload the code to Arduino and provide SV power supply to the circuit. Once the system is powered ON, Arduino keeps monitoring for any object near the Ultrasonic Sensor. a7 CHAPTER-7 CONCLUSION A simple but useful project called Smart Dustbin using Arduino is designed and developed here. Using this project, the lid of the dustbin stays closed, so that waste is not exposed (to avoid flies and mosquitos) and when you want dispose any waste, it ‘will automatically open the lid Dustbins (or Garbage bins, Trash Cans, whatever you call them) are small plastic (or metal) containers that are used to store trash (or waste) ona temporary basis, They are often used in homes, offices, streets, parks etc. to collect the waste. In some places, littering is a serious offence and hence Public Waste Containers are the only way to dispose collecting wet or dry, recyclable or non-recyclable waste all waste. Usually, it is a common practice to use separate bins for eee e 10. REFERENCES https //www electronicshub org/electronics-mini-project-circuits/ref-menu. http://unnatbharatabhiyan gov in/files/seg/proposals_ppt https:/nevonprojects.cony/smart-dustbin-with-iot-notifications/ https //www oreilly. comibrary/viewlarduino-a-technical/9781491934319/ Exploring Arduino: Tools and Techniques for Engineering Wizardry. https //www theengineeringprojects.com/2018/1 O/introduction-to-he-sr04- ultrasonic-sensor html https /wwwarduino co/en/reference/servo. https //circuitdi gest. com/article/servo-motor-basics https //www sciencedirect com/topics/engineering/servo-motor http://www electronicsforu. comy electronicsforw/circuitarchives/view_article asp? sno=235 article type-I &id=3528tt—unhot&b_type-newst VFOVwCV3QYw. 40

You might also like