Trash Level Indicator

Introduction: Trash Level Indicator

The Trash Level Indicator uses an ultrasonic sensor with an Arduino to build a simple device that janitors can use to know which trash bin needs to be emptied. The ultrasonic sensor measures the distance of the bottom on the bin from the device, and as trash is filled in, this distance becomes shorter. When the distance is below a certain level, the LED is lit, indicating that the bin is full, ready to be emptied. This saves time for the janitors, they would only need to focus on bins that the indicator is on for.

Step 1: Setup


This device uses:

1. An Arduino or ATMega 328

2. An ultrasonic sensor

3. One LED

4. Wires

Wiring:

The ultrasonic sensor on the breadboard is connected to digital pins 3 (Echo) and 4 (Trig) of the Arduino. The LED on the breadboard is connected to Pin 13 of the Arduino, and to ground.

The device can be set for battery operation.

Step 2: Working

The ultrasonic sensor measures the distance from the device to the level of trash. As trash is filled in, the distance decreases, and when the distance is lower than a threshold level the LED is lit.

Arduino Contest 2019

Participated in the
Arduino Contest 2019

Be the First to Share

    Recommendations

    • Pocket-Sized Speed Challenge

      Pocket-Sized Speed Challenge
    • Audio Challenge 2020

      Audio Challenge 2020
    • Maps Challenge

      Maps Challenge

    2 Discussions

    0
    wilmeralita
    wilmeralita

    Question 7 months ago on Step 1

    Did you program the arduino micro controller? What specific code did you use?

    0
    a33784
    a33784

    Answer 7 months ago

    Hi,
    Yes I used Arduino to program an ATmega328 microcontroller.

    Code is below:

    /*
    * Distance measurement using Ultrasonic Sensor
    *
    * Ashrit P.
    * Instructbles code
    */
    // define the seonsor and LED pins
    const int trigPin = 4;
    const int echoPin = 3;
    const int LEDPin = 13;
    // defines variables
    long duration;
    int distance;
    void setup() {
    pinMode(trigPin, OUTPUT); // Trig Pin is setup as Output
    pinMode(echoPin, INPUT); // Echopin is setup as Input
    pinMode(LEDPin, OUTPUT); //LED Pin is setup as output
    }
    void loop() {
    // Clears the trigPin
    digitalWrite(trigPin, LOW);
    delayMicroseconds(2);
    // Sets the trigPin on HIGH state for 10 micro seconds
    digitalWrite(trigPin, HIGH);
    delayMicroseconds(100);
    digitalWrite(trigPin, LOW);
    // Reads the echoPin, returns the sound wave travel time in microseconds
    duration = pulseIn(echoPin, HIGH);
    // Calculating the distance
    distance= duration*0.034/2;
    // Adjust the distance measurement as needed
    if (distance < 12)
    { digitalWrite(LEDPin, HIGH);}
    else
    {digitalWrite(LEDPin, LOW);}
    }