Problem with ethernet+sd card shield and relays

I have one strange problem ,I write a code to drive two relays ,one if tmp. higher and one if temperature lower... and thats work fine ,a use dallas sensor... and I add ethernet shield with sd card slot to mu arduino uno ... Than I edit my code to make logs to sd card.... I try code and everything works fine, arduino write logs. but when I disconnect pc from arduino and use power supply both relays start to blink together... and I connect computer again than everything work fine ... than I disconnect Ethernet shield and relays work fine...
relays use 5,6 digital pins ..... one wire use pin 9 ....

maybe someone have some problem :confused:

but when I disconnect pc from arduino and use external power supply both relays start to blink together

The software doesn't know that you are using a USB cable to supply power or an inadequate wall wart. So, incorrectly posting code was not necessary. Some details about your "external power supply" are.

Dc Power supply 12v ,1Amp... when I use same supply without ethernet shield relay work fine .. :fearful:

I find a problem,it was voltage regulator on arduino .... overheating :grin: