Reducing voltage for solid state relay
Solid state relays generally have LEDs on the input side.  Sometimes they have resistors in series with these LEDs, sometimes not.  Depending on the current requirement, you can drive the SSR input directly with the microcontroller output and a series resistor.  Ultimately LEDs run on current, and have a fairly predictable voltage accross them when doing so.  A resistor in series with a LED to allow driving it from a higher voltage is perfectly legitimate.

If the microcontroller output can't source or sink (the SSR input can be between power and the micro) enough current, then you have to use a transistor somehow anyway.  The simplest is:



You have to look in the relay datasheet to see how much voltage the LED drops, what current it is intended to be run at, and what the value of the internal resistor in series with the LED is, if any.  Then it's easy to determine the value of R1.

For example, let's say the LED requires 10 mA to operate the relay, drops 1.2 V in the process, and the internal resistor is 100 &Omega;.  The emitter of Q1 will be about 4.3 V when the digital output is high, so that leaves 4.3V - 1.2V = 3.1V for the combined resistance to drop.  3.1V / 10mA = 310 &Omega;, which is what the combined resistance should be.  100 &Omega; of that is already inside the relay, so R1 should be 210 &Omega;.  The common value of 200 &Omega; would be good, and definitely provide for the 10 mA.  SSRs usually have wide latitude in the allowed LED current.  However, don't guess, look at the datasheet.