- EZ01 ultrasonic sensor is a 42kHz transducer
- Arduino-based
Although, I was told: Quickly switch from transmitted frequency to connecting the same piezo element to a high gain receiver amplifier. Also need a filter and clock to tell the time between transmitting and receiving the echo signal are needed.
So now I do not know what to think. How would you make it (with one transducer)? What amplifier, filter and clock--if needed--or what resources do you recommend I read?
C:
unsigned long startMillis;
unsigned long currentMillis;
const byte pinTX = 3;
const byte pinRX = 4;
void setup() {
startMillis = millis(); // initial start time
pinMode(pinTX, OUTPUT);
Serial.begin(9600);
}
void loop() {
currentMillis = millis(); // milliseconds since start
// SOMETHING about transmitting
read();
}
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
}
Last edited: