Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

MAKER: tomouwerkerkerk/Translated by: 趣无

This is a compact and warm floating desktop atmosphere lamp, with color-changing dim light adding a gentle ambiance to the room.

It is constructed based on Arduino and 3D printed components, and is very simple to assemble. Beginners who are interested can give it a try.

Video Demonstration:

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Materials List

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Arduino Nano x 1, PLA material x several, LED strip (WS2812 60led/m) x several, 12.7mm x 5mm magnets x 25mm x 3mm magnets x 2, magnetic switch x 1, 15v plug x 1, 15v power adapter x 1, silicone wire x several, soldering iron x 1, glue x 1, 3D printer x 1, screwdriver x 1.

3D Printed Parts

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

General Part Printing Settings

Infill 20-100%, no support required.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

LED Bracket Settings

Infill 100%, 100% infill allows for better light diffusion!

3D printed files can be downloaded at the end of the article

Making the LED Lamp

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Three wires need to pass from the LED to the lamp base. This is the most difficult part of the entire production process.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

1. Cut three wires, each 130mm long (it’s good to leave extra length just in case), and cut a suitable length of LED strip.

2. Solder all wires to the LED strip. Mark the ends of the wires so that they won’t be confused when connecting to the Arduino.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

3. Insert all wires into the small hole in the lamp casing.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

4. Apply glue to the LED strip, then place it inside the main body of the lamp. You can braid the wires for a more aesthetically pleasing look.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

5. Place a magnet on the upper part of the main body.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Preparing the Power Supply

You can choose either batteries or a power bank for the power supply. As shown in the picture, I chose USB plug charging.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

1. Stick the power socket connector to the round hole at the bottom of the lamp.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

2. Connect the red and black wires to the connector and bring them out; they will be soldered to the Arduino.

Making the Magnetic Switch (Optional)

This step is optional. You can choose to simply unplug it and place a magnet on the base.

1. Use pliers to remove the white part from the magnetic switch.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

2. Solder three wires to SIG, VCC, and GND.

3. Stick the magnet to the circular side of the magnet/switch base and slide the switch into place. Note that we need to test whether the switch is not triggered by a small magnet. If it is triggered, the system will not work, which will be tested later in the programming step.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

4. Place the magnet/switch base in the appropriate position at the bottom of the lamp. When placing the lamp on the base, the light should turn off normally. We can place the LED strip with the magnet on the other side of the base to test.

Soldering Arduino

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

1. Connect two wires to VIN and GND of the power socket.

2. Solder the LED strip’s wire to GND, V5, and a digital port (D1-D12).

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

3. Solder the magnetic switch wire to GND, V5, and a digital port.

Programming

This step is very simple. If the components used are the same as those in the article, the code file can be downloaded at the end of the article:

1. Download Arduino IDE.

2. Install the FastLed library (depending on the LED you are using): https://www.arduino.cc/reference/en/libraries/fastled/

3. Magnetic switch code: https://wiki.seeedstudio.com/Grove-Magnetic_Switch/

4. Run the code.

5. Check whether the magnetic switch is triggered. Adjust it accordingly by sliding it back or forth.

Programmable 3D Printed Magnetic Levitating Desktop Lamp (Arduino + WS2812)

Now, the entire project is completed, and this warm and lovely magnetic levitating lamp is finished!

via instructables.com/Magnetic-Levitating-Lamp/

Leave a Comment