I have made a circuit using Ic 4017 and it worked but when i connect the output (about 4.2v) to 3v relay the relay didn't work so what is the solution????
note that relays require certain power to work. in general low coil voltage means large current. depending which of the three 3V relays you have, coil current can be up to 150mA. also note that since transistor is used as switch, gain is lower. in general this means only gain of 10 or so. therefore you will want to reduce R1 value from 3.3K to something smaller because:
if your 4017 is also powered from 3V and it's output is close to 3V, you will have at best base current of
Ib= (3V-0.7V)/R1 = 0.8mA
to get 150mA, you would need gain 150/0.8 = 187.5 which is huge for switching application.
assuming we get 6mA from 4017 that resistor would need to be
R=V/I = (3-0.7)/0.006 = 390 Ohm (rounded to common resistor value)
in this case you still need gain of 25 if your relay coil is 0.45W.
if the relay coil is 0.2W, you only need gain of 11.
if you are using standard LED (poor efficiency), you will need R3 of about 33 Ohm.