Command Solid State Relay using NPN transistor 2N2222
Usually you control a relay by connecting the "coil" where the resistor is in your diagram.

The transistor allows current through the coil when the command signal is on, and blocks current when the command signal is off.

Also don't forget to put a current-limiting resistor before the base of the transistor.

Like this:







simulate this circuit &ndash; Schematic created using CircuitLab

It should work the same way for an SSR.

Addendum: The reverse "freewheeling diode" D1 is not required with an SSR. However it is required when using a mechanical relay. If you are using this circuit with a mechanical relay, connect the diode in reverse-parallel with the relay coil as shown.