Faulty Maxbotix ultrasound sensor readings...

Hey there all, I have been working on this project for quite some time and am getting a little frustrated with my Maxbotix sensor. This is my first Arduino project as well as my first time programming anything. I've done my best getting things up and running, but think I've hit a roadblock with this issue.

I am trying to have sensor data be uploaded to ThinkSpeak by way of a Dragino Yun WiFi shield. This morning, after about 8 hours of trying to get the code right, it started to work! The data can be viewed here: Channels - ThingSpeak IoT.

The only problem is that my sensor is going crazy. I have a Maxbotix ultrasound sensor hooked up to my Arduino (5V for power from Arduino (the sensor operates on 5V), pin 3 on the sensor to analog pin1 for the reading, and ground to Arduino ground) and it reads a constant measurement of 173cm regardless of its distance to anything, and this is only after a spike to ±260cm at start-up. It spikes and then it slowly settles to 173cm in about 10 seconds. My power source is an old 12V 1A DC adapter that I've plugged into the 2.1mm socket. I tried a 9V battery, same thing, but the reading around 173cm is less eratic; when plugged into the wall the reading jumps between 169 and 176 or so. It's especially annoying because it doesn't matter whether it's 10cm from something or 500cm (max range), it always reads 173cm or fluctuates around this value--it appears as though the longer it is left running the more it fluctuates.

Please see the attached file for my wiring...

Here is my code...

const int anPin5 = 0;
long distance1;

#include <Console.h>
#include "Bridge.h"
#include "HttpClient.h"

String name;

//Thingspeak parameters
String thingspeak_update_API = "http://api.thingspeak.com/update?";
String thingspeak_write_API_key = "key=XXXXXXXXXXXXXXXXX";
String thingspeakfieldname = "&field1=";

void setup()
{
// Initialize Bridge
Bridge.begin();
// Initialize Console
Console.begin();
// Wait for Console port to connect
while (!Console)

// Setup On-board LED
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
delay(1000);
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);

// Measurement that will be displayed
Console.println("Groundwater Level:");
}

void read_sensors()
{
/* Scale factor is (Vcc/1024) per 5mm. A 5V supply yields ~4.9mV/5mm
Arduino analog pin goes from 0 to 1024, so the value has to be multiplied by 0.5
to get range in centimeters. */
distance1 = analogRead(anPin5)*0.5;
}

void print_all()
{
// Allows for sensor reading verification prior to ThingSpeak POST
Console.print("Reading: ");
Console.print(distance1);
Console.print("cm");
Console.println();
}

void loop()
{
read_sensors();
// Print void print_all();
print_all();

// What to post to ThingSpeak
postToThinspeak(distance1);
// Ensure the last bit of data is sent.
Serial.flush();
}

void postToThinspeak(long distance1)
{
HttpClient client;
String request_string = thingspeak_update_API + thingspeak_write_API_key + thingspeakfieldname + distance1;
// Make a HTTP request:
client.get(request_string);
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available())
{
char c = client.read();
//Console.print(c);
}
delay(1000);
}

Any help would be greatly appreciated. I've been mulling over this project for over a week straight trying to do it on my own, but it's due early this week :-(.

Update:

I just pulled the jump wires right off the sensor and it appears the analog pin is still reading 173cm? This must be exemplifying my noob, but I still don't get it. Are analog pins supposed to have passive voltage readings?

Maybe you killed that input?
What if you try a different pin?