top of page

The engineer's lantern

[Sep 2020]

An engineer's take on the traditional Mid Autumn Festival Lantern, fully designed, 3D-printed and programmed to celebrate my favourite festival.

Wifi Web Server
The Esp8266 Nodemcu acts as a password protected access point, allowing any device with the password to connect and control the Lantern's parameters. These parameters are saved into non-volatile memory, hence preventing the Lantern from losing the user's presets upon power down. The physical switch on the Lantern's top cover acts as the main switch, turning on/off the Lantern with the last preset without requiring any device to be connected to its wifi access point.

The website is designed in HTML, CSS and Javascript, then served to the webclient via the ESP8266. This served as an excellent practice for a Javascript and CSS course I took. 

 

esp8266webserv.png

Fully 3D designed and printed

Parts are all designed on fusion360 and printed on my CR-5 Pro.


Polarising the projected light from the LED strip twice creates an extremely appealing effect, hence the white 3D printed housing that is screwed onto the main mcu holder.

 

After some trials, I found that 2 walls of 0.8mm each with a separation distance of 0.4mm seemed to produce the best results, allowing the diffused light to produce great pastel colors.
The screw on design for the cap and cover makes it easy to swap the components in future if required.
The swivel handle and flat cap design also allows the lantern to act as a Lamp when flipped 180 degrees

16.7 million Color Combination
The WS8212B RGB Individual programmable LED strip housed within the lantern allows for up to 256 shades of each primary R G B color.
This meant that one can easily program the LED strip to produce up to 256^3 permutations of colors using an external microcontroller.​

Color = (R,G,B), where R,G,B are a 1 Byte value each

For example, a purple with more intense red and less intense blue will be:

Red = 0xFF, G = 0x00, B = 0xC3,

giving a hexadecimal value of 0xFF00C3

With this concept in mind, mapping slider values to each of these R,G,B values

will result in 256 * 256 * 256 = 16,777,216 total permutations of possible colors!

Also spent quite a hefty amount of time creating presets that looks sick as heck - 

Rainbow spectrums, fireball looking effects, breathing patterns, static displays and many more.

The webserver sends requests to the MCU when these presets are clicked, then callback functions for each of these presets

will be triggered. These functions were good practice for my data structures and algorithm course as I seeked to use some of

these algos to cycle thru indexes of the LED strips, instead of hardcoding them.

Portable
The Lantern is powered via 3 AAA batteries, which produces 4.5V of voltage for the nodemcu and LED strip (which runs on 5V).
The mcu holder compartment was originally designed for dimensions of a typical 3.7V Lipo Battery, but it was later swapped for a 3 AAA battery holder, as the Lantern was to be gifted to my niece, and it was safer to use disposable AAA batteries over Lipo batteries.

IMG_6708_edited
1
3
4
5
IMG_6705
6
8
bottom of page