Introduction: Easy Tilt-Based Color Changing Wireless Rubik’s Cube Lamp

Today we’re going to build this awesome Rubik’s Cube-esque lamp which changes color based on which side is up. The cube runs on a small LiPo battery, charged by a standard micro-usb cable, and, in my testing, has a battery life of several days.

This tutorial is a great beginner project and requires minimal tools!

I’m a relative beginner when it comes to circuits—I first picked up a soldering iron less than a month ago, and I hope this tutorials inspires other beginners to start their first circuits project. If you like this Instructable, it would make my day if you voted for it in the Remix contest!

I was inspired by Well Done Tips’ amazing Wireless LED Cube Light Instructable, but I wanted to extend it further and realized it would be super cool to have more than one color. After all, the Rubik’s cube has more than just one color—so why should there be only one light?

For a while I was stumped on the orientation detection, and thought I might have to add in a small microcontroller and accelerometer. However, since my goal was for the cube to be wireless, I knew I would need to add a battery, and since that would drain more juice than I’d like, I didn’t want to go that way.

That’s when I found lonesoulsurfer’s LED Cube light! His lamp used a mercury switch to control the light. However, I did not want to use mercury—it’s really bad for the environment—but luckily tilt switches are a great alternative.

I also wanted to make this tutorial beginner-friendly, use materials that could be easily purchased online or in a store, and limit the use of equipment (such as a table saw) that many people, including me, don’t have.

Let’s get started!

Supplies

The following supplies are needed:

  • Soldering Iron and solder
  • Drill Press and small drill bit
  • Hacksaw with fine teeth
  • Ruler
  • Sharpie
  • Hot glue gun
  • Clamp (for sawing)
  • Sandpaper
  • Respirator / n95 mask for cutting + sanding
  • Wire cutter
  • Wire stripper

Step 1: Materials

The white spray paint gives the acrylic a nice diffusing finish. However, it is unnecessary if you instead buy a white translucent acrylic such as this.


So you may have noticed that the cube is not actually built from a real Rubik’s cube, like Well Done Tips’ cube. I initially attempted to copy Well Done Tip’s build process, by cutting out the innards of a cube (r.i.p. cube) and putting pieces of acrylic in between. Unfortunately, since I don’t have the machinery that he does, I used a hacksaw to cut the super small pieces of acrylic and the cube ended up being incredibly lopsided and frankly ugly. Thus we shall sally forth with a modified design: 6 square pieces of acrylic plus replacement Rubik’s cube stickers!

P.s. You may be wondering why replacement stickers are even sold. My speedcuber friends tell me that the stickers will fall off their (expensive) cubes over time, and that replacement stickers come in handy. Who knew?

Step 2: Cut Out 6 Square Pieces of Acrylic

Using a ruler, trace six 6mm by 6mm pieces of acrylic.

Acrylic can supposedly be cut using a simple utility knife, but after multiple scores + attempts to break off the acrylic I was still left with one intact piece. As such, I went with the next best thing: a hacksaw.

(I know that a hacksaw is not the best or most accurate way to cut acrylic. However, it is the cheapest, and also the only tool that I had.)

Cut out the 6 pieces, and be sure to wear a respirator or mask while doing so—a lot of dust is generated in this process. A decent number of tutorials don’t show them wearing a mask, and as much as I love a good coating of acrylic on my lungs, the CDC says it’s not too good for me.

(Note that the surgical masks that we all wear to go outside nowadays are not sufficient to filter out acrylic dust!)

A standard Rubik’s cube has sides of approx 5.5mm. However, to ensure that more of the light comes through the cube, I gave it a few extra millimeters.

Sand down the edges if they’re super rough.

Step 3: Spray Paint Time!

Place the squares on a piece of cardboard or newspaper—something that you’re ok getting spray paint on. Hold the spray paint can about 2-3 feet away and go over the squares multiple times.

Be sure to spray paint from a good distance. If the can is too close to the squares, globs of spray paint will show up on the surface, and we don’t want that.

ONLY spray paint one side of the cube—this side will be the side facing inwards. The other side should be left as is for that ~nice plexiglass feel~.

(Buzzkill time: you should also wear a mask for spray painting—spray paint is nasty stuff to get in your lungs).

Let the spray paint dry. 3-4 hours should do it.

Step 4: Assembling the Cube (sort Of)

Put together 4 sides of the cube. Hold 2 pieces together at a time, and then put hot glue in the inner intersection of the two sides.

Be careful not to bring the hot glue gun too close to the spray paint—it’ll melt away and you’ll end up with spots in the spray paint (you can see this happened in the picture—I ended up taking apart the cube, removing the spray paint with acetone, and redoing it).

(Superglue can also be used, but after getting a bad burn from superglue and cotton reacting, I’m not too keen on doing that again.)

We’ll leave the 5th and 6th square for the end.

The spray paint side should face INSIDE the cube.

Step 5: Connecting the Battery to the Charging Module

On the side of the TP4056 opposite the micro USB, there are 4 spots for soldering. As you may have guessed, Out + and Out - are for the actual circuit, while B+ and B- connect to the battery.

First, snip off the micro JST connector on the battery, and strip the ends of the two wires. Then solder the red wire (positive, or power) to B+ and the black wire (negative, or ground) to B-. There are quite a few tutorials on through-hole soldering, so I won’t go into that here. Now you can connect a micro USB cable to the battery, and the red LED on the TP4056 should light up (indicating that the battery is charging). Once the charging is complete, the LED will switch from red to blue.

