I want to know how an AC electric magnet works since the polarity of an AC current changing 100 times in each second (for 50Hz mains supply) so its magnet polarity(N & S) also will changed 100 times in each second. But i see AC solenoid always moved in one direction when the power is connected, why?
Electronic – How an AC electric magnet works
acmagnetsolenoid
Related Solutions
This isn't a direct answer but is pointing out a alternative.
You don't necessarily need a double ended drive like a H bridge. That would certainly work, but a push/pull driver with a capacitor in series with the relay coil would do it too. Here is a possibility to think about:
In the steady state, the capacitor charges up to whatever the drive level is at the left side of the relay coil. It then provides the opposite polarity for the right end for a while immediately after the left end is switched. 22 µF will charge up to only 1.4V after 300 mA for 100 µs. 22 µF and 16 V can be had from a 1206 ceramic capacitor, like this one from Mouser. The cap can be polarized since the top side will always be at or above the bottom side.
The double emitter follower can be driven directly by a CMOS logic gate. There are some that can handle this voltage. The input to that could be driven by a open collector with pullup. Since the CMOS logic input is high impedance and you don't need really fast switching, the pullup can be quite high. 100 kΩ should be low enough to work well, but high enough that the quiescent current in the low state is small.
Of course you could replace the transistors with a half bridge drive chip that takes logical level input for higher integration, but also likely higher cost.
Added:
You are asking about driving this from a single open drain output. As I said above, I'd use a CMOS gate that can run from 15V. The high impedance of the CMOS gate input allows for a high value pullup resistor, as I mentioned previously. Here is this concept shown explicitly:
Q3 is a switch. When off, R1 pulls the input of IC1A high for one relay state. When Q3 is on, the input to IC1A will be low for the other relay state. Q3 could instead be the output transistor in the driver chip you mentioned. However, it only takes one NPN and one resistor to replace each channel of that chip. The left side of R2 can be directly driven by your microcontroller output. The driver chip could be less board space, but the NPN and resistor will be cheaper. The whole circuit from the micro up to C1 could be replaced by a half bridge driver chip, which again will be more cost but maybe less board space. Everything is a tradeoff.
I also flipped the relay coil and C1. Since these are in series, it doesn't matter to the operation of the circuit. However, it may be convenient to tie one end of all the relay coils to ground. This second circuit allows you to do that.
Just because you didn't get your particular solenoid working with whatever AC voltage and frequency and waveshape you applied, but did get it working with DC, again with unspecified voltage, is little proof of anything.
Solenoid coils are inductors, but also have significant effective series resistance. In any case, the magnetic field strength is proportional to the current thru the solenoid. When driving a solenoid with a fixed voltage, its impedance must therefore be taken into account. In the case of DC, in the steady state the inductive part of the impedance doesn't matter and the current is simply the applied voltage divided by the real part of the coil's impedance (the resistance). Many solenoids are specified to be used in exactly that way.
Some solenoids can be driven by AC. There are two issues with that. First, AC causes the magnetic field to flip twice per cycle. If the solenoid is driving something with fixed magnetism, that's not going to work. However, most solenoids simply employ magnetic material in the plunger without any permanent magnetism. In that case, the average of the absolute value of the magnetic field matters. Since the current is the voltage divided by the coil impedance, and in this case the inductive part of the impedance must be taken into account, a solenoid will require a higher AC voltage to generate the same force as a DC voltage.
In either case, there is a maximum voltage spec for every solenoid. This limit is generally due to internal heating. The resistive part of the impedance dissipates power proportional to the square of the current. At some point this is more heat than the coil can dissipate without getting too hot somewhere. The manufacturers will tell you what the voltage and current limits are, usually both for AC and DC cases. All you have to do is follow them.
Best Answer
A solenoid core isn't a magnet itself but instead a simple iron piece. Such an iron piece "gathers" the magnetic field lines which come from the coil. When the iron core is not centered inside the coil, the magnetic field lines are longer than they could be, which results in a force to change that.
a) coil without core → field lines long and wide. High magnetic resistance.
b) core not entirely in the coil → field lines shorter and "gathered" into the core as the magnetic resistance is lower there.
c) core centered in in the coil → field lines shortest and a bigger part of it running in the core so magnetic resistance is even lower than in b)
That's the reason why the core is moved into the coil. Because when it's centered inside the coil, the field lines are shorter and magnetic resistance is much lower. As this doesn't depend on field direction, an iron core is always moved into the coil, making it work with both AC and DC applied to the coil.