Cant get SRF05 to work, please help!

Hi, As a disclaimer I am an absolute beginner in Arduino and don't have knowledge about electrical circuits (I'm doing a course on it). I'm trying to get a Devantech SRF05 Ultrasonic sensor to work. Whenever I connect the vcc to 5V the board turns off. It turns on if either the vcc or the gnd are disconnected, and turns on if the vcc is on 3.3V. However, when it's on I only get 0 as an output.
How can I fix this? I tried adding a resistor when its on 5V but it doesn't do anything.

Sorry for being a total noob, please help!

It has 5 pins, so I have:
VCC-> ??
TRIG: 11
ECHO: 12
OUT: Not connected
GND: GND

*edit: I've tried dozens of different codes, none of them do anything. I feel that it's something with the circuit and sensor itself! I've also tried the NewPing Library and their sample codes but nothing works
For instance I've used this code:
Ultrasonic sensor Pins:
VCC: +5VDC
Trig : Trigger (INPUT) - Pin11
Echo: Echo (OUTPUT) - Pin 12
GND: GND
*/

int trigPin = 11; // Trigger
int echoPin = 12; // Echo
long duration, cm, inches;

void setup() {
//Serial Port begin
Serial.begin (9600);
//Define inputs and outputs
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}

void loop() {
// The sensor is triggered by a HIGH pulse of 10 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

// Read the signal from the sensor: a HIGH pulse whose
// duration is the time (in microseconds) from the sending
// of the ping to the reception of its echo off of an object.
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);

// Convert the time into a distance
cm = (duration/2) / 29.1; // Divide by 29.1 or multiply by 0.0343
inches = (duration/2) / 74; // Divide by 74 or multiply by 0.0135

Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(250);
}
by Complete Guide for Ultrasonic Sensor HC-SR04 with Arduino | Random Nerd Tutorials

Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code. This will make it easier for you to spot bugs and make it easier for us to read.
  • In the Arduino IDE or Arduino Web Editor, click on the window that contains your sketch code.
  • Press “Ctrl + A”. This will select all the text.
  • Press “Ctrl + C”. This will copy the selected text to the clipboard.
  • In a forum reply here, click the “Reply” button.
  • click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the sketch between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Repeat the above process if your sketch has multiple tabs.

This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.

If the sketch is longer than the 9000 characters maximum allowed by the forum, then it’s OK to add it as an attachment. After clicking the “Reply” button, you will see an “Attachments and other settings” link.

When your code requires a library that’s not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.

srcss1713:
Whenever I connect the vcc to 5V the board turns off.

This means there is a short circuit on the SRF05 module. Check all the solder joints to see if there are any bridges or conductive debris causing a short.