Arduino Based Smart Bin



This Project aims to build an Arduino based dust bin with IR sensor controlled lid and weight measurement unit which measures the bin weight.

When the IR sensor detect an object near it, the lid will open automatically by a servo motor.

When the bin has reached it's maximum weight limit , a SMS is sent to a predefined number using the inbuilt GSM module.

When the bin is at full state, an indicator LED is used to inform to the public.While the bin is full, the lid will not open.

The system is powered by a 5V rechargeable battery pack.

Tools & Components 

1 X Arduino Nano

1 X SIM900A GSM Module

1 X Load Cell with HX711 ADC

1 X IR Sensor

1 X Metal Gear Servo Motor

1 X 5V Battery Pack

1 X LED (Red)

Suitable Bin

Connecting Components




IR Sensor signal in         - Arduino Pin D12

Servo Motor signal in     - Arduino Pin D06

GSM Module 5VT Pin   - Arduino Pin D07

GSM Module 5VR Pin   - Arduino Pin D08

LED Pin                          - Arduino Pin D11

Load Cell White wire     - HX711 Pin A-

Load Cell Green wire     - HX711 Pin A+

HX711 DT Pin               - Arduino Pin D02

HX711 SCK Pin            - Arduino Pin D03


Note :

Choose a suitable Load Cell according to requirement.For this project, 1Kg Load cell is used and maximum weight level is programmed to 500g.

Do not load excessive weight other than the rated weight on to the load cell or it will get damaged.

Servo motor torque must be enough to lift the lid.Consider the lid weight and size when choosing a suitable servo motor.

When transmitting, GSM module draws higher current,Otherwise it will not work properly.Hence battery pack must be able to supply 2.5A - 3A for proper functionality of the system.

IR sensor must be placed in a suitable position(Not hidden and easy to reach)

Connect the Load cell correctly.(Refer the below figure.)


Arduino Code

//CraftyBin.Blogspot.com
//Author : Chathura H.

#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8);
#include <Servo.h>
Servo myservo;

#include "HX711.h"
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;

void setup()
{
  myservo.attach(6);
  pinMode(11,OUTPUT);
  Serial.begin(9600);
  mySerial.begin(9600);
  delay(100);
  Serial.println("Smart Bin");
  Serial.println("Initializing System");
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  scale.set_scale(2280.f);
  scale.tare();
}

void loop(){
 
  int inputvalue = digitalRead(12);
  digitalWrite(11, 0);
  Serial.print("one reading:\t");
  Serial.print(scale.get_units(), 1);
  Serial.print("\t| average:\t");
  Serial.println(scale.get_units(10), 1);

  scale.power_down();      
  delay(100);
  scale.power_up();

  if (scale.get_units()>500 && inputvalue == LOW)
  {
  digitalWrite(11, 1);
  myservo.write(0);
  delay(100);
  mySerial.println("AT");
  updateSerial();
  mySerial.println("AT+CMGF=1");
  updateSerial();
  mySerial.println("AT+CMGS=\"+YYxxxxxxxxx\"");//change YY with country code and xxxxxxxxxxx with phone number to sms
  updateSerial();
  mySerial.print("Bin is full | Maximum Limit Reached");
  updateSerial();
  mySerial.write(26);
}

 else if(scale.get_units()>500 && inputvalue == HIGH){
  digitalWrite(11, 1);
  myservo.write(0);
  delay(100);
  mySerial.println("AT");
  updateSerial();
  mySerial.println("AT+CMGF=1");
  updateSerial();
  mySerial.println("AT+CMGS=\"+YYxxxxxxxxx\"");//change YY with country code and xxxxxxxxxxx with phone number to sms
  updateSerial();
  mySerial.print("Bin is full | Maximum Limit Reached");
  updateSerial();
  mySerial.write(26);
 }

 else if(scale.get_units()<500 && inputvalue == HIGH){
 myservo.write(120);
 digitalWrite(11, 0);
 delay(100);
 }

 else if(scale.get_units()<500 && inputvalue == LOW){
 myservo.write(0);
 digitalWrite(11, 0);
 delay(100);
 }
 }

void updateSerial(){
  delay(500);
  while (Serial.available())
  {
    mySerial.write(Serial.read());
  }
  while(mySerial.available())
  {
    Serial.write(mySerial.read());
  }
  }

Note : Change YY with country code and xxxxxxxxx with phone number to SMS.


Safety First !
Always Connect the power supply if you are absolutely sure that the components are connected correctly without changing polarity and short circuited the wiring.
Even if it seems nothing is wrong : DOUBLE CHECK EVERYTHING !!
Your Feedback is very important to us. 
Please Leave a comment about how you feel about this project.







2 Comments

  1. This smart bin is really cool, I loved your project. Sensor bins are popular nowadays and they come with some really cool features. Keep sharing your knowledge through such amazing articles. Thank you for sharing this. Great blog.

    ReplyDelete
  2. You have a genuine capacity to compose a substance that is useful for us. You have shared an amazing post about Skip bins near me Much obliged to you for your endeavors in sharing such information with us.

    ReplyDelete

Post a Comment

Previous Post Next Post