Arduino leonardo outputting just 2.5v ?

Hey! So, I connected my cables to pin 12 and GND, the output is 2.5v

Pin 12, digitalWrite(12,high) pin 11, analogwrite(11,255) Both output 2.5 volts, which is less than I need to control my relay...

With pin 11, here you have the code:

int led = 11;

void setup() {   
  pinMode(led, OUTPUT);     
}

void loop() {
  analogWrite(led, 255); 
  delay(1000);
  digitalWrite(led, 0);  
  delay(1000);               
}

The 5V pin gives me almost 5V (4.8 ) however, I cannot control that.. I just want to control a 5V relay with Arduino, but it only gives me 2.5v which is not enough.. Thanks in advance! Best regards, BreaKer.

Usually that happens when someone forgets to include the pinMode(pin,OUTPUT);

Is there any load on the pin? If you try to draw much more than 30 mA from the pin you will get a significant voltage drop.

What are you using to measure the voltage?

I am using the pinmode in setup() Measuring it with a multimeter..Should I rather use the 5V pin and trigger a transistor with the pin signal than use the pin directly to trigger the relay?

Look up the specs for your relay. If the coil needs more than 30 mA you should use a transistor to drive the relay. Or you could buy one of the many inexpensive relay modules available on eBay which includes a transistor driver.

So I shall ^^ However, what really troubles me is why my Leonardo only outputs 2.5V...

brreakerr: what really troubles me is why my Leonardo only outputs 2.5V...

Is that with nothing but the multimeter connected to any of the pins? The pin has internal resistance. If you put a load on it that will cause the output voltage to drop. The heavier the load (lower resistance to Ground) the more the output voltage drops.

The relay works at 109 mA, so that's why it ain't enough to power it... Disregard my previous statement, I made the rookie mistake of reading the voltage without first disconnecting it from the relay =) Gonna look for a transistor to use Thanks a ton for your time ^^

Generally a small NPN transistor between the relay and Ground is the way to go. For the nitty-gritty details of how to use a transistor as a switch I refer to this online course material:

http://www.electronics-tutorials.ws/transistor/tran_4.html