Using 2 Ultrasonicsensors for localisation

Hi everyone,
i am trying to handle a project, where i want to locate the transmitter (also a ultrasonic sensor) with a few ultrasonic sensors.
I want to use 3 sensors (all in the air) to receive the trigger-signal from transmitter 1 (on the ground). But it actually doesn't work that 2 sensors work together in that way, that sensor 1 is sending the signal out and sensor 2 is receiving the trigger-signal from sensor 1 (his echo). I tried to put some paper on the trigger of sensor 2 (i only need the echo!), but then the Arduino gave out 0 cm.
Both sensors are working individually perfect. But sensor 1 doesn't register the trigger-signal from sensor 2 and the same problem on the other way.
I hope, that someone can help me to fix this problem or if it is not possible,to tell me this.
Enclosed my code.

Best regards

okc1innba

int maximum_distance=700; // should not irritate-> in "one" direction is the distnce unnecessary
int minimum_distance=2;
double measured_distance;
double bygone_time;
void setup() {
pinMode(7,OUTPUT);//Trigger Arduino Sensor 1
pinMode(8,INPUT);//Echo Arduino Sensor 1

pinMode(12,OUTPUT);//Trigger Sensor 2 //paper on it
pinMode(13,INPUT);//Echo Sensor 2
Serial.begin(9600);

}

void loop() {
digitalWrite(12,LOW);
digitalWrite(7,LOW);

delay(10);

digitalWrite(12,HIGH);
digitalWrite(7,HIGH);

delay(10);

digitalWrite(7,LOW);

bygone_time=pulseIn(13,HIGH);
Serial.println(bygone_time); //to overview

measured_distance=bygone_time*0.03432; //temperature irrelevant, if the Project doesn't work
if(measured_distance>=minimum_distance && measured_distance<=maximum_distance)
{
Serial.print("Distance: ");
Serial.print(measured_distance);
Serial.println(" cm");
}
else
{
if(measured_distance<=minimum_distance)
{
Serial.println("Distance to short");
}
else
{
Serial.println("Distance to long");
}
}

delay(1000);
}

By the way, i am using HC-SR04 sensors

This will not work, stop trying.

Same post here;

https://forum.arduino.cc/t/ultraschallsensor-lokalisierung-koordinaten/927825

do you know, if there are alternative sensors on the market, which make this possible?

I know, there are systems that can accomplish it, but I can not give you links.
Many newer systems use cameras.

Like here:

Not sure I understand the OP's project, but maybe the following project of mine is in the ballpark:

I had two Arduinos and called one the "master" and the other a "slave." The master has a NRF24L01 radio and an unmodified HC-SR04. The slave has a NRF24L01 radio and a modified HC-SR04.

The slave's HC-SR04 was modified by unsoldering its transmit transducer.

I used the NewPing library.

The system operates like this:

The "master" radio transmits a packet, triggers its HC-SR04 using sonar.ping(), waits "x" seconds, repeats. (The master does not use the value that sonar.ping() returns.)

The "slave" waits for a radio packet from the master. When the slave's radio receives a packet, it triggers its HC-SR04 using sonar.cm(), reports the distance on an LCD (which will be half the distance between the master and slave), and then waits for another packet.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.