Loading...
Pages: [1]   Go Down
Author Topic: 4 pin ultrasonic range finder, 3 pin ping sensor  (Read 398 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
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
Edison Member
*
Karma: 28
Posts: 1563
"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

UNO, MEGA, NANO, 4x4 keypad, micro servos, RF transceivers, bluetooth, ultrasonic sensor, 20x4 I2C LCD, 3.2 TFT touch screen, L298N Dual motor driver, Voice Recognition 15W, Gameduino

Arduino Tutorials, coming soon.

"If your doing nothing, it does not mean your lazy, it just means your open for anything that suits you" - Unknown

Central MN, USA
Online Online
Faraday Member
**
Karma: 35
Posts: 5920
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
Print
 
Jump to: