How do I include servo in my arduino project.

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");
}}

Have you looked at any example programs that use servos?

The demo Several Things at a Time illustrates the use of millis() to manage timing and includes servo code.

...R

Be sure to power the servo separately from the Arduino and to connect all the grounds.

Attempting to power a servo from the 5V Arduino pin will cause malfunctions and possibly, damage the Arduino.

Presumably the balloon's on a string, else it will just float away. Why don't you just haul it back down?