hello, my question is that can DC/AC adapter from 220 to 12 volt be used with pic this way? can the grounds be connected with each other? isn't any danger for adapter generaing different "ground voltage"? I mean, adapter can generate 5v on ground and 5+12=17v on positive edge? I hope you got the point. anyway, is this circuit correct? (I supply PIC from USB and have USB ground connected with adapter ground)
In the schematic the transformer is being supplied with a DC voltage. That is wrong!
The transformer primary (mains voltage) winding should be supplied with AC and the secondary (low voltage) winding should supply the bridge rectifier. The other components should be connected to the rectifier DC output.
no .transformer is being supplied with a DC voltage. its controlled with 1 switching devise (transister or mosfet or igbt etc ) . controlling signal come form pic mcu...
If I understand you correctly you are proposing to use a transformer from an AC/DC adapter as the basis for an SMPS power supply, with primary current being switched under the control of a PIC.
I think such a transformer is totally unsuitable for this project, unfortunately. It has a much higher inductance than the inductors generally used in SMPS supplies and its iron core losses will be too great at the high switching frequencies conventionally used.
If you are asking what is the best inductor to use for an SMPS the answer is 'it all depends on what output voltage and current the supply has to provide and what the switching frequency is'.
Try Googling for guidance on SMPS construction.