How come my relays C and D do not turn on?
I read your design and found everything looking good. I will later look at the datasheets you referred and see if there are other complications.
But first thing first, I would suggest a couple troubleshooting tricks as summarized below.
Part A - Troubleshooting suggestions
(1) Preparation for offline testing.
(a) Remove the 120VAC 1.5A load and put it aside. The reason is that when the relay switch is on, you should hear a click sound, and another click sound when switch is off.
In other words, there is no need to use the high voltage, heavy current load, especially if it is a big motor which generates EMI spikes and noises. If you like, you can use a LED in series with a 1k as the load and status indicator.
(b) Have you multi-meter ready to measure voltage in a range less than 5V.
(c) It would be nice if you have a NE555 timer module and set it to very roughly to 5Hz (Note 1) , 50% duty cycle to be used as input signal at T1. But this is not at all necessary. You can just use a jumper wire and by hand connect T1 to 0V (Ground) and 3V.
Note 1 - relay switch max frequency is roughly 10Hz, ie, it cannot toggle more than 10 times a second.
Part B - Relay design notes
Please see Appendices below for detailed analysis and design.
(1) TCMT1600, TCMT4600, TCMT4606 Optocoupler, Phototransistor Output, AC Input,
Single/Quad Channel (If abs max 60mA, opr 50mA, CTR (Ic/If) @Vcc 5V, If 5mA = 80% min)) - Vishay Semi 2015jul21
(2) MMBT3904 40V NPN Small Signal Transistor (Ic abs max 200mA) - Diodes
(3) 1N4148WS General Purpost (If 300mA cont)Fast Switching Diode - SMC
(4) SRD 03/05/06/09/12/24/48VDC Relay Datasheet - Songle
(5) How to use a JD-Vcc Relay? - tlfong01, EE SE 2020jun13
(6) Transistor as a Switch - Electronics Tutorials
(7) 2N3904 General Purpose Transistors NPN BJT Silicon (40V, 200mA, Vce(sat) 0.2V max @ 10mA, hFE = 100 min, 300 max @ 10mA) - On Semi
Appendix A - Relay, Optocoupler Sample Specifications
Appendix C - The OP's design with additional status LEDs
Appendix D - Analysis of the OP's relay switch driver part of design (ie, without the front optoisolated input section)
Appendix E - 2N3904 NPN BJT Datasheet Reading Make Simple Part 1 of 2
Appendix F - 2N3904 NPN BJT Datasheet Reading Make Simple Part 2 of 2
Newbies often found semiconductor devices datasheets difficult to understand. There are many reasons, including the following.
Take the simplest semiconductor device the diode as an example. Let me first explain what is meant by linearity. If the relation of two variables, say independent variable x and dependent variable y, and
y = 3x.
Then we say the relation between y and x is linear. For linear relationship y = kx, the plot of y vs x is straight line with gradient k.
Now if y = x², or y = x³ etc, then we say z and z has a non-linear relationship, and the plot of y against x is a curve.
The 2N3904 can be over simplified as two diodes glued together, and the current I vs voltage V relationship is also non-liner as shown below:
Ideal diode equation - Libretests
(2）Now that we know what is the meaning of non linearity using the diode I-V equation. Let us use another example, 2N3904 hFE vs Ic, 25C as another example, the left of the following graph:
In real life, things are a little more complicated: If temperature rises, say to +125C, the hFE vs Ic curve is shifted a little bit upwards, and downwards for -55C.
So we see that if we superimpose three hFE vs Ic curves (pink, green, blue) on the same graph, we have a dependent variable hFE vs two independent variables Ic and temperature.
Similarly, the 2N3904 datasheet has other graphs of one dependent variable vs two independent variables.
Appendix G - Calculating the biasing resistor values of the OP's relay circuit
The time has come to answer the OP's question: How to calculate the values of the biasing resistors.
Let us start with 2N3904, which is used to drive the Songle relay switch. We learnt form the experimental hysteresis chart that the relay switch starts to switch on around very roughly at 35mA and fully on around 70mA so we decide this very first
(1) 2N3904 Ice(sat) to full switch on Songle relay ~ 70 mA
(2) We read that 2N3904 Ic max = 200 mA, so it should be safe to drive the Songle relay at 70mA.
(3) Now we know that for Ic < 100mA, the hFE > 30. So if
Ic/Ib = 30 => Ib = Ic / 30 = 100mA / 30 ~= 3mA
(4) Now if we assume the optocoupler's Ice(sat) = 0.2V, then we can calculate the value of the biasing resistor Rb by the following equation:
Rb = Vrb / Ib
= （Vcc - Vce(sat) of optocoupler - Vce(sat) of 2N3904)）/ Ib
= (5V - 0.2V - 0.2V) / 3mA
= 4.6V / 3mA
= 4600 / 3
So using Rb = 1k5 should be enough drive 2N3904 to 70mA to drive Songle relay switch. However, to give some safe margin, it is OK to use smaller Rb, say 470R, 330R, or even the OP's value of 220R.
(a) This is the initial draft design. I have not proofread my always dodgy calculations.
(b) Me only a friendly hobbyist. No guarantee no nothing won't melt down or blow up.
End of answer