A note about LiPo batteries: they are EXTREMELY dangerous. Yes, your phone, computer, and tablet are powered by LiPo batteries, but they utilize extensive charging protection and monitoring circuits that ensure that your phone (usually) doesn’t burst into flames. And LiPo fires aren’t like normal fires—they can run without oxygen and oftentimes burn down houses. Seen any terrifying videos of mini planes on fire? That’s probably LiPo gone wrong.

The TP4056 has charging protection circuitry built in. This means it protects the battery from overcharging and over-discharging. However, this does not give you an excuse to be careless around the battery. Activities I do not recommend performing with the battery include:

  1. Dropping it in the toilet.
  2. Attempting to crush it with a brick.
  3. Attempting to cut it open with a knife.
  4. Eating it (ok, this should be obvious).

Anyway, that’s the end of my LiPo diatribe. Just don’t be overly careless and you’ll probably be fine!

Step 6: Electronics Time!

The color changing magic of the cube comes from 5 different tilt switches. Since only one LED at a time will be lit, we can use one resistor for the multiple LEDs.

The circuit diagram above provides a schematic for a breadboard, but can be easily adapted to a perfboard. (If you'd like me to add a perfboard schematic, I can do so—just comment!)

Add the resistor into the corner of the perfboard, then bend one lead along the first row of holes. Then add in the 5 tilt switches along the row of holes such that one lead on the tilt switch is touching the resistor, and the other switch is on the second row.

The resistor is 100 ohm, which is good enough for standard 5mm LEDs given that the voltage discharged from the battery is 3.7V.

A normal Rubik’s cube has yellow/white, blue/green, and red/orange opposite each other. As a result, we need to make sure that each tilt switch is facing the correct direction. The correct directions relative to the perfboard, assuming that yellow is the “off” color, are as follows:

  1. White: Up (out of the perfboard, facing you)
  2. Blue: East
  3. Orange: North
  4. Green: West
  5. Red: South

Next add the LEDs to their corresponding tilt switch. Ensure that the longer leg of the LED is the leg that touches the tilt switch. Then solder all of the shorter legs of the LEDs together.

Solder a piece of red wire to the non-bent side of the resistor, and solder a piece of white wire to the legs of the LEDs (that you just connected).

Finally, solder the white wire to OUT- on the TP4056, then solder the red wire to the OUT+ hole (it’s good practice to always connect ground first!).

I first tested the circuit with a breadboard, then transferred the circuit to perfboard. Ensure that the white and red wire going from the perfboard to the TP4056 is on the bottom of the perfboard—the perfboard will be above the TP4056.

Now we can test that the circuit works as expected by tilting the perfboard in different directions.

Step 7: Apply Stickers to the Cube and the 2 Not-yet-attached Sides

This was the most nerve-wracking part of the build. It was quite difficult to add the stickers to the cube so that they were all straight.

Make sure you’re adding stickers to the right side. They need to be added such that yellow/white, blue/green, and red/orange are opposite each other.

I chose yellow to be the “off” LED color. This meant that the charging port could not be in the yellow or white side. Thus, the two unattached squares need to have white and another color adjacent to yellow (red, blue, green, or orange—I chose red).

Tip: it’s easier if you put a length of unpeeled stickers behind the side you’re currently adding stickers to, shine a flashlight behind that side, and then add stickers. This way you can easily see the outline of the stickers and use it as a guide for placing stickers.

Step 8: Making a Hole for the Charging Port

With the stickers added, we can now create a hole for the TP4056 charging port. Hot glue the TP4056 to the battery, with the charging port flush with the edge of the battery. Then mark the spot on the acrylic for the charging port to go through on the unattached side.

Next, use a small drill bit to make 3 small holes where the charging port needs to go. Use the charging port as a guide for how large the hole needs to be. (This part was also surprisingly hard).

Step 9: Assembling the Cube, Again

Time for final assembly! Now that the charging port is in place, we can put together everything else.

Take a micro usb cable and plug it through the charging port hole that you just made in the unattached side.

Connect it to the TP4056 on the battery so that the battery is flush against the side.

Add hot glue to three edges of the cube where the unattached side with the port will go, and the spot where the battery needs to stick. Then quickly add the battery and unattached side to the cube.

Ensure the circuitry on the perfboard is isolated from the TP4056 by placing something in between it—I used a cotton round. Hot glue the perfboard to the cotton round, and the cotton round to the battery (there should be space on the battery that isn’t taken up by the TP4056).

Make sure that the perfboard is as level as possible—this will make sure that the LEDs glow when they’re supposed to!

Finally, glue the last unattached piece onto the top, and we’re done!

Sand down any rough edges.

Step 10: Conclusion

Enjoy your new super awesome cube light! Show it off to all of your (extremely jealous) friends.

If I were to do it again: I’d be a lot more careful about cutting the pieces of acrylic, and probably order them pre-cut at a 45 degree angle so that it fits together. I’d also probably use epoxy to glue it together, and order white acrylic rather than bothering with spray paint, which can scratch off easily.

I hope you liked this Instructable! If you did, again, please consider voting for it in the Remix contest.

Comments, concerns, questions, constructive criticism are all welcome.

Remix Contest

Participated in the
Remix Contest