Pages: [1]   Go Down
Author Topic: 4 pin ultrasonic range finder, 3 pin ping sensor  (Read 1588 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

can a 4 pin ultrasonic range finder be operational using only 3 pins as on the parallax ping sensors?

Thank You
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 106
Posts: 3772
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, with the 4 pin, they have split the data lines to Echo and Trigger, instead of a single line. The 3 pin code will work, you just need to tweak it to work with trigger and echo. HINT: one is input and the other is output.
Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 75
Posts: 7268
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You want some code or just general advice whether to buy a 4-pin sensor but run the 3-pin code?

Here is code snippet:

Quote
    micros_now=micros();
    digitalWrite(sonic_ranger_init,LOW);
    delayMicroseconds(2);
    digitalWrite(sonic_ranger_init,HIGH);
    delayMicroseconds(15);
    digitalWrite(sonic_ranger_init,LOW);
    delayMicroseconds(20);
    micros_delay=pulseIn(sonic_ranger_echo,HIGH,35000L);
    distance_mm=micros_delay*343/2000; // This is round trip time so 1/2/1000=1/2000
    Serial.println(distance_mm);

Go ahead and but the 4-pin sensor.
Logged


Pages: [1]   Go Up
Jump to: