A switching power supply includes a switching circuit, a main transformer, a rectifier circuit, and an output smoothing circuit, which are mounted on a base plate. A carrier element is attached to and positioned between the first and second contacts. Each of the plurality of magnetic storage cells includes a magnetic element and a selection transistor. The heating causes the second granules to expand and the surfaces of the second granules to melt for bonding with the first granules. The sensor chip is disposed inside the cavity. The method for preparing an MnBi-based sintered magnet includes: preparing a magnetic powder by pulverizing the MnBi-based magnetic substance; molding the magnetic powder in a state where a magnetic field is applied; and sintering the molded magnetic powder.