Project showcase
Smart Trash

Smart Trash © GPL3+

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

  • 15,937 views
  • 4 comments
  • 31 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

Touchless Automatic Motion Sensor Trash Can

Project showcase by Will Su

  • 19,739 views
  • 17 comments
  • 34 respects

DIY Smart Cane Using Arduino

Project tutorial by suhail jr

  • 9,871 views
  • 1 comment
  • 12 respects

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

Project tutorial by ashraf_minhaj

  • 2,799 views
  • 3 comments
  • 12 respects

Smart Parking System

Project in progress by Md. Khairul Alam

  • 43,048 views
  • 32 comments
  • 104 respects

tinyGlow Smart LEDs

by Alex Glow

  • 3,800 views
  • 3 comments
  • 24 respects
Add projectSign up / Login