hi all
i am planning to make automatic door using an LM35. what i want is when the pin 7 goes high i want it to stay high for 2 seconds just enough time to open the door then stop. then wait for pin 7 to go low for 2 seconds then off until pin 7 goes high again
could any one help
thus opperating a door to open when temp high
close when cold
i could use a relay or mosfet to drive the motor
i have a copy of this sketch
#include <LiquidCrystal.h>
int reading = 0;
int sensorPin = A0;
int relay =7;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
pinMode(relay,OUTPUT);
}
void loop() {
reading = analogRead(sensorPin);
int celsius = reading/2;
lcd.setCursor(0, 0);
lcd.print("Temperature: ");
lcd.setCursor(0,1);
lcd.print(celsius, DEC);
lcd.print((char)223);
lcd.print("C");
if (celsius >35) {
digitalWrite(7,HIGH);
} else {
digitalWrite(7,LOW);
}
delay(500);
lcd.clear();
}
thanks
marko