2v output on arduino

hi i have my arduino output pin connected to a relay, but it is only giving me 2v from output pin? i need 5v to switch the relay

What is the coil rating on the relay?
If its less than 150 ohm, it needs more current than the Arduino can supply.
Use an NPN transistor to sink current thru the coil to turn it on.

And very importantly you need a backwards diode across the relay coil to prevent damage - this is not an optional component - see the various examples on the arduino website of driving inductive loads like relays / motors.

hi coil resistance is 320 ohms

Did you remember to make the pin an output?

Please feel free to chip in with details. Code, schematic, you know, the usual.

If the coil resistance is 320ohm and the pin only pulls up to 2V the chip is fried. Probably destroyed by inductive kickback if there was no diode.

i check the voltage coming out of the pin at 5v when it is on, but once i connect it to the relay and check voltage again its only 2v and my relay needs 5v to switch. the relay has already got a diode in parallel with the coil for protection so chip isn't fried.

See reply #4

The built-in pull-ups are spec'd as between 20k and 50k, the relay is alleged to be 320 ohms, there's no way that makes a potential divider of 40%!

If the load on the pin is really 320 ohms then the chip is fried since it would produce about 4.5V into that load.

A good measurement to make would be the current into the relay winding when directly connected to 5V supply. If it reads about 15mA then it is 320 ohms and the output pin is blown (assuming no other load on the pin).