• Tidak ada hasil yang ditemukan

Journal of Electrical and Electronics Engineering

N/A
N/A
Protected

Academic year: 2023

Membagikan "Journal of Electrical and Electronics Engineering"

Copied!
4
0
0

Teks penuh

(1)

Journal of Electrical and Electronics Engineering Vol. 2, No. 2, December 2018, 50-53

placed outside to detect user’s hand and trigger the servo to the bin content’s

(2)

sensor to detect user’s hand

(3)

, which is interpreted as someone’s hand trying to

After you thrown the trash, don’t forget to keep sensor or the lid won’t

#include <Servo.h>

#include<UltraDistSensor.h>

Servo servo;

UltraDistSensor mysensor;

UltraDistSensor mysensor2;

int buzzpin = 13;

float reading, reading2;

void setup() { servo.attach(11);

mysensor.attach(10,9); //trigger, echo servo mysensor2.attach(4,3); //trigger, echo buzzer pinMode(buzzpin, OUTPUT); }

void loop(){

reading=mysensor.distanceInCm();

reading2=mysensor2.distanceInCm();

if(reading<15)

{ servo.write(0); // Turn Servo to 0 delay(2000);

} else {

servo.write(180); //Turn it 180 delay(50); }

delayMicroseconds(2);

if (reading2 <= 11)

{ digitalWrite(buzzpin, HIGH);

} else

{ digitalWrite(buzzpin, LOW);

} delay(30);

a) }

sounding the alarm when there’s object

(4)

Referensi

Dokumen terkait

2.2 Recovery of silver Recovery of silver from the transparent electroplating solution was carried out via two routes for comparative results; i route I: cementation using zinc metal,

To achieve real and reactive power flow control in transmission line, UPFC controller has been designed to control shunt current, magnitude and angle of the series injected voltage..