Earth your low voltage electronics and put a good insulator under the board with an air gap. I usually use plastic sheet of similar thickness to window glass, available at DIY places. You can buy nylon nuts and bolts and spacers to mount everything.
Now to the problem. When I put the humidity sensor in the soil and measure with a multimeter to a ground object(like a heater body) , then the ac voltage reads a value of approx 45 v? The same happens if I connect any pin of the arduino to the heater body(ground).(If i connect the gnd port of the arduino to the earth(aka ground aka heater body) then the voltage disappears. But how i can fix this problem without always having to connect the gnd port to a big metal object?)
That depends on the design of the power supply for the Arduino. From the pictures it is not connected, so I cannot say if it would be grounded when the power supply for the Arduino is connected.
Keep in mind that the load is live all the time that the mains is connected to the box, even if the electronics is off or has the load off. The load is only ever save if the mains supply has been removed completely (unplugged) from the box.
Aaand if I was to build it in a metal box with an insulation layer underneath inside, how would i have to ground the electronics? I guess by connecting the yellow-green wire to the casing and as well the gnd port of the arduino to the casing?