Sample rate

// the reference voltage
double REF_VOLTAGE = 3.3;

// the pin where the temperature is to be mesured
int tempPin = 5;

void setup()
{
// open te serial output with 115200 baud
Serial.begin(115200);
// tell the Arduino that the reference voltage is
// provided by an external source
analogReference(EXTERNAL);
// wait for the external source to be switched
delay(100);
}

void loop()
{
// read the tempetarue
int tempReading = analogRead(tempPin);
// converting that reading to voltage
float voltage = tempReading * REF_VOLTAGE / 1024.0;
// convert the voltage to a temperature
float celsius = (voltage - 0.5) * 100 ;
// print it on the serial output
Serial.println(celsius);
// wait a second
delay(30000);
}

Here is my code for the tmp36 sensor. I want to activate my sensor every 30 secs for 2 seconds and take at least 5 measurements every second. I am changing the baud rate but nothing happens. Any help?

What has the baud rate got to do with your description?

Please remember to use code tags.

The OP wrote that nothing happens. Does that mean that there is no serial output?

I am changing the baud rate but nothing happens.

Perhaps you should try changing the font size. That makes as much sense.

 // wait a second
  delay(30000);

If you are going to have useless comments, you MUST make them correct useless comments. Otherwise, you just look like an idiot.

I want to activate my sensor every 30 secs

So, get your head out of the sand, and look at the blink without delay example. What you want to do every 30 seconds is not toggle an LED, but the concept still applies.

for 2 seconds and take at least 5 measurements every second.

So, what part of your code is trying to do that? Where do the two seconds and 5 measurements per second come from? If you want 10 readings, why does it matter how long it takes? 0.8 seconds or 1.8 seconds or 2.8 seconds doesn't really seem to matter when you only care about the temperature every 30 seconds.

What do i have to change into my code? Im not an experienced user

What do i have to change into my code?

The parts that don't do what you want.

unsigned long lastTempTime = 0;

void loop()
{
   unsigned long now = millis();
   if(now - lastTempTime >= 30000)
   {
      // It has been 30 seconds... Take some readings...

      lastTempTime = now;
   }
}

You need to add some code after the comment. I don't understand your requirement well enough to help you write the code.

nick8 should do the following:

  1. Get a "Hello, World" program working to ensure that the serial I/O works for debugging.

  2. Avoid calling the delay(...) function. delay(30000) wastes the considerable power of an Arduino for 30 seconds. Yes, there are ways around this (an ISR comes to mind) but they are definitely not for newbies.

  3. Provide a better description of what is being attempted (also known as requirements). Some description of why might help us better understand but I am not hopeful.