good afternoon i bulid a circuit to convert 220v ac to 12v dc so i can power a 12v dc relay. once i attach the output to the relay the voltage drop to 2v once i disconnect it and attach the positive 12v to the relay it work but then i have the disconnect it again if i want to powr it again.
Although your circuit may produce 12 V for your relay in principle, I suspect that the impedance of your R-C network is too high at your load current. I have no calculations to back that up, though.
The issue that I see is danger, in the case of a component failure. In your circuit, a diode failing to short-circuit could put mains onto your low-voltage relay and risk a fire. Unless it is critical to your application to save space or parts cost, I would strongly recommend using a step-down mains transformer and bridge rectifier instead.
As a component, the reliability of a transformer will be extremely high and it will ensure that your load circuit cannot receive a dangerously high voltage. Otherwise you are avoiding a fire or similar damage only if every component works well for the lifetime of the circuit. The cost savings will look very unimportant in that light.
As I imagine you know, electronics and circuit design are only a part of engineering. Electrical safety and reliability are just as important, as are cost, environmental safety, suitability for test, suitability for servicing and a good few more.
I have designed equipment for approval to worldwide electrical standards, and before CE marking made it much easier. We used to export my designs of office equipment into 45 countries. To meet many of these approvals, our mains circuitry (PSUs, cabling) had to stay safe and protected under Single Point Of Failure (SPOF) conditions. This means that an engineer from an approving body would visit and open-circuit any single PSU/mains component or solder a short-circuit across it. The equipment would be switched on and operated and was required to not suffer a fire or present any safety hazard to the user.
In that environment, designing mains circuitry with SPOF protection becomes a lifelong discipline that you always follow. Unfortunately, your circuit is far from safe under such testing. I hope this information helps.
I think the coupling C is too small, or the resistance is too high. simple calculation. R1 + R2. If R1 is too big, most voltage will be on R1.