MAKER: tomouwerkerkerk/Translated by: 趣无尽
This is a compact and warm magnetic levitating desktop atmosphere light, with color-changing soft light adding a gentle ambiance to the room.
It is built on Arduino and 3D printed components, making it very easy to assemble. Beginners who are interested can give it a try.
Materials List
Arduino Nano x 1, PLA material x several, LED strip (WS2812 60led/m) x several, 12.7mm x 5mm magnets x 2, 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
General Part Printing Settings
Fill 20-100%, no supports needed.
LED Support Settings
Fill 100%, 100% fill will allow for better light diffusion!
The 3D printing files can be downloaded from the project repository: https://make.quwj.com/project/427
Making the LED Light
Three wires need to be threaded from the LED to the base. This is the most challenging part of the entire process.
1. Cut three wires to a length of 130mm (leave a bit extra to ensure they are long enough), and cut a suitable length of LED strip.
2. Solder all the wires to the LED strip. Mark the ends of the wires to avoid confusion when connecting them to Arduino.
3. Insert all the wires through the small hole in the lamp casing.
4. Apply glue to the LED strip and place it inside the lamp casing. You can braid the wires for a nicer appearance.
5. Place a magnet at the top of the casing.
Preparing the Power Supply
The power supply can be a battery or a power bank. As shown in the picture, I chose to charge via USB plug.
1. Glue the power socket connector to the round hole at the bottom of the lamp.
2. Connect the red and black wires to the connector and lead them out; they will be soldered to the Arduino.
Making a Magnetic Switch (Optional)
This step is optional. You can choose to unplug the plug and just place a magnet on the base.
1. Use pliers to remove the white part from the magnetic switch.
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 that the switch is not triggered by a small magnet. If it is triggered, the system will not work, and this will be tested later in the programming steps.
4. Place the magnet/switch base in a suitable position at the bottom of the lamp, so that when the lamp is placed on the base, it can turn off normally. We can test this by placing the already made LED strip with magnets on the other side of the base.
Soldering Arduino
1. Connect two wires to VIN and GND of the power socket.
2. Solder the LED strip wires to GND, V5, and a digital port (D1-D12).
3. Solder the magnetic switch wires to GND, V5, and a digital port.
Programming
This step is very simple. If the components used are the same as those in the text, the code file can be downloaded from the project repository:
https://make.quwj.com/project/427
1. Download Arduino IDE.
2. Install the FastLed library (depending on the LEDs 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 if the magnetic switch is triggered. Adjust it accordingly by sliding it back or forth.
Now, the entire project is complete, and this warm and lovely magnetic levitating lamp is done!
The code used in this project can be downloaded from the project repository: https://make.quwj.com/project/427
via instructables.com/Magnetic-Levitating-Lamp/
Click the link at the end of the article to read the original text.
More Exciting Content