hi, I've made a simple Arduino project where I use an MQ-7 to detect the level of Carbon Monoxide in the air near an industrial area. (by attaching the sensor to a balloon so that it can read the CO level at higher altitude) The question is how do I attach a servo so that after 5minutes it will move from 0degree to 180degree to pop the balloon (with a needle attached to the servo.)
this is the code that I've developed so far (including a Bluetooth module so that it can send the reading to my android phone through MIT app)
const int AOUTpin=0;
const int DOUTpin=8;
const int ledPin=13;
int limit;
int value;
void setup() {
// put your setup code here, to run once:
Serial.begin (9600);
pinMode(DOUTpin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
value= analogRead(AOUTpin);
limit= digitalRead(DOUTpin);
Serial.print ("CO Value: ");
Serial.println(value);
Serial.print("Limit: ");
Serial.print(limit);
delay(100);
if (limit == HIGH) {
Serial.println("Alarm");
}
else {
Serial.println("OK");
}}