Ultrasonic Range Sensor won't print distance in Serial Monitor I'm using the red Ultrasonic Range Sensor with 

Sig -> Digital Pin 4

VCC -> 5V

GND -> GND

The code uploads fine and i can hear the sensor clicking away, but for some reason it won't print the distance into the Serial Monitor.

//Settings
int echoPin= 4;
int trigPin= 4;
unsigned long pulsetime = 0;
unsigned distance = 0;
unsigned OldDistance = 0;

void setup (){
  pinMode (echoPin, INPUT);
  pinMode (trigPin, OUTPUT);
  Serial.begin(9600);  
}

void loop(){

  //Work out the distance
  digitalWrite(trigPin, LOW);
  delayMicroseconds(100);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(100);
  digitalWrite(trigPin, LOW);
  pulsetime = pulseIn(echoPin, HIGH);
  distance = pulsetime / 58;
  delay(10);


  //Send value if it's changed
  if (OldDistance != distance) {

  Serial.print(distance); 

  OldDistance = distance;
  }

  delay(50);  // Wait .1 Seconds
}
You have to manually switch from OUTPUT (for sending the trigger pulse) and INPUT (for reading the distance) mode on the shared IO pin.

//Work out the distance
pinMode(trigPin, OUTPUT);    // &lt;&lt; ADD THIS
digitalWrite(trigPin, LOW);
delayMicroseconds(100);
digitalWrite(trigPin, HIGH);
delayMicroseconds(100);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);     // &lt;&lt; ADD THIS
pulsetime = pulseIn(echoPin, HIGH);
distance = pulsetime / 58;
delay(10);


To save some confusion you might like to change your code to just use sigPin instead of a pair of pins that are both the same pin.  That way you would avoid confusing bits like:

pinMode (echoPin, INPUT);
pinMode (trigPin, OUTPUT);


Which of course is the equivalent to:

pinMode (4, INPUT);
pinMode (4, OUTPUT);