Create a Magical Floating Lamp with Arduino

To learn embedded systems, follow @I want to learn embedded systems,the station for embedded enthusiasts.

01

Introduction
Today, I will introduce a project that is a magical floating lamp made with Arduino by a beginner designer from abroad!

This is a 3D printing project suitable for beginners.

Create a Magical Floating Lamp with Arduino

Create a Magical Floating Lamp with Arduino

02

Materials Preparation
Create a Magical Floating Lamp with Arduino

2.1 Materials

  • 3D model (see attachment at the end)
  • PLA material
  • LED light (WS2812 60led/m)
  • Magnet diameter (12.7mm) height (5mm) x 2
  • Small magnet (5mm x 3mm)
  • Magnetic switch (or reed switch)
  • Arduino Nano
  • 5v plug and power adapter
  • Silicone wire (the softer, the better)

2.2 Tools

  • Soldering iron
  • Glue
  • 3D printer
  • Screwdriver

03

Making Tutorial

Step 1: Prepare 3D Printed Parts

Create a Magical Floating Lamp with Arduino
Create a Magical Floating Lamp with Arduino

The 3D printing files for the lamp can be found at the end.

Create a Magical Floating Lamp with Arduino

General printing settings:

  • Fill 20-100%
  • No support needed

LED bracket settings:

  • Fill 100%

Why 100%? Because it allows the light to diffuse better!

Step 2: Make the LED Light

Create a Magical Floating Lamp with Arduino

We need 3 wires from the LED to the lamp base.

This step is the most difficult part of the entire process.

Preparation/Materials

  • Cut 3 wires, each 130mm long (leave some extra for trial and error)
  • Cut an appropriately sized LED strip.

Steps

First, solder all wires to the LED strip.

Create a Magical Floating Lamp with Arduino

It’s best to mark the ends of the wires so that we won’t confuse them when connecting to the Arduino.

Feed all wires through the small hole in the lamp casing.

Create a Magical Floating Lamp with Arduino

Apply some glue to the LED strip and place it (with tweezers) inside the lamp casing (Diffusion body).

Create a Magical Floating Lamp with Arduino

Braid the wires together for a more aesthetic look.

Place a magnet on the printed part “Diffusion Top”.

Create a Magical Floating Lamp with Arduino
Create a Magical Floating Lamp with Arduino

It should look like this when finished.

Create a Magical Floating Lamp with Arduino

Step 3: Prepare the Power Supply

Create a Magical Floating Lamp with Arduino

You can also choose to use batteries or a power bank.

Preparation/Materials

  • Hot melt glue
  • Power socket connector (female)
  • 3D printed part (Lamp Underside)
  • Red and black wires

Steps

1. Glue the power socket connector to the opening of the lamp base;

2. Connect the red and black wires to the connector, which we will solder to the Arduino later.

Step 4: Make the Magnetic Switch

Create a Magical Floating Lamp with Arduino

This step is optional. You can also choose to simply unplug the connector and place a magnet on the base, depending on the availability of the parts.

Preparation/Materials

  • Magnetic switch
  • Small magnet
  • 3 wires
  • Magnet/switch base
  • Soldering iron
  • Pliers

Steps

  • Use pliers to remove the white part from the magnetic switch.
  • Solder 3 wires to SIG, VCC, and GND.
  • Glue the magnet to the round side of the magnet/switch base and slide the switch into place. (Note, we need to test that the switch is not triggered by the small magnet. If it is triggered, the system will not work, and we will test this in the programming step.)
Create a Magical Floating Lamp with Arduino

Place the magnet/switch base in a suitable position on the bottom of the lamp, so that when we place the lamp on the base, we want the lamp to turn off. Test this by placing the LED lamp strip with the magnet on the other side of the base.

Step 5: Solder the Arduino

Create a Magical Floating Lamp with Arduino

Preparation/Materials

  • Soldering iron
  • Parts from the previous steps
  • Arduino Nano
Create a Magical Floating Lamp with Arduino

Steps

1. Connect 2 wires to our 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.

Step 6: Programming

This step is very simple. If you are using the same components as mentioned in the article, you can refer to the code below.

Preparation/Materials

  • Computer
  • Arduino
  • Micro USB cable

Steps

1. Download Arduino IDE;

2. Install FastLed[1] library (depending on the LED you are using);

3. Magnetic switch code[2];

4. Run the code;

5. Check if our magnetic switch is triggered. Adjust accordingly by sliding it back or forth.

Create a Magical Floating Lamp with Arduino

Alright, the project is complete! A magnetic levitating lamp full of artistic sense is done!

▼ View the video demonstration

Click to read👆

04

Final Thoughts

The relevant 3D printing files mentioned in the article can be downloaded from the following site:

https://www.instructables.com/Magnetic-Levitating-Lamp/

You can also directly click to read the original text to jump

References

[1]

FastLed: https://www.arduino.cc/reference/en/libraries/fastled/

[2]

Code: https://wiki.seeedstudio.com/Grove-Magnetic_Switch/

Original link: https://www.instructables.com/Magnetic-Levitating-Lamp/
Original author: tomouwerkerkerk
Translation first published: DF Maker Community
Please indicate the source when reprinting

-END-

Recommended past articles: click the image to jump to read
Create a Magical Floating Lamp with Arduino

Linux commands, is it useless to learn? Yes!

Create a Magical Floating Lamp with Arduino

Garbage, do I still need to write assembly for microcontroller programming?

Create a Magical Floating Lamp with Arduino

There are actually universities that teach C language in the first year?

Create a Magical Floating Lamp with Arduino

At 30 years old, should I still go for a master’s degree?

I am Zhang Qiaolong, a university teacher teaching electronics, welcome to follow!

Leave a Comment

Your email address will not be published. Required fields are marked *