top of page
Writer's pictureRamesh G

Garbage Monitoring System with Bluetooth Interface

Updated: Oct 15, 2022


This project Arduino based Garbage Monitoring system is a very innovative system which will help to keep the home, restaurant, hospitals, Office clean. This system monitors the garbage bins about the level of garbage collected in the garbage bins via mobile. For this the system uses ultrasonic sensors placed over the bins to detect the garbage level and compare it with the garbage bins depth. The system makes use of Arduino family microcontroller, Bluetooth HC-05 for sending data to android application. The Mobile screen is used to display the status of the level of garbage collected in the bins, remaining of free space and Bin height. The android application can set the Garbage bin height when empty bin for level calculations. The Garbage bin depth is 0 % to 100%, if the value less than 33% the bin color should be Green, if the value less than 66% and grater than 34% the bin color should be light rose, if the value less than 100% and grater than 67%the bin color should be Red is assigned in this project using android application.



Circuit diagram



Components required

Arduino Nano - 1 no

Bluetooth module HC-05 - 1no

HC-SR04 ultrasonic sensor-1no


HC-SR04

This is the HC-SR04 ultrasonic distance sensor. This economical sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit.

There are only four pins that you need to worry about on the HC-SR04:

VCC (Power) to Arduino Nano Vin Pin

Trig (Trigger) to Arduino Nano D2 Pin

Echo (Receive) to Arduino Nano D3 Pin

GND (Ground) to Arduino Nano GND Pin.

Bluetooth HC-05 Module

HC-05 is a Bluetooth module which is designed for wireless communication. This module can be used in a master or slave configuration. Bluetooth serial modules allow all serial enabled devices to communicate with each other using Bluetooth.

It has 6 pins,

1.Key/EN: It is used to bring Bluetooth module in AT commands mode. If Key/EN pin is set to high, then this module will work in command mode. Otherwise by default it is in data mode. The default baud rate of HC-05 in command mode is 38400bps and 9600 in data mode.

HC-05 module has two modes,

Data mode: Exchange of data between devices.

Command mode: It uses AT commands which are used to change setting of HC-05. To send these commands to module serial (USART) port is used.


2. VCC: Connect 5 V or 3.3 V to this Pin.

3. GND: Ground Pin of module.

4. TXD: Transmit Serial data (wirelessly received data by Bluetooth module transmitted out serially on TXD pin)

5. RXD: Receive data serially (received data will be transmitted wirelessly by Bluetooth module).

6. State: It tells whether module is connected or not.


HC-05 module Information

HC-05 has red LED which indicates connection status, whether the Bluetooth is connected or not. Before connecting to HC-05 module this red LED blinks continuously in a periodic manner. When it gets connected to any other Bluetooth device, its blinking slows down to two seconds.


This module works on 3.3 V. We can connect 5V supply voltage as well since the module has on board 5 to 3.3 V regulator.


As HC-05 Bluetooth module has 3.3 V level for RX/TX and microcontroller can detect 3.3 V level, so, no need to shift transmit level of HC-05 module. But we need to shift the transmit voltage level from microcontroller to RX of HC-05 module.


HC-05 Default Settings


  • Default Bluetooth Name: “HC-05”

  • Default Password: 1234 or 0000

  • Default Communication: Slave

  • Default Mode: Data Mode

  • Data Mode Baud Rate: 9600, 8, N, 1

  • Command Mode Baud Rate: 38400, 8, N, 1

  • Default firmware: LINVOR


Installing the Arduino Library

Download Ultrasonic library , we need to use this library.


Follow the next steps to install those libraries.


In your Arduino IDE, to install the libraries go to Sketch > Include Library > Add .ZIP library… and select the library you’ve just downloaded.


After installing the required libraries, copy the following code to your Arduino IDE.


Subscribe and Download code.

Download Android application.




Mobile Output

The Arduino will send this data via Bluetooth then the mobile application will receive this data and will proceed to show the status of the garbage bin level , free space to the user and giving a additional Gauge view with color changes in depends on percentage of waste filled in the garbage bin.


First open Mobile application Garbage BT and select Bluetooth connect button, after that select Bluetooth HC-05 device to connect and enter Password as mentioned above (0000 or 1234).


Arduino Code

#include <Ultrasonic.h>

Ultrasonic ultrasonic(2, 3);


#include <EEPROM.h>

int addr = 0;

int height = 0;

int heightset;

int BinHeight;


long distance;

float percentage,math;


String waste;

// remove wiring from Bluetooth when program upload

void setup () {

Serial.begin(9600); // We initialize serial connection so that we could print values from sensor.


}


void loop () {

// Every 500 miliseconds, do a measurement using the sensor and print the distance in centimeters.

distance = ultrasonic.read();

if(Serial.available()> 0) {

height = Serial.read();

if(height == 'h')

{ BinHeight =distance;

EEPROM.write(addr,BinHeight); }

{BinHeight= EEPROM.read(addr); }

}


delay(500);

heightset= EEPROM.read(addr);

math = heightset-distance;

percentage = (math/heightset)*100;

waste = (String)distance + "," + (String)percentage + "," + (String)heightset;

Serial.println(waste);

}

After a successful upload, open the Serial Monitor at a baud rate of 9600. Press the “EN/RST” button on the Arduino Uno board and see the result in monitor.


Download .aia file


Recent Posts

See All

1 Comment


knowlezsvidctorse
Mar 06, 2023

I want to use that system in my car junk removal company also, any recommendations for the best company which provides such services?

Like
bottom of page