Hi,

In the datasheet I looked at the current gain for the BC639 is stated as minimum 40. Your relay coil needs 5V/63ohm=80mA at 5V, with a gain of 40 you need to push 80/40=2mA into the base of the transistor.

There's a drop of 0.6V across the base-emitter junction so if the PIC is powered with 5V you're left with ~4.4V to do it. The base resistor then needs to be 4.4/0.002=2200ohm, I'd go with half that or ~1k.

With a 100ohm base resistor you're overloading the output drivers in the PIC, trying to pull ~44mA from an output rated at 20mA. This is probably why the voltage is clamped to way less than 5V.

Fit a 1k-2k resistor then verify the operation in steps.
1) Measure the voltage at the PIC output, it should be either 0 or 5V (or close to it). If it's not then something is wrong.
2) Measure the voltage at the base of transistor, it should be either 0 or 0.6V (or close to it). If it's not something is wrong.
3) Measure the voltage at the collector of the transistor, it should be 5V when the transitor is OFF and close to 0 when the transitor is ON.

If it doesn't work please do the above measurments and report the results.

/Henrik.