NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

Aylee:
Thank you very much for the answer. I didn't used any capacitor on them.
As an idea, i wanted to do something like this: Obstacle Avoiding Robot. Object Following Robot. Arduino Project 2018. Part 2.3. - YouTube . He uses hc-sr04 too and it seems to work fine even tough they are 6 sensors, not 4.I have attached the electric scheme, hope you understand something.
All the sonic sensors are connected on the top of l293d shield on +5v and gnd.

Hope you could help me, i need it to get it working fast... thank you for your time.

I would like to connect a capacitor, maybe it helps... what capacitor i need to use?

for coding i used this

NewPing sonar[4] = { 

NewPing(3, 3, MAX_DISTANCE),
  NewPing(6, 6, MAX_DISTANCE),
  NewPing(5, 5, MAX_DISTANCE),
  NewPing(4, 4, MAX_DISTANCE)
};

on setup
serial begin 9600

and

Serial.println(sonar[0].ping_cm());
delay(300); to see what i receive from the sensor. I used println for every sensor.

[code]

Use the KISS rule. First, use one sensor. Secondly, connect a trigger and echo sensor to that one sensor. Run a test to see if that works. If it works, add stuff back in till it no longer works and that's your problem. If it still doesn't work, make it even more simple (like use the example sketch only with nothing else). Still doesn't work, remove the shield, etc.

There's no way anyone can diagnose your problem, as it's not a library problem. But, it sounds like you're trying to run before you walk. Walk first, then run. Trying to do this quickly is basically the problem.

Tim