About LeviLab

This laboratory considers system modelling and control as it applies to a levitating magnetic mass.

Here you will find resources on how you can set up a levitating magnet and you may start by watching the video tutorial below. After watching the tutorial, you may proceed on to the lab sheets to explore further and write the control codes and set the parameters to make the magnet levitate.

Levilab Video Tutorial

In this video tutorial, we'll be going through the entire laboratory on how you can levitate a magnet.

Construction Procedure

The following setup is to be achieved. This guide will step you through the process of constructing the maglev system. Make sure you follow every step precisely to prevent later issues.

Step 1: Prepare Plunger

The electromagnet plunger requires wrapping of tape to stop it from slipping / falling from the electromagnet. Wrap one turn of tape around the plunger.

Step 2: Insert Plunger

Insert the plunger into the electromagnet. Note the direction of insertion. Make sure it is a snug fit such that it is difficult for the plunger to slip.

Your setup should now look similar to the following:

Step 3: Add (Electrical) Tape to Insulate the Hall-Effect Sensor from the Electromagnet

Put a piece of tape onto the top of the electromagnet as shown. This is an important step for later, as if the magnet accidentally collides with the sensor, the sensor leads will press against the plunger, causing a short circuit.

Step 4: Add Hall Effect Sensor (note the sensor direction and pin connection)

Insert the sensor, noting the direction (sensor edge + logo facing upwards). Inserting the sensor incorrectly may damage the sensor.

Remember to add tape to the top of the plunger before adding the sensor.

Step 5: Complete the solenoid sub-assembly

Place tape over the top of the sensor, holding it firmly against the electromagnet plunger as seen below.

It might help to wrap a piece of tape over the entire plunger and solenoid assembly

Step 6: Add LeviLab Magnet Shield and then Assemble the Parts

Find 4x washers and 4x bolts and place the washers on the bolts in your kit.

Then add the LeviLab Magnet Shield bracket to the side of the solenoid that is opposite to the side with the solenoid connection circuit.

Step 7: Mount the solenoid to the frame

Mount the electromagnet onto the holder as follows:

Step 8: Connect the Hall-Effect Sensor to the Arduino

Plug the three wires coming from the hall-effect sensor into the Arduino Motor Shield as seen below. The sensor requires +5v (RED) , GND (BLACK), and the analog sensor output (WHITE).

Step 9: Connect the Solenoid Actuator to the Arduino

Insert the white cables leading from the solenoid (electromagnet) into the motor shield motor terminal 2 as indicated below.

Note that the solenoid is (by default) connected to the top or left pair. If you connect it to the righ, you’ll have to update the software in several places.

Then connect the external power supply to the board and remember to set the power source selection jumpers (PWRIN) to the left (or the side using PWRIN).

Your setup should now look like the following:

Step 10: Let’s Connect to PC and Let’s Start Exploring!

Begin coding and start levitating things!

Common Errors

Here you will find some of the common errors to avoid

1. Inserting the Plunger

2. Adding the Hall-effect Sensor
3. Connect the Solenoid Actuator to the Arduino
4. Connect the Hall-Effect Sensor to the Arduino