Coding to program servo and ir sensor #include <Servo.h> const int analogInPin = A0; int sensorValue = 0; int servoPin = 9; int i = 0; Servo servo; void setup() { servo.attach(servoPin); } void loop() { sensorValue = analogRead(analogInPin); if(sensorValue < 600){ for (int i = 0; i<=180; i++){ servo.write(i); delay(10); } } servo.write(i); }
Circuit diagram for LPG protection Required material 1.LPG sensor-https://amzn.to/2UDk6Vd 2.relay-https://amzn.to/2uQBB5O 3.transistor 4.battery 5.buzzer 6.old mobile
Comments
Post a Comment