Many "control" circuits are triggered by a signal which is produced by a "potential divider" network.
The signal value depends upon the component values and the supply voltage:
Vs is the signal value
V is the supply voltage
R1 is the resistance between the positive supply rail and the base of the transistor
R2 is the resistance between the negative supply rail and the base of the transistor
N.B. When choosing a transistor it is important to make sure that the gain is high enough for the required use and that the maximum current which it can handle is sufficient to drive the output device. e.g. BFY 51 gain > 40 , max Ic = 1 amp.
If the max Ic value is exceeded, the transistor will probably "burn out".
The transistor acts as a NOT gate (inverter) since a "high" at the base gives a "low" at the collector. (When the transistor switches on, the collector voltage decreases.)