Project showcase
Smart Trash

Smart Trash © GPL3+

Smart Trash can be done with servo motors or stepper motors.

  • 22,426 views
  • 4 comments
  • 39 respects

Components and supplies

About this project

Hi there,

This project can be done with servo motors or stepper motors; I made it with servo motors.

For this project, I used a hot silicone gun to paste components. When doing this project, you should be careful when you drill a hole in the trash can. The placement should be good - not too high, not too low, but just right. That's why you must pay attention to the diameter of the apparatus. Plan to drill the holes accordingly.

In fact, this project is not very difficult. You can visit my website. This circuit:

Code

Untitled fileC/C++
#include<Servo.h>                //Adding the Servo library

Servo myservo;            //Define an object named MyServo
const int eko=8;        
const int trig=7;        
int mesafe;
int sure;

void setup() {
  myservo.attach(9);           //We introduced the ninth pin arduino to the servo motor
  pinMode(trig,OUTPUT);        
  pinMode(eko,INPUT);          
}

void loop() {
  myservo.write(0);       
  Serial.begin(9600);     
  
 
   
  digitalWrite(trig, LOW);         
  delayMicroseconds(10);
  digitalWrite(trig, HIGH);       
  delayMicroseconds(20);
  digitalWrite(trig, LOW);         
  sure = pulseIn(eko, HIGH);      
  mesafe= (sure/29.1)/2;  
  

  if(mesafe<=5){
    myservo.write(160);
    delay(5000);   
  }
  
   
  if(mesafe>200)
mesafe=200;
Serial.print("mesafe");
Serial.println(mesafe);
delay(500);
}

Schematics

circuit
Smarttrashservo bb gh3d2iflgu veqrybfbqq

Comments

Similar projects you might like

Smart Battery Charger Multiplexer with Smart Display

Project tutorial by leonzak

  • 6,652 views
  • 8 comments
  • 21 respects

Touchless Automatic Motion Sensor Trash Can

Project showcase by Will Su

  • 41,263 views
  • 31 comments
  • 66 respects

DIY Smart Cane Using Arduino

Project tutorial by suhail jr

  • 14,609 views
  • 1 comment
  • 18 respects

Arduino Trash-Bot (Auto-Open/Close Trash Bin)

Project tutorial by ashraf_minhaj

  • 21,295 views
  • 4 comments
  • 22 respects

Smart Parking System

Project in progress by Md. Khairul Alam

  • 61,782 views
  • 37 comments
  • 130 respects
Add projectSign up / Login