Need help with HC-SR04 Ultrasonic sensor

Hi people!
I really need some help. As it say in the topic, i have problmes with a sensor, but the problem can be somewhere else for sure. Here is a picture of setup.

The setup is meant to do that the color of the light changes, depending on what value the ultrasonic sensor is reading. Everything works fine with a short serial cable(50cm), but when i try with a longer cable(180cm) the readigns get weird. Either the vaules is correct but jumps to 0 every other reading. And sometimes i get only 0 as a vaule.

I'm a beginner at arduino, so the problem can be in the code as well. The strange thing is that it works just fine with the shorter cable to the arduino. I have tried like 20 other cables and gets the same results.