Introduction: WiFi Controlled Acrylic Lamp

About: I am currently a Mechanical Engineering student, with 4 years experience in building Battlebots in the 15lb weight class. I enjoy creating projects that solve problems in new and exciting ways.

The first revision of the lamp was made as a christmas gift for a friend, and after gifting it the design was revised and improved, as well as the code. The first revision of the project took 3 weeks to complete from start to finish but the second revision was completed in 1 day, as most of the hurdles in coding and design were skipped on the second time around. From working on several projects of different complexities, this project can definitely be easy-medium in difficulty if you stick to the instructions. However, it can get difficult if you want to make changes to the programming or general design. The project can take several routes in terms of the finished product and its overall look. These different routes include how the lights appear and the physical pattern that the rods form. For fans of lights that shimmer, you can leave the rods as they are. If you are a fan of matte colors with little variance, you can choose to sand the rods.

Step 1: Bill of Materials

  • 3/8" Diameter Acrylic Rod - $14.31 - There are cheaper options but these tend to have few defects overall and no surface defects.
  • NodeMCU ESP8266 - $8.79 - These boards have worked well and as expected throughout many projects, and will be necessary for WiFi functionality.
  • USB-A to USB-Micro B cable - $4.89 - The cheapest option overall but cost will differ depending on choice of brand or color.
  • Wood-based 1.75mm 3D Printer Filament - $24.50 - Cheaper options are available but this brand seemed to work great and give consistent results.
  • #22 Gauge Hook-up Wire - $15.92 - More wire than necessary to complete this project but is great to have for other projects.
  • LED Kit - $6.89 - The kit contains more LEDs than needed to complete the project, but a kit like this has come in handy many, many times and has lasted through many projects.
  • Soldering Kit - $17.99 - The kit that I usually use comes from RadioShack, which no longer exists, so this appears to be the highest rated kit on amazon at a reasonable price.
  • Helping Hands - $7.22 - Completely optional, but definitely comes in handy for soldering by holding some of the components/wires in place.
  • Hot Glue Gun Set - $19.99 - I bought my hot glue gun in a store, but this appears to be of good quality for a good price compared to what I originally bought.
  • Sandpaper Kit - $7.99 - A good kit of different grits of sandpaper, only necessary if you want to sand the acrylic rods to give a frosty look to the acrylic, but incredibly helpful for cleaning up the ends of acrylic after cutting it.
  • Hacksaw - $9.00 - Used for cutting the acrylic rods, useful for hundreds of other projects, great tool if you don't yet have one.
  • Power Drill - $47.89 - Completely optional, very useful for sanding the acrylic rods evenly and concentrically, also a useful tool for many others projects.
  • M3 Cap Screws - $4.99 - More screws than needed for the project but once again, for small projects especially for electronics project, these screws come in handy as many boards have pre-drilled holes that accept this diameter screw. You will need metric hex keys to turn these screws.
  • 3D Printer - The largest part being printed in this project is approximately 6" x 2" x 3", so you must have a print bed that can support an object this size, or be able to find someone/somewhere that can get this part printed, price varies greatly depending on how the parts for this project are sourced, so it will not be included.

Total Cost - $190.37

The total cost is high, but the list also includes everything anyone would need to complete the project. People who have worked with electronics and 3D printing before will most likely have most of the necessary equipment needed to complete the project and the price will drop significantly. If you only need the acrylic rods, NodeMCU board, and wood filament. the cost becomes ~$48. which can be cheaper if you substitute in more cheaply sourced parts, but be very cautious of quality, as it tends to drop with price.

Step 2: Printing the Main Body and Bottom Cover

Notes: You do NOT need to use a wood based filament, this was just my preference as I liked the look of it. As stated in the "Intro" this project will look fantastic printed in black. The only color that is NOT recommended is: White, as the light from the LEDs can soak through the material even with fairly thick walls, which will make the base become a mix of shadows and mix of whatever colors are activated at the time.

If you have a 3D Printer, meeting the specifications in the "Bill of Materials" step:

Print the .STL files provided in the "Bill of Materials" step the same way you would print a standard PLA material, the wood material is just PLA mixed with a certain percentage of sawdust. It has been recommended though to prevent clogs to remove the material whenever it is not currently in use in order to prevent the sawdust from settling in the nozzle.

If you do not have a 3D Printer:

You will need to use a 3D printing service such as 3D Hubs. This will increase the price of the project and will increase the time it takes to complete while the parts are made and shipped. It was estimated to cost $27.36 for both parts to be made as cheaply as possible, your mileage may vary. It may be worth researching if nearby libraries, schools, universities, etc have a 3D printer that you can use for free or reduced cost.

Step 3: Cutting the Acrylic Rod

Depending on what pattern you are trying to create with the acrylic rods, you may need to order more acrylic rods as some designs will use more acrylic than others. This project will use a "Descending Staircase" pattern. Other patterns you can try include a "Pyramid" or even "Two Peaks" all depending on where you position the rods and what lengths you cut them to. The pictures above show the lengths the rods should be cut to if you are attempting to copy the "Descending Staircase" pattern. To accomplish this pattern, each rod should be about 1" (25.4mm) shorter than the next. You want to be sure when cutting the rods that you make "square" cuts. This means that you should cut the rod as perpendicularly as possible. This can be easier or harder to achieve depending on how you cut the rods and with what tools. With a engine lathe you could cut a rod to be exactly 9.000" and have the cut be absolutely "square", however most people don't have an engine lathe in their garage. Most people will probably cut the rods with a hacksaw or coping saw, and the key to getting the best cut using these tools is to mark a line where you want to cut, and be sure to line up the cut as accurately as possible as the saw will try and follow the groove that is created when you begin, so if you start the cut perfectly, it will try and follow that initial cut. Another key factor is "work holding" or how you clamp the material down; the more secure you make the material, the easier it will be to cut. The main things to worry about with clamping acrylic is to be gentle as too much pressure can crack it and also be aware that these rods will be the center piece of the project, you want to be to sure to not scratch the acrylic as the scratches will become very apparent when light is shining through it. If you intend to sand the acrylic rods, the scratches will be hidden by the sanding but you will still want to avoid scratching the acrylic, as the deeper the cut, the more sanding it will take it to hide it.

Included in the pictures, is how I solved the "work holding" challenge. I screwed wood screws into my work bench on each side of the acrylic rod and tightened them until it firmly grips the material, the method holds the material firmly while allowing the best range of motion possible by not involving bulky clamps. However, you may need to adjust your "work holding" depending on what equipment you have.

Step 4: (Optional) Sanding the Acrylic Rods

If you want the light of your lamp to look more like the picture with only the green and blue lights active. That is to say, with a more matte look to the colors. You can choose to sand the acrylic rods using varying grits of sandpaper ending at about 400 grit, which gives a nice matte finish. When sanding be sure to sand consistently around the perimeter of the rod, as sanding unevenly could make the rods look different from each other and break symmetry or affect how the light appears. You will also want to be mindful of the fit of the rods into the Main Body piece. If its a close fit before being sanded, you may want to sand the end of the rod being shown much more than the part that is being held in the Main Body piece, so that the rod can still be held firmly in place. To make the process faster, you can place the rods in the chuck of a drill and turn the rod at a slow pace and sand the rod as it spins. This will keep the sanding concentric around the rod and also remove material faster than if it were done by hand.

The process of sanding the rods makes the color from the LEDs appear to be matte due to the rougher surface created by the sanding, the tiny peaks and valleys created by the sanding cause the light to bounce back inside the rod instead of just passing through. This also keeps the colors more "contained" as the light doesn't escape as well, so it won't fuse with other colors, but it may also not travel as far as the light from the un-sanded version.

As you may notice from the picture of the un-sanded rods, the light shimmers due to the impurities inside the acrylic rod, every tiny air bubble inside causes the light to bounce off in a different direction and reflect, which gives the light the "shimmer" effect. This effect is most likely still occurring inside the sanded rods but is not seen as the light is being stopped at the sides of the rod and not passing through.

Step 5: Wiring

Notes before starting:

Be VERY careful when following the diagram that the board has been mounted upside down to allow for easier soldering. Things that appear on the right side of the diagram, will be on the left side from the upside down perspective, which can be seen in the picture of the finished wiring. The yellow/signal wires for each LED are where the GPIO pins are located. Triple check before starting, I made this mistake at least once throughout the process, and it will be very frustrating.

Also be careful when soldering not to touch the sides of the Main Body piece with the soldering iron, it can quickly melt through the plastic if you don't notice it fast enough.

Lastly, it is recommend to solder the wires to the LED first, and then solder the wires to the board to make things the least difficult.

Designation on Board - Position of LED When Viewed From Front - Arduino Pin Number

  • D0 - Leftmost LED - 16
  • D1 - 2nd From Left - 5
  • D2 - 3rd From Left - 4
  • D3 - 4th From Left - 0
  • D4 - 5th From Left - 2
  • D5 - Rightmost LED - 14

These connections will be made from the pins on the board listed above to the positive (+) side of each LED, the negative (-) side of each LED can be connected to nearest ground (GND) pin, some LEDs will have to share a ground (GND) pin due to the board only having four ground (GND) pins.

Step 6: The Code

The code works by having the NodeMCU board host a WiFi network, which hosts a login page. You then log into the NodeMCU's WiFi network, which by default has no password. The login page can be found by typing the IP address of the board into your web browser of choice. On the login page, you type in the SSID and password of your home network, then you can refresh the page and find the IP address the main page will be hosted at on your home network. At this point you can disconnect from the NodeMCU's network and return to your home network. You can now go to the IP address of the main page and be able to control the lamp from any device on your network. The webpages were designed for IPhone 6,7,8, so the page may not be formatted correctly for your device. If you wish to change the HTML/CSS for your device or to auto-scale to any device, the pages for the websites are located inside of the Arduino code, as the NodeMCU board is actually hosting the websites.

The code has several functions for the lights. It has on/off functionality for each individual light, a mode that turns on all lights simultaneously, a mode that fades the lights from left to right, a mode than randomly turns on each light until they are all on and then turns them all off randomly, a "Dice Roll" mode that will randomly select one color to light up using the Leftmost LED as 1 and the Rightmost LED as 6, and lastly a "Coin Flip" mode which will consider the three Leftmost LEDs as "Heads" and the three Rightmost LEDs as "Tails"