there is 24VDC connected to 1L and 2L, must I remove the transistors?
If your relay coils are rated for 24 volts DC, then you do not need the switching transistors. 24 volts applied directly to the external relay coils will cause the relays to switch their contacts. If you are using the transistors to switch 5 VDC to the relay coils, then your Base voltage must be 0 or grounded when the transistors are OFF, and full Vcc voltage when they are ON.
If your relays are rated for 5 volts DC, then you must make sure that that is all that is applied to the coils. To use NPN transistors as switches, I think the Base-to-Emitter voltage has to be greater than about 0.7. You must end up with +5 one one coil leg, and -5 on the other coil leg. Here are the requirements to set up a NPN transistor to conduct as a switch:
• The input and Base are connected to Vcc
• Base-Emitter voltage VBE > 0.7v
• Base-Emitter junction is forward biased
• Base-Collector junction is forward biased
• Transistor is “fully-ON” ( saturation region )
• Max Collector current flows ( IC = Vcc/RL )
• VCE = 0 ( ideal saturation )• VOUT = VCE = ”0″
• Transistor operates as a “closed switch”
In your case, I think that Vcc should be about 5 volts DC, not 24 volts DC.
For a 24 volt Vcc, and ASSUMING that your relays need about 2 Amps to energize and your transisitors have a typical Beta of 200, then:
Current through Base = IB = Ic/B = 2/200 = 0.01 Amps
Resistor at Base = (Vcc-0.7)/IB = 23.3/0.01 = 2330 Ohms = 2.33 kOhms, not 330 Ohms.