Arduino auto restarts itself!

Hi, I've recently bought an arduino. This is my first project...
I have connected everything as described in this image:

and the sketch is this:

#include <LiquidCrystal.h>
#include <DHT.h>
#define DHTPIN 8
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ligpin = 9;

void setup() {
lcd.begin(16, 2);
lcd.print("Temperatura");
lcd.setCursor(0,1);
lcd.print("Umidita'");
lcd.setCursor(14,0);
lcd.print("C");
lcd.setCursor(14,1);
lcd.print("%");
pinMode(ligpin, OUTPUT);
}
void loop() {
int t = dht.readTemperature();
int h = dht.readHumidity();
lcd.setCursor(12, 0);
lcd.print(t);
lcd.setCursor(12, 1);
lcd.print(h);
if(t<=37.5) analogWrite(ligpin, 254);
}

Arduino starts, but after few seconds or loops it autoreboot itself. i haven't any idea about this problem.
Someone could help me?

I see no current limit resistor for the backlight in your schematic. Try a 220 or 330 ohm from Vcc to LED+.

add
delay(5000);
at the end of the loop() function.
It probably won't fix things altogether but you are reading and displaying the results too fast. Then, show us the output from the serial monitor for the first minute or so. (in code tags - not quote tags)

Pete

thanks for the reply!
i've just added delay(5000)
the output in the serial monitor is: (few minutes)

Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:24
Humidity:63
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25
Humidity:62
Temperature:25

I see no current limit resistor for the backlight in your schematic. Try a 220 or 330 ohm from Vcc to LED+.

what would be its function?

-I've just modified the sketch! You can see it in the first message.
-The free RAM is 1732.

thanks

Anything feeling warm? Could be you are drawing too much current from your supply, when the voltage droops enough the Arduino resets.
Doesn't look like you would be using tons of SRAM and causing an issue.

if(t<=37.5) analogWrite(ligpin, 254);

Just curious - what happens if t is > 37.5? Things will have melted down and you won't care?

i've just measured current in 5V pin. The value is between 10mA and 20mA.

Can you catch it when it resets tho? That will be trickier, likely imposible with a meter. Need to use a 'scope and trigger on the 5V line dropping.

CrossRoads:

if(t<=37.5) analogWrite(ligpin, 254);

Just curious - what happens if t is > 37.5? Things will have melted down and you won't care?

if the temperature is > 37.5 the digital pin 9 will drive out current ( 100% duty cycle, the program isnt complete).

CrossRoads:
Can you catch it when it resets tho? That will be trickier, likely imposible with a meter. Need to use a 'scope and trigger on the 5V line dropping.

the normal current value is: 16.82mA
when arduino resets the value is: 16.92mA

@filippo94:
I think it would help a lot if you describe exactly what you mean by "autoreboot itself" and what you observe happening at this point.

Pete

Normally when i press the RESET button the L led flashes so power off and at the and power on.
The L led has the same behavior when arduino auto restarts.