# What is the function of R1 in this relay driver circuit?

Given the following circuit - (source)

I'm trying to understand the logic of this circuit. Specifically, from the microcontroller, I'm not sure I understand how to switch the transistor "on" (is that the correct terminology?) to close the relay. If the IO pin on the microcontroller is +3.5V in its on state, what is the state of the transistor? What about when the pin is in its off state?

I believe this is a pull-up resistor, but I'm not sure what's pulling it up.

$I_b = \dfrac{3.5V - 0.6V}{R_1}$
The transistor will then allow the collector to pass $I_b \cdot h_{fe}$ of current, or less if there is something else limiting the collector current. $h_{fe}$ is the current gain of the transistor, and will be specified in the datasheet. It varies quite a lot even among transistors of the same model, but 100 is a reasonable estimate.