Neopixel LED Mirror (Python, Raspberry Pi, Arduino, 3D Printing, Laser Cutting!) DIY How To

Neopixel LED Mirror (Python, Raspberry Pi, Arduino, 3D Printing, Laser Cutting!) DIY How To

Hi I’m Alex and welcome to “Super Make
Something.” Today, we’re building a giant Neopixel LED
Mirror using a 3D printing, laser cutting, and a Raspberry Pi. Let’s get started! The Neopixel Mirror is made out of the following
components: 1x Raspberry Pi 3 B+ with an SD card
1x Raspberry Pi case 1x Raspberry Pi camera and camera ribbon cable
2x M2 screws 6x wood screws
1x PCB prototype board with associated wiring 1x 3D printed Raspberry Pi camera mount
1x 36 inch by 36 inch wooden backboard 24x Neopixel LED strips with 24 LEDs each
576x LED Covers 3D printed out of clear PLA 1x 3D printed camera lens hood
16x Lasercut mounting grids 4x Pieces of Vinyl Planking
1x 5V 30A power supply And
1x PC Power cord I began this project in Solidworks, a computer
aided design software package. I first modeled the unique laser cut mounting
grids that would hold all of the 3D printed LED covers in place. Like their name suggests, these pieces consist
of a piece of wood with square slots that will be cut out using a laser cutter. The spacing of each of these slots was based
on the LED spacing of the Neopixel strands that I bought for this project, which have
30 LEDs per meter. The mirror has 3 unique mounting grid designs
— 1 design for mirror’s outer corners, one design for the remaining border pieces,
and one design for the internal sections, which have a cutout that will allow a 3D printed
camera lens hood to slide in between these pieces to keep light from the LEDs from spilling
into the camera’s field of view and blowing out the image. After I had completely modeled these pieces,
I next modeled the LED covers that would mount into each of the slots and diffuse the light
generated by each Neopixel. At this point, I began to create a digital
assembly of the mirror using the parts I designed to make sure that everything would fit together
correctly. I next modeled the backing board that would
hold everything in place, followed by the mirror’s picture frame border, and finally
inserted digital models of the Raspberry Pi and Raspberry Pi camera, the latter of which
I also used to model the 3D printed camera lens hood and camera mount that would hold
the camera in place on the back board. After everything looked correct, I saved the
LED covers, camera lens hood, and camera mount as an STL or “stereolithography” file,
so that I could 3D print these pieces during the next step, and then also saved each of
the mounting grid designs as a DXF or “Drawing eXchange Format” file so that I could laser
cut these designs later. It was now time to 3D print the LED covers,
camera lens hood, and camera mount. I began by opening up Cura, a free 3D slicer,
and importing each of my models. After verifying that all of my print settings
were correct, I sliced each model, which generated G-Code instructions that would tell my printer
how to print each file. I then saved the G-Code instructions onto
an SD card, transferred these to my printer, and started the print job. Because the mirror is made up of a 24×24 grid
of LEDs, I needed to print 576 individual LED covers. In total, this process took nearly 9 straight
days of printing, and consumed almost 3 full rolls of clear PLA. If you attempt to build this project yourself,
be forewarned that both the printing process, as well as the support removal process will
take a while. Definitely do not attempt to make this project
if you are short on patience or time! While the LED covers printed, I headed to
my basement, where I had set up my brand new K40 laser cutter. Like the 3D printer, the laser cutter also
runs off of G-Code, which is streamed from a Raspberry Pi that runs the free “K40 Whisperer”
laser cutter software from Scorch Works. A link to this software can be found in the
video description below. To prepare each of the DXF files for “lazing,”
I opened each of the files in Inkscape, and changed all of the line colors to red in order
to let the K40 Whisperer software know that these sections should be cut out. After this, I resaved everything as an SVG
or “Scalable Vector Graphics” file, and imported these files into the K40 Whisperer software. It was now time to get ready to cut out all
of the mounting grids. A few words of warning — laser cutters are
extremely dangerous, are a tremendous fire hazard, and generate a horrible smell as they
are cutting through material. If you’ve seen William Osman’s “Safety Glasses
vs CO2 Laser Glasses” video, you’ll know that a laser can do serious damage to your eyes
if you don’t wear proper eye protection. If you haven’t seen the video, be sure to
check it out — it’s both informative and hilarious. When operating a laser, be sure to always
wear proper eye protection, have a fire extinguisher nearby, and properly vent your laser cutter’s
exhaust. With all of the safety precautions in place,
I placed a sheet of 3 mm plywood into my laser cutter, adjusted the laser power, and started
cutting. The laser cutter’s stepper motors now began
moving the laser head across the wood, selectively firing to cut out each of the grid’s squares. After about 3 minutes, the laser had finished
cutting out one the panels, so I removed it from my machine, and repeated this process
for the remaining 15 mounting grids. After this was done, I took all of the panels
outside, and painted them with a few layers of black spray paint. It was now time to make the LED mirror’s backboard,
which is made from a 3 foot by 3 foot, half inch thick piece of plywood that I had cut
at my local hardware store. I began by marking out the board’s center
lines so that I would know where to drill a hole for the Raspberry Pi camera. I next marked out the locations of holes along
the edge of the backboard that I would need to drill in order to feed through all of the
Neopixel power and signal wires. Having a t-square definitely helps, as it
will make drawing straight lines and taking accurate measurements over long distances
much easier. I next propped the board onto some weights
to elevate it off the ground, and then drilled quarter inch holes at each of the locations
that I had marked out in the previous step. I next laid out all of the grids on the board
to help me align everything correctly, and then marked several key locations on the backboard
using a red sharpie. Finally, I again used my t-square to draw
a straight line through each of the grid rows on the backboard, which would allow me to
place the Neopixel strips into the correct locations during the next step. This step is important, because it will make
sure that each of the LEDs are located in the middle of each LED cover, which allows
the light to shine through each of the covers evenly. It was now time to attach the Neopixel strips
to the backboard. The project uses a total of 576 Neopixel LEDs
to create a 24 by 24 grid. I therefore needed to buy four 5 meter rolls
of LEDs, each of which contained 150 LEDs per roll. After verifying that the spacing I had marked
out earlier was correct, I first cut a row containing 24 LEDs from the first roll using
a pair of scissors. I then peeled off the protective paper to
expose the adhesive on the back of the strand, and the carefully pressed it against the backboard. I then repeated this step for each of the
remaining 23 rows. The solder pads of the first and last Neopixel
in each roll were covered with heat shrink tubing to act as insulation and provide some
strain relief. Because I would need to daisy chain all of
these strands together, I removed this tubing by carefully cutting it with an exacto knife. It was now time to solder the LEDs. Because there would be a significant voltage
drop if all of the LED rows were powered in series, I first connected the 5V and ground
rail of each row in parallel using a set of jumpers. To make programming easier, I did connect
all of the data lines in series, which required me to run the data wire between Neopixel strands
behind the mirror through each of the wiring holes I had drilled previously. To do this, I used individual wires from a
long ribbon cable, since these were both very thin and could be cut to the exact length
that I needed them to be. After everything was soldered together, I
taped the data wires to the backboard to get rid of any extra slack, and got ready to power
up the LEDs for the first time. Because each Neopixel can theoretically draw
60mA of current at full brightness, I chose to power the mirror using an external 5V 30A
power supply that I had purchased online. I began by cutting the end off of a standard
power cable, and used wire stripper to expose the wires in each of the individual cables
in the cord. I then connected the wires to the power supply’s
screw terminals as shown on screen. If you end up building this project yourself,
please ensure that you are connecting the correct wires to the correct screw terminals! I then connected two jumper wires to the GND
and 5V lines to the power supply’s DC output terminals. To verify that everything was wired correctly,
I next used a solderless breadboard to connect the LEDs and an Arduino microcontroller together
as shown. The Arduino was previously programmed with
a test program to light up each of the individual LEDs. To learn more about Arduino programming, please
be sure to check out my other projects on the “Electronics” playlist linked below. A link to this Arduino test code can also
be found in the video description. It was now time to plug in the power supply
to see if everything worked. After inserting the power supply’s cord into
a surge protector and flicking on the switch, the LEDs slowly lit up indicating that everything
was programmed correctly! At this point, all of the mirror’s parts had
finished printing, so I began to glue in all of the LED covers into the mounting grid slots
using superglue. To do this, I placed four drops of glue into
the corners of each slot, and then gently pressed in each LED cover. This process can take a while, so be sure
to work in a well ventilated area, as the superglue gives off a slight odor that will
definitely get to you as you are gluing in all 576 covers. Once all of the covers were glued in place,
it was time to attach the assembled grids to the backboard. For this, I used hot glue, as it is both extremely
viscous and also sets very quickly. I kept the LEDs on during the gluing process,
which would allow me to make sure that everything was aligned correctly. Comparing the bare LEDs to the other LEDs
shows that the printed covers did a great job at diffusing the light, making the images
on the mirror much easier to see. To make everything look a bit prettier, I
next headed to my garage, where I used a mitre saw to cut 4 pieces of vinyl planking that
I would use for the mirror’s frame. These pieces were designed to look like stained
wood, which saved me an extra paint step during the assembly process. After all of the framing pieces were cut,
I attached some wooden squares that I had left over from cutting out the mounting grid
to the back of the vinyl planks. These squares served as spacers to make sure
that the frame would sit at the correct height. After this, I glued the frame to the backboard
using a bit of wood glue. The final mechanical assembly step was to
attach the Raspberry Pi, camera, and camera lens hood to the backboard. I began by gluing the lens hood into the slot
on the front face of the mirror using a bit of superglue. While this dried, I attached the Raspberry
Pi camera module to the 3D printed camera mount using 2 M2 screws. I next flipped the backboard over again, and
used 4 wood screws to attach the camera to the backboard, so that the lens pointed through
the camera hole and lens hood. After this, I attached a Raspberry Pi case
that I had bought online directly underneath the camera mount using 2 more wood screws,
and then covered these screws with Kapton tape to make sure that the screw heads would
not accidentally short out the Pi. Once the case was attached, I placed the Raspberry
Pi into the case, and then added the case’s top cover for some additional protection,
after which I connected the Pi to the camera using the onboard connector and a Raspberry
Pi camera ribbon cable. I next connected jumper wires to the Raspberry
Pi board and then used PCB prototyping board to wire everything together as shown onscreen. The connections on this board were again covered
with a bit of Kapton tape, and the PCB was attached to the backboard using more hot glue. Finally, I used a braided cable sleeve to
bundle the power and ground connections coming into the PCB together to keep everything nice
and neat, after which I attached these wires to the DC terminals in the power supply to
complete the mirror assembly! The final step was to program the Raspberry
Pi. For this, I first installed the Raspbian operating
system on an SD card and set up the Pi to be accessible via remote desktop. Please check out my “Raspberry Pi Setup +
WiFi Remote Desktop Access” video linked below for more details about this process. Once the Pi was up and running and I had connected
via remote desktop, I opened up the terminal and typed in sudo raspi-config, which opening
up the Raspberry Pi Software Configuration Tool. There, I proceeded to Raspberry Pi Configuration
menu and ensured that the Camera, SSH, VNC, SPI, I2C, Serial, 1-Wire, and Remote GPIO
options were all enabled. At the time of making this video, the Raspberry
Pi’s built-in Broadcom sound chip interferes with the Neopixel library, and causes it to
work incorrectly. To get around this, I next disabled the sound
chip through the console terminal by blacklisting the soundcard. To do this, I first created a new file called
“alsa-blacklist.conf” on the desktop and added to line “blacklist snd_bcm2835” to it. After this, I again opened up the terminal
and entered the command “gksudo,” which opened up a dialog box prompting me to run a program. With the “As user: root” option selected,
I next typed in “pcmanfm,” which brought up a file browser with special edit permissions
of the Raspberry Pi’s low-level directories. In this file browser, I navigated to the “etc/modprobe.d”
folder, and copied the configuration file I had just created into it. After this, deleted to configuration file
from my desktop, and rebooted the pi by typing “sudo reboot” into the terminal, which caused
the Raspberry Pi to restart. During my next login, I then noted that an
“X” was present over the volume icon in the Raspberry Pi’s taskbar, indicating that the
soundcard had been successfully disabled. With the soundcard disabled, I next returned
to the terminal to install the required libraries to control Neopixel LEDs from the Raspberry
Pi through Python. I did this by typing in the commands shown
onscreen and hitting enter. Finally, I installed the last required software
package, called “picamera,” which allows for individual pixels of incoming Raspberry Pi
camera images to be accessed and manipulated via Python. To do this, I typed in the command shown onscreen,
which grabbed the Python 3 version of the software package and installed it on my system. With the install complete, it was finally
time to run the Neopixel mirror’s Python code. A link to this code can be found in the video
description below, and works as follows: After initializing all of the code’s variables
and fixing the camera’s parameters, the code grabs a grayscale image, and extracts a 24×24
pixel region of interest from it. At this point, the image is composed of a
red, green, and blue, channel, but since the image is grayscale, all of these channels
contain the same information. Therefore, the code next grabs one of these
channels, and reshapes the 24×24 pixel array into a 1×576 element vector, where each element
corresponds to a pixel in the mirror’s Neopixel strand. The code then assigns these values to one
of the color channels in a Neopixel array, displays the image, which causes the Neopixels
to light up, and then clears the camera buffer to get ready to grab the next image. All of these operations occur in a while loop,
which runs indefinitely until the user terminates the script by typing CTRL+C into the Python
console. To run the code, I opened up a terminal, navigated
to the directory containing the code using the cd command, and then typed sudo python3, which is the
name of the script that controls the Neopixel LED mirror. At this point, it was time to place a sticker
onto the frame, and head to the Great Lakes Science Center in downtown Cleveland for the
2019 Cleveland Maker Faire! There, the mirror ran continuously for nearly
10 hours without any hiccups, and delighted everyone that walked past it. In case you’re here because you saw the Neopixel
Mirror in person at the event, thanks for checking out my channel! If this is your first time here, please consider
subscribing to help Super Make Something reach a larger audience! Overall, the event was a huge success and
I now have a digital display piece that I can hang in my office or take to future Maker
Faires! In addition to showing a livestream of your
reflection, the LED mirror can also be used as a digital billboard to show pictures or
other animations. A link to the code to do all of this can be
found in the video description below. A big thank you to everyone who came out to
the 2019 Cleveland Maker Faire to see this project in person. If you enjoyed this video and learned something
new, please consider giving this video a like, sharing it with your friends, and subscribing
to my channel. Also be sure to hit the bell icon to be notified
when I upload my latest video. Your support helps Super Make Something reach
a larger audience. In case you’re interested in building your
own Neopixel mirror, a bill of materials and a list of all of the tools I used can be found
in the video description below. Well, that’s all there is to
this episode! Thanks for watching! Now go Super Make Something.


  • develmeiker

    December 8, 2019

    Nice project, i hope to see more videos.
    Best regards.

  • Stanislav Jochman

    December 8, 2019

    You have used too thin wires for VCC and GND. Otherwise great video.

  • Hugo Bracamontes Baltazar

    December 8, 2019

    Just one word: AWESOME!


  • StealthXtra

    December 8, 2019

    Very cool! How do you like the laser cutter? Would you recommend this prebuilt over building your own from a kit? Also how thick can it cut?

  • Jay Rathod

    December 8, 2019

    That's lot of work.. Awesome Project

  • Jean Seb Astienback

    December 8, 2019

    Great job but too much elements compared to some simple mirror display based on the same camera etc…

  • FOX 狐

    December 8, 2019


  • ninline2000

    December 9, 2019

    That exhausted me just watching all the work you put into that. Very nice video.

  • Raspberry Pi

    December 9, 2019


  • cosmicrdt

    December 10, 2019

    Very neat project. I recommend using connectors on your mains voltage wires for extra safety.


    December 10, 2019

    That was awesome. Extremely well explained throughout the entire process. Cheers, JAYTEE
    Stickers will ship soon 😂

  • erik vernooy

    December 11, 2019

    Very inspiring! One advice I can give you is if you have your bridging settings right those parts would not need support. Saves a ton of tedious work and material. Keep it up!

  • BigFatX

    December 12, 2019

    Call me impressed.

  • derdritte

    December 13, 2019

    Really cool project! A bit out of my reach, but I think I will attempt a smaller board with less (or no) 3D printing involved.


Leave a Reply