Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Anugrah Jihaddirakit community
Published

Arduino based Smart Trash Can B24

Simple IoT project, making a smart trash can based on Arduino

BeginnerFull instructions provided436
Arduino based Smart Trash Can B24

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
IR Infrared Obstacle Avoidance Sensor Module for Arduino
×1
USB-A to B Cable
USB-A to B Cable
×1
Male/Male Jumper Wires
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
6-pin Header & Gender Changer (5-pack)
Digilent 6-pin Header & Gender Changer (5-pack)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Trash bin

Story

Read more

Schematics

Arduino based Smart Trash Can

Connect it as follows

Code

Arduino based Smart Trash Can

C/C++
Copy this and paste it into the Arduino IDE
#include <Servo.h>
Servo myservo;
int angle =0;
int angleStep =50;
void setup() {
myservo.attach(8);
pinMode(2,INPUT_PULLUP);
}
void loop() {
if (digitalRead(2) == HIGH){
myservo.write(180);
}
else {
myservo.write(-180);
}
}

Credits

Anugrah Jihad
1 project • 0 followers
Contact
dirakit community
23 projects • 109 followers
Indonesia IoT Community by Informatics UIN Sunan Kalijaga Yogyakarta
Contact

Comments

Please log in or sign up to comment.