The invention provides an electromagnetic device, which comprises a skeleton, one side of a lower stop of the skeleton is provided with a bump, and the bump comprises a first surface and a second surface which are oppositely arranged, and a third surface which is vertically connected between the two surfaces; the at least one pair of pins comprises a first part, a second part and a third part which are vertically connected in pairs, the first part extends out of the bump through the second surface from the interior of the bump, and the second part extends out of the bump through the third surface from the interior of the bump; the coil is formed by winding a wire, the coil is wound on the cylinder and extends to the first surface of the bump, a first leading-out part of the wire is connected with the second part of one pin, and a second leading-out part of the wire is connected with the second part of the other pin. The large winding space and the small framework wall thickness can be achieved at the same time, the two lead-out parts of the wire are designed on different planes, and
cross contact of the lead-out parts of the wire can be prevented.