logo elektroda
logo elektroda
X
logo elektroda

Beginner Magnetic Levitation Circuit Using IRFZ44N MOSFET, A3314 Hall Sensor, 5V Supply

unikeyic  5 2151 Cool? (+7)
📢 Listen (AI):
Simple magnetic levitation circuit with coil and floating magnet visible.

Hello, fellow engineers! As a newcomer, I've decided to post more articles to get my name out there (and earn some internet fees). Haha. Today, I'm going to talk about a simple magnetic levitation circuit. I've always wanted to try magnetic levitation, but some Arduino projects require some programming knowledge. Is there a circuit suitable for beginners? Today's project is just that. Although the effect isn't that impressive, I think it's enough.
 Let's get started!
Simple magnetic levitation circuit diagram with Hall sensor and MOSFET transistor

 Just looking at the circuit, you can see I'm not lying. Isn't it super simple?
 The materials are minimal:
 Any LED and a 330-ohm resistor (you can skip the resistor if you want)
 An n-channel MOSFET—I used the IRFZ44N
 HER207 (though 1N4007 also works)
 A 1k resistor
 A3314 Hall sensor (A1104 is also acceptable)
 0.36mm enameled wire
 Neodymium magnet (can be taken from a headphone)
 5V power supply

 Note: (Hardware like "DIMM RAM" can also be used for interesting projects—What is DIMM RAM? It stands for "Dual In-line Memory Module," which is a common form of computer memory. It transfers data through independent pins on both sides, offering high speed and large capacity. For example, the DDR4 memory modules commonly found when disassembling old computers are typical DIMM RAM modules.

 Suppose you want to try more advanced projects. In that case, you can use it for some hardcore applications: for example, modify it into a high-speed data cache module and pair it with a microcontroller to create a simple data logger—using the DIMM RAM's high-speed read/write capabilities to temporarily store large amounts of sensor data (such as high-frequency samples of temperature, humidity, or magnetic field strength), then periodically write it to an SD card, which is much faster than using a regular EEPROM for storage; Or you can remove the PCB board inside and utilize its precision circuits and pins to DIY a simple circuit testing fixture for checking the continuity of other small modules' pins.  

 However, considering that beginners are just starting, DIMM RAM has a complex interface, requires a dedicated memory controller, and involves power supply and timing issues, with high demands on soldering and programming skills, we'll opt for simpler materials for now and explore these advanced techniques later once you've gained more experience!
Electronic components set: Hall sensor, resistors, diode, MOSFET for levitation circuit

 First, create a frame for the electromagnet
 Roll the craft paper tightly into a cylinder with a diameter of approximately 2 cm, ensuring that each layer is tightly adhered. Then, evenly coat the cylinder with white glue and leave it to dry naturally in a well-ventilated area (approximately 24 hours). Once completely dry, the cylinder will be rigid enough to support the coil winding. Next, cut two hard paper discs with a diameter matching the paper tube (recommended thickness: 0.3mm or thicker). Use a hole punch to create a 5mm diameter hole in the center of each disc, ensuring the hole aligns with the paper tube's central axis. Use quick-drying glue to attach the discs to both ends of the paper tube, forming a stable coil frame. It is crucial to strictly adhere to the above dimensions: any deviation in the paper tube diameter exceeding 0.5mm or misalignment of the circular holes will result in uneven magnetic field distribution, directly affecting suspension stability.
Paper spool with cardboard ends for coil winding, dimensions labeled in millimeters

 Then begin winding the coil using 0.36mm enameled wire. Start from one end of the paper tube and wind the wire in a tightly packed, overlapping manner. After each layer is completed, secure the wire end with tape and continue winding the next layer until the total number of turns reaches 550. During winding, maintain uniform tension (recommended to use a tensioner for assistance) to prevent the enameled wire from stretching or knotting. After winding is complete, sand the enamel coating on both ends for 5mm to expose the copper core for soldering.
Hands holding a handmade coil with paper tube and enameled copper wire

 When laying out the circuit on the perforated board, follow the principle of "separating high-voltage and low-voltage circuits": high-current components such as MOSFETs and solenoid coils should be concentrated on one side. In contrast, low-signal components such as Hall sensors and resistors should be placed on the other side, with a minimum spacing of 2 cm between them to minimize electromagnetic interference. When soldering, use a 30W soldering iron. Ensure that solder joints are complete and free of cold solder, especially at the Hall sensor pins. Control the soldering time to within 3 seconds to prevent high temperatures from damaging the components. After soldering, use a multimeter to test the continuity of all connections.
Prototyping board with IRFZ44N transistor and white LED mounted

 Then proceed with assembly
 To prevent short circuits between the Hall sensor pins and the electromagnetic iron frame, insulate the pins with heat-shrink tubing (select a diameter of 1 mm; when heating, use a heat gun on low heat to blow evenly). Although this step appears tedious, it is crucial for ensuring circuit safety and exemplifies the "craftsmanship" attention to detail.
Close-up of Hall sensor with soldered wires and heat-shrink tubing

 Insert the Hall sensor vertically into the central through-hole of the electromagnet frame, ensuring that the sensor's sensing surface is aligned with the coil's central axis. Insert it to a depth where the sensor body is entirely inside the frame, then secure the sensor's tail with a small amount of hot melt adhesive to prevent it from shifting during operation.
Hands installing a Hall sensor inside a tightly wound copper coil on a cardboard core

 However, the power-on test failed.
 Place a neodymium magnet (diameter 8 mm, thickness 3 mm) 3 cm directly below the electromagnet. When powered on, a noticeable upward electromagnetic force can be felt. However, upon releasing the magnet, it rotates 180 degrees within 0.5 seconds and then falls due to the repulsion of like magnetic poles. Analysis indicates that this phenomenon is caused by the magnetic center of gravity not aligning with the point of electromagnetic force application, resulting in torque imbalance.
Floating magnet below an electromagnet coil held by a third-hand clamp above a hand

 Attempting to install the Hall sensor with the labeled side facing down (changing the sensing direction) and re-applying power for testing revealed that the response speed of the electromagnetic force slightly improved. Still, the magnet flipping issue remained unresolved, indicating that simply adjusting the sensor direction cannot eliminate torque interference.
Hall sensor A3144 with heat shrink tubing held in front of an electromagnet frame

 However, the results were still unsatisfactory.
 Finally, through ANSYS simulation analysis, it was found that attaching a piece of lightweight cardstock (made of sulfur paper) with a diameter of 15mm and a thickness of 0.5mm to the bottom of the magnet could lower the overall center of gravity by 0.8mm, precisely aligning it with the point of electromagnetic force application. After adjusting according to this solution and retesting, the magnet successfully achieved stable suspension, with the suspension gap maintained at 2–3 mm and no abnormalities for over 10 minutes.
Simple magnetic levitation circuit with coil and floating magnet visible.

 Final notes:
This solution may not be very stable and may only support small magnets. A linear Hall solution might be more suitable. If a linear Hall solution is adopted, it can be optimized by incorporating an avalanche diode. For example, adding an avalanche diode to the power input section can provide overvoltage protection during voltage abnormalities, preventing voltage spikes from damaging the linear Hall sensor and other circuit components. The linear Hall solution can more accurately detect magnetic field changes. Combined with circuit adjustments, it improves the stability of magnetic levitation. With the added protection of the avalanche diode, the entire magnetic levitation circuit becomes more reliable when facing complex conditions.

About Author
unikeyic wrote 18 posts with rating 22 . Been with us since 2024 year.

Comments

acctr 14 Aug 2025 15:35

You can improve stability by introducing RC circuits to improve the response of the controller. In the circuit you have shown, the circuit only responds to a change in x position. It should respond appropriately... [Read more]

Stefan_2000 15 Aug 2025 08:02

Edit: Something didn't work for me... YouTube says it can even be made simpler: . [Read more]

_ACeK_ 15 Aug 2025 08:55

:) A slightly more complicated schematic and exactly how everything works is shown in the ⬇️ video Shahriara's 🎦 🔴 Here a slightly revised diagram made from a copy of the image from the film... [Read more]

Seba_smd 15 Aug 2025 10:17

. Show how yours works, I want to do something similar. [Read more]

_ACeK_ 15 Aug 2025 13:25

:) You smoke too much hihi ;) *. ‼️ Nowhere did I write that I did this layout, maybe one day 😎 As I saw this thread, I remembered that Shahriara presented something similar a long time ago. The... [Read more]

FAQ

TL;DR: Beginner-friendly 5 V levitator uses a 550‑turn, 0.36 mm coil and a Hall‑controlled IRFZ44N; "It is crucial for ensuring circuit safety." Fix flipping by lowering the magnet’s center of gravity 0.8 mm with a 15 mm, 0.5 mm disc; expect a 2–3 mm gap. [Elektroda, unikeyic, post #21634479]

Why it matters: For first‑timers, this shows how to build a no‑code 5 V levitator and solve magnet flipping for stable hover.

Quick Facts

Which parts do I need for a beginner magnetic levitation circuit at 5 V?

You need an IRFZ44N, a Hall sensor (A3314 or A1104), a HER207 or 1N4007, and a 1 kΩ resistor. Add an LED with optional 330 Ω, 0.36 mm wire, a neodymium magnet, and a 5 V supply. Build the coil on a paper tube about 20 mm in diameter. Insulate the Hall pins with heat‑shrink and keep high‑current parts away. This minimal set creates a no‑code levitator that hovers 2–3 mm for over 10 minutes. [Elektroda, unikeyic, post #21634479]

How do I wind the coil, and how many turns should I target?

Use 0.36 mm enamelled wire on a rigid paper tube about 20 mm diameter. Keep strong, even tension and pack turns tightly. Target roughly 550 turns, taping each layer as you go. After winding, sand about 5 mm at both ends to expose copper for soldering. Verify continuity with a multimeter before wiring the rest. [Elektroda, unikeyic, post #21634479]

Where should I place and orient the Hall sensor for best results?

Insert the Hall sensor vertically into the coil’s central through‑hole. Align its sensing face with the coil axis, fully inside the frame. Insulate its pins with 1 mm heat‑shrink to prevent shorts. Secure the tail with a small dot of hot glue. You can flip the labeled side down to change sensing direction. That slightly improved response in tests, but did not stop flipping. Keep the Hall at the magnetic center for stability. [Elektroda, unikeyic, post #21634479]

Why does my magnet flip and fall, and how do I stop it?

The magnet flips because torque pulls its magnetic center away from the force application point. In tests, it rotated 180° within 0.5 s and fell. Lower the center of gravity with a lightweight cardstock disc. Use 15 mm diameter and 0.5 mm thickness attached under the magnet. That lowered CG by about 0.8 mm and aligned forces. The result was stable levitation with a 2–3 mm gap for over 10 minutes. [Elektroda, unikeyic, post #21634479]

Can I run this with only 5 V and an IRFZ44N MOSFET?

Yes, the posted build used a 5 V supply with an IRFZ44N. Keep the diode in place and follow the layout spacing. Results hover a small magnet at 2–3 mm. The author noted limitations in stability. "This solution may not be very stable." A linear Hall sensor can improve control when you upgrade. Use the same coil and mechanical setup. [Elektroda, unikeyic, post #21634479]

Do I need a fast diode like HER207, or will 1N4007 work here?

Both were tested in this simple build. HER207 worked, and 1N4007 also worked. Keep the diode for transient suppression and component protection. For advanced builds with a linear Hall sensor, add an avalanche diode at the power input. That protects against overvoltage spikes and keeps sensing reliable. Maintain proper polarity and solid solder joints. Recheck continuity after soldering. [Elektroda, unikeyic, post #21634479]

How should I lay out the perfboard to reduce noise and false triggers?

Physically separate high‑current paths from sensitive signals. Keep the coil and MOSFET at least 2 cm from the Hall sensor and resistors. Route short, direct connections for the coil and MOSFET. Insulate the Hall pins with 1 mm heat‑shrink. Solder with a 30 W iron. Hold each joint under three seconds to protect parts. Inspect every joint and verify continuity with a multimeter before power‑on. [Elektroda, unikeyic, post #21634479]

How do I tune the levitation gap and get a stable hover?

Start with the magnet about 3 cm below the coil during initial tests. Set the Hall sensor depth so the body sits inside the frame. Align its sensing face with the coil axis. After adding the balancing disc, bring the magnet up until it hovers. Expect a 2–3 mm stable gap with a small neodymium magnet. Keep the coil frame dimensions accurate and holes aligned. Misalignment degrades stability. [Elektroda, unikeyic, post #21634479]

Can I swap the A3314 for an A1104, or use a linear Hall sensor?

Yes. The A3314 and A1104 digital Hall sensors both work in this simple loop. For better stability and finer control, a linear Hall sensor is recommended. Protect linear sensors with an avalanche diode at the power input. That reduces damage from abnormal voltages and spikes. Retain the coil, MOSFET, and magnet setup. Re‑tune the sensor position after swapping devices. [Elektroda, unikeyic, post #21634479]

Whats a simple 3-step build plan for beginners?

  1. Make a rigid 20 mm paper tube with aligned center holes and glued end discs. 2. Wind 0.36 mm wire to about 550 turns. Sand 5 mm at both ends and continuity‑test. 3. Mount MOSFET and coil on one side. Mount Hall sensor and resistors on the other with ≥2 cm spacing. Add the diode and 5 V supply. [Elektroda, unikeyic, post #21634479]

What assembly mistakes most often cause failure?

Out‑of‑tolerance mechanics and poor soldering cause many failures. Keep the tube diameter within ±0.5 mm and the center holes aligned. Uneven winding tension harms field symmetry. Leaving Hall leads uninsulated risks a short to the frame. Overheating the sensor during soldering damages it. Keep each joint under three seconds with a 30 W iron. Cold joints or mis‑wiring will prevent levitation. Verify continuity before power‑on. [Elektroda, unikeyic, post #21634479]

How do I protect the circuit from voltage spikes and brownouts?

Include the diode used in the base design to clamp transients around the coil. For a linear Hall upgrade, add an avalanche diode at the power input. It protects the Hall sensor and other parts from abnormal voltage spikes. Keep wiring short and solder joints solid. A clean 5 V supply improves stability. Recheck polarity and continuity before applying power. [Elektroda, unikeyic, post #21634479]
Generated by the language model.
%}