overheating

Hello,
arduino newbie here. I have a project parts&code below for watering plants. Problem is that arduino board getting really hot (especially highlited part on picture). Could you please try to help me find out if it is a problem or give me an advice how to lower the heat generated. Thank you.

Parts:
UNO R3 ATmega328P
UNO Shield Ethernet Shield W5100 R3
temp&humidity DHT11
temp DS18b20 via 4,7k resistor
humidity 86062
water level HC-SR04
water pump driver L9110S
water pump 240L/H DC 12V 2 Phase CPU Cooling Car Brushless Water Pump Waterproof C1
AC 100V-240V Converter Adapter DC 9V 1A
connected to computer for debug
connected to ethernet

Code:

//dht11-moistureTemp
  #include "DHT.h"
  #define DHTPIN 3     // what digital pin we're connected to
  #define DHTTYPE DHT11   // DHT 11
  DHT dht(DHTPIN, DHTTYPE);
//ds18b20-temp
  #include <OneWire.h>
  #include <DallasTemperature.h>
  // Data wire is plugged into pin 2 on the Arduino
  #define ONE_WIRE_BUS 2
  // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
  OneWire oneWire(ONE_WIRE_BUS);
  // Pass our oneWire reference to Dallas Temperature. 
  DallasTemperature sensors(&oneWire);

//86062-hygrometer
  //Constants 
  const int hygrometer = A0;  //Hygrometer sensor analog pin output at pin A0 of Arduino
  //Variables 
  int sh; //SoilHumidity
  const int allowedMinimumSoilHumidity = 50;

//ThingSpeak
  #include "ThingSpeak.h"
  #define USE_ETHERNET_SHIELD
  // Use wired ethernet shield
  #include <SPI.h>
  #include <Ethernet.h>
  byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
  EthernetClient client;
  unsigned long myChannelNumber = 164880;
  const char * myWriteAPIKey = "";

// L9910 motor driver
  static const int A_IA = 6;
  static const int A_IB = 7;
  int pump = 0;

// HC-SR04 ultrasonic
  #define TRIGPIN 8 // Trig pin z HC-SC04 na pin 8;
  #define ECHOPIN 9 // Echo pin z HC-SC04 na pin 9;
  const int allowedMinimumWaterLevel = 8;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); //Begin serial communication
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }  
  Serial.println("Arduino smartGarden by George - ThingSpeak - v1.0"); //Print a message
  sensors.begin();
  Ethernet.begin(mac);
  ThingSpeak.begin(client);

  pinMode(A_IA, OUTPUT);
  pinMode(A_IB, OUTPUT);

  //Nastaví pin 9 jako vstupní 
  pinMode(ECHOPIN, INPUT); 
  //Nastaví pin 8 jako výstupní 
  pinMode(TRIGPIN, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  delay(2000);
  pump = 0;
  //dht11-moistureTemp
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);
  // Compute heat index in Fahrenheit (the default)
  float hif = dht.computeHeatIndex(f, h);
  // Compute heat index in Celsius (isFahreheit = false)
  float hic = dht.computeHeatIndex(t, h, false);
  Serial.print("Humidity: ");
  Serial.print(h);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(t);
  Serial.print(" *C ");
  Serial.print(f);
  Serial.print(" *F\t");
  Serial.print("Heat index: ");
  Serial.print(hic);
  Serial.print(" *C ");
  Serial.print(hif);
  Serial.println(" *F");


  //ds18b20-temp
  // Send the command to get temperatures
  sensors.requestTemperatures();  
  Serial.print("Soil temperature: ");
  Serial.println(sensors.getTempCByIndex(0)); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
  float st = sensors.getTempCByIndex(0);
  //Update value every 1 sec.


  //86062-hygrometer
  // When the plant is watered well the sensor will read a value 380~400, I will keep the 400 
  // value but if you want you can change it below. 
  
  sh = analogRead(hygrometer);   //Read analog value 
  sh = constrain(sh,400,1023);  //Keep the ranges!
  sh = map(sh,400,1023,100,0);  //Map value : 400 will be 100 and 1023 will be 0
  Serial.print("Soil humidity: ");
  Serial.print(sh);
  Serial.println("%");

  // Vyšle impuls do modulu HC-SR04
  digitalWrite(TRIGPIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIGPIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIGPIN, LOW);
  // Spočítá vzdálenost
  float distance = pulseIn(ECHOPIN, HIGH);
  distance= distance*0.017315f;
  // odešle informace na sérivý port
  Serial.print(distance);
  Serial.println("cm");

  if (distance < allowedMinimumWaterLevel) {
    if (sh < allowedMinimumSoilHumidity) {
      Serial.println("PUMP ON!");
      // pump on
      pump = 1;
      digitalWrite(A_IA, LOW);
      digitalWrite(A_IB, HIGH);
     
      delay(2000) ; // 5 seconds
     
      // pump off
      digitalWrite(A_IA, LOW);
      digitalWrite(A_IB, LOW);
      Serial.println("PUMP OFF!");
      delay(2000) ; // 5 seconds
    } else {
      Serial.println("Soil is well moisturized already :-)");  
    }
  } else {
    Serial.println("ERROR MINIMUM WATER LEVEL REACHED!");
  }

  //ethernet
  ThingSpeak.setField(1,t);
  ThingSpeak.setField(2,h);
  ThingSpeak.setField(3,st);
  ThingSpeak.setField(4,sh);
  ThingSpeak.setField(5,distance);
  ThingSpeak.setField(6,pump); 
  ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);

  //Read frequency:
  delay(13000);
}

robotdynuno.png

Yeah I have the same problem but in any case whenever I power Arduino with 12v it starts heating in the highlighted area even if I uploaded a blank code and it is idle

The on-board 5V regulator is a linear regulator - it dissipates heat equal to (Vin - 5) * current, in order
to drop Vin down to 5V.

If you have high current peripherals on the Arduino and use a large Vin, the dissipation can get too high
in which case the regulator may overheat and shutdown to protect itself. It can get very hot without
shutting down, note, its rated to 100C or more.

The best approach for high current devices is power them directly, or at least use an external regulator
with a heatsink.

Since you're using a "AC 100V-240V Converter Adapter DC 9V 1A" which I'm guessing is a wall wart, why not actually just use a 5V one?

INTP:
Since you're using a "AC 100V-240V Converter Adapter DC 9V 1A" which I'm guessing is a wall wart, why not actually just use a 5V one?

He probably wants the 9V to get reasonable speed from his 12V water pump.

An external, switching regulator to provide the 5V would be the best plan.

Hi, This is a common problem with Arduino.

There are details of this and calculations HERE:

This is why the YourDuino RoboRED we designed with a friend in China has a 2 Amp switching regulator onboard. See details HERE:

DISCLAIMER: Mentioned stuff from my own shop...

So should we use only 5v

Archut:
Yeah I have the same problem but in any case whenever I power Arduino with 12v it starts heating in the highlighted area even if I uploaded a blank code and it is idle

The Arduino is never idle, it is calling loop() endlessly. Current is taken by both the USB interface
chip (another microcontroller) and the Arduino microcontroller chip itself, as they are clocked at
high speed constantly. CMOS chips roughly speaking dissipate power proportional to clock speed
and proportional to supply voltage squared.

So basically how much voltage and amps should be supplied

I assume you are using Vin of arduino to power up all other sensos and module higher then 5V.
This could be the possible reason of heating up of arduino.
just bypass 12V or 9V supply from +ve side to power up your remaining modules and sensors rather then giving it through VIN of arduino.