# Ultrasonic range finder with single transducer [closed]

I would like to make an ultrasonic range finder with a single transducer. The reason for only one transducer is because I'm limited in the amount of space I have for what I'm sensing. I've purchased the EZ01 ultrasonic sensor and it works well but I need to make my own now with a waterproof transducer. I have the transducer which is 40kHz but need to put together the other components along with my arduino. I'm wondering if anyone has any experience with this and could direct me to a schematic or any information on how to wire this up and use the one transducer as a transmitter and receiver.

## closed as too broad by Chris Stratton, Oleg Mazurov, Reinstate Monica, Dmitry Grigoryev, FinbarrAug 30 at 14:16

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Sounds a neat project - any ideas what the method used in the EZ01 was to measure range? It could use a radar type ping and quickly switch the transducer over to be a receiver and detect a ping coming back. Or it may be a continuous wave circuit with a sensitive circuit that differentiates reflections from output signals? – Andy aka Mar 24 '13 at 20:47
• This is do-able however you'll be limited in the minimum range you can detect. The ceramic transducers ring for a while (at the resonant frequency, obviously). The Polaroid SX-70 used a single electrostatic transducer for sonar ranging (autofocus). – Spehro Pefhany Aug 8 '18 at 14:46

How do you make a range sensor using one transducer:

As you can see from the EZ01 datasheet, it has the ability to do both. It is the same pinout as my MB7380 sensor:

How do you waterproof electronic sensors?

→ silicone heat shrink tubing and waterproof epoxy

There are $13 waterproof ultrasonic sensors on eBay ($15 on Amazon). As Chris Stratton says, the EZ01 is not designed to work in aquatic environments. After all, water is 850 times denser than air.

C

unsigned long startMillis;
unsigned long currentMillis;

const byte pinTX = 9; // trigger
const byte pinRX = 10; // echo

void setup() {
startMillis = millis();  // initial start time

pinMode(pinTX, OUTPUT);
Serial.begin(9600);
}
void loop() {
currentMillis = millis(); // milliseconds since start

// Reads & returns sound wave traveled in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculate distance
distance= duration*0.034/2;  // DO: Change this calculation...

// From here it depends on how you want to output the data: datalogger, LCD screen, etc.
// See https://howtomechatronics.com/tutorials/arduino/ultrasonic-sensor-hc-sr04/
}

// Function you probably don't need:
void read(){ // for connecting to pin 4 on sensor
int len, m;
char testStr[] = "R012\r";   // <test> This version takes 1870 bytes
//  in = Serial.read(pinRX);
len = strlen(testStr);        // <test>
//  len = strlen(in);
return m = atoi(&testStr[len - 3]);  // <test>
//  Serial.println(m);          // <test>
//  m = atoi(&in[len - 3]);     // measured TTL serial output converted

}

• You simply cannot waterproof a typical in-air ultrasonic sensor leaving it still working, you must use one designed from the start to be waterproof. – Chris Stratton Aug 8 '18 at 15:15
• Maybe he means water resistant or rain proof. Another way is putting the pinout end in a box like I show. – adamaero Aug 28 at 14:12