I've got a basic setup which allows me to control 230V AC by switching a solid state relay on/off.
I'm using a Raspberry Pi's GPIO output pin and a general-purpose NPN transistor (BC547B) to allow a current to flow through the relay, here's my schematic:
Resistor R1 allows me to limit the current flowing through the SSR (The SSR accepts 4-32V, max 15mA). Assuming the transistor has a 150x voltage gain, this should be about 10mA. (Is this right?)
Resistor R2 acts as a pulldown resistor so that the transistor stays closed when the GPIO pin is turned off/disconnected. However, I don't know what value to choose for this resistor.
After some research I found out that the resistor's value should be between 10kOhm and 100kOhm but does it have to be greater than R1? If so, what happens if the resistance is too great?
So my question is: Does R1's value make any sense and if so, does R2's value depend on it?
Here's a link to the SSR datasheet (The LED-indicated, random-on 240VAC relay).