top of page

Arduino menggunakan Servo, Sensor PIR dan LED

Nov 13, 2016
1 min read


Note :

  • Arduino Uno

  • Sensor PIR

  • Resistor 220 Ω

  • LED

  • Servo

  • Kaki Anoda pada LED terhubung ke port D13 Arduino

  • Kaki Katoda pada LED terhubung pada resistor kemudian terhubung pada port Ground arduino

  • Garis berwarna merah adalah VCC

  • Garis berwarna hitam adalah Ground

  • Garis berwarna kuning merupakan kaki data servo yang terhubung pada port D3 arduino

  • Garis berwarna biru merupakan kaki data sensor pir (1) yang terhubung pada port D2 arduino

  • Garis berwarna biru merupakan kaki data sensor pir (2) yang terhubung pada port D4 arduino

Sketch Program :


#include <Servo.h> Servo servo; int servoPin = 3; int motionPin1 = 2; int motionPin2 = 4; byte gerak1 = LOW; byte gerak2 = HIGH; int servoAngle = 0; int ledPin = 13; int lampu = LOW; void setup()

{ servo.attach(servoPin); pinMode(ledPin, OUTPUT); pinMode(motionPin1, INPUT); pinMode(motionPin2, INPUT); servo.write(servoAngle); Serial.begin(9600); } void loop()

{ gerak1 = digitalRead(motionPin1); while(gerak1 == HIGH)

{ digitalWrite(ledPin, HIGH);

Serial.println("Gerakan Terdeteksi");

gerak2 = digitalRead(motionPin2);


if(gerak2 == HIGH)

{ servo.write(100); Serial.println("Servo Buka");

} else

{ Serial.println("Servo Tutup"); servo.write(0); break; } } if (gerak1 == LOW)

{ digitalWrite(ledPin, LOW); servo.write(0); Serial.println("Gak ada gerakan"); } }


304 Comments


jordan20846
5 hours ago

What draws my attention to using digital tools in vocational learning is the possibility of making an unfamiliar subject feel closer to everyday life. Digital resources are most useful when they help students practise a recognisable workplace task. It also gives the phrase digital vocational education a clearer meaning than a label on its own. I am still thinking through the details, and a small example would help me picture how this works in practice. Which activities benefit from an online tool and which still need hands-on practice?

Like

jordan20846
1 day ago

I can see why connecting values with everyday school life would invite discussion, since different people will bring different experiences to the same question. Kindness becomes easier to understand when it appears in ordinary classroom situations. It makes me curious about the practical side of values based education. I can imagine different answers depending on the situation, so I would want to understand the context before drawing conclusions. How can a school discuss values while leaving room for students' questions?

Like

jordan20846
1 day ago

Considering making online counselling easier to approach, I keep coming back to the difference between knowing about an idea and putting it into practice. Knowing how a first conversation works can reduce uncertainty about asking for support. It gives me a more concrete starting point for thinking about online counselling information. A short discussion of an everyday example would make this easier for me to connect with, especially as someone still learning about the subject. What practical information should be available before someone books an online session?

Like

jordan20846
2 days ago

I find using clear language to explain complex ideas easier to think about when there is a concrete question to start from. A concrete example often makes an abstract explanation easier to follow. I would keep that thought nearby when looking for ideas about clear communication skills. I can imagine different answers depending on the situation, so I would want to understand the context before drawing conclusions. How do you decide when technical terminology helps and when it gets in the way?

Like

jordan20846
2 days ago

My first thought about making room for neighbourhood learning activities is that the everyday experience deserves as much attention as the larger explanation. A familiar local meeting place can make trying a new activity feel more approachable. For me, that is a useful way into the broader subject of community learning activities. A short discussion of an everyday example would make this easier for me to connect with, especially as someone still learning about the subject. What would encourage someone to join a class for the first time?

Like
Featured Posts
Check back soon
Once posts are published, you’ll see them here.
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page