Introduction: 3D Digital Sand
This project is sort of a continuation of my DotStar LED Cube where I used SMD LEDs attached to glass PCBs. Shortly after finishing this project, I came across the animated LED sand by Adafruit which uses an accelerometer and a LED matrix to simulate the movement of grains of sand. I thought it would be a nice idea to extend this project into the third dimension by just building a bigger version of my LED cube paired with an accelerometer. I also wanted to try casting the cube in epoxy resin.
If you want to see the cube in action scroll all the way down to the video.
Step 1: Bill of Materials
The following list includes the materials needed to construct the cube as shown in the picture
- 144 pcs SK6805-2427 LEDs (e.g. aliexpress)
- microscope slides (e.g. amazon.de)
- copper tape (0.035 x 30 mm) (e.g. ebay.de)
- TinyDuino basic kit - lithium version
- accelerometer module (e.g. ASD2511-R-A TinyShield or GY-521)
- prototype PCB (30 x 70 mm) (e.g. amazon.de)
- clear casting resin (e.g. conrad.de or amazon.de)
- 3D printed housing
Additional materials and tools needed for construction
- Hot air soldering iron
- normal soldering iron with fine tip
- 3D printer
- laser printer
- Dupont connectors
- thin wire
- PCB header pins
- low temperature solder paste
- PCB etchant (e.g. ferric chloride)
- UV curing glue for metal-glass (e.g. NO61)
- general purpose glue (e.g. UHU Hart)
- silicone sealent
- toner transfer paper
Step 2: Making Glass PCBs
This process is already described in detail in my previous instructable of my DotStar LED Cube, therefore, I will just briefly go over the steps.
- Cut the microsope slides in pieces of 50.8 mm length. I have 3D printed a jig to help me achieve the right length (see attached .stl file). You will need 4 slides I recommend to make 6 to 8 pieces.
- Glue the copper foil onto the glass substrate. I used the UV curing glue NO61.
- Print the attached pdf with the PCB desing onto toner transfer paper using a laser printer. Afterwards cut out the individual pieces.
- Transfer the PCB design onto the copper clad. I used a laminator for this purpose.
- Etch away the copper using e.g. ferric chloride
- Remove the toner using acetone
Step 3: Solder LEDs
In my DotStar LED cube I used APA102-2020 LEDs and the plan was to use the same type of LEDs in this project. However, because of the small distance between the individual pads of the LEDs it is very easy to create soldering bridges. This forced me to solder every single LED by hand and I actually did the same thing on this project. Unfortunately, when I had the project almost finished suddenly some solder bridges or bad contacts started to show up which forced me to disassembel everything again. I then decided to move to the slightly larger SK6805-2427 LEDs, which have a different pad layout that makes them much more easy to solder.
I covered all the pads with low melting solder paste and then placed the LEDs on top. Take care of the correct orientation of the LEDs by referring to the attached schematic. After that I put the PCB on the hot plate in our kitchen and heated it carefully until the solder melted. This worked quiet well and I had to do only little rework with my hot air soldering iron. To test the LED matrix I used a Arduino Nano running the Adafruit NeoPixel strandtest example and connected it to the matrix using Dupont wires.
Step 4: Prepare Bottom PCB
For the bottom PCB I cut a 30 x 30 mm piece from a prototype board. I then soldered some pin headers to it where the glass PCBs will be connected afterwards. The VCC and GND pins were connected using a small piece of silvered copper wire. Then I sealed all remaining through holes with solder because otherwise the epoxy resin would seep through during the casting process.
Step 5: Attach Glass PCBs
To attach the LED matrices to the bottom PCB I again used an UV curing glue but with higher viscosity (NO68). For proper alignment I used a 3D printed jig (see attached .stl file). After gluing the glass PCBs were still a bit wiggly but became more rigid after they were soldered to the pin headers. For this I just used my normal soldering iron and regular solder. Again it is a good idea to test every matrix after soldering. The connections between the Din and Dout of the individual matrices were made with Dupont wires connected to the pin headers on the bottom.
Step 6: Assemble Electronics
Because I wanted to make the dimension of the housing as small as possible I did not want to use a regular Arduino Nano or Micro. This 1/2" LED cube by one49th made me aware of the TinyDuino boards which seemed perfect for this project. I got the basic kit which includes the processor board, a USB shield for programming, a proto board for external connections as well as a tiny rechargable LiPo battery. In retrospect I should have also purchased the 3-axis accelerometer shield that they offer instead of using a GY-521 module which I still had lying around. This would have made the cicuit even more compact and reduce the necessary dimensions of the housing. The schematic for this build is quite easy and attached below. I did some modification to the TinyDuino processor board, where I added an external switch after the battery. The processor board already has a switch but it was just to short to fit through the housing. The connections to the proto board and the GY-521 module where done using pin headers which does not allow for the most compact design but offers more flexibility than soldering the wires directly. The length of the wires/pins at the bottom of the proto board should be as short as possible otherwise you cannot plug it to the top of the processor board anymore.
Step 7: Upload the Code
After you have assembled the electronics you can upload the attached code and test that everything is working. The code includes the following animations that can be iterated by shaking the accelerometer.
- Rainbow: Rainbow animation from FastLED library
- Digital Sand: This is an extension of Adafruits animated LED sand code to three dimensions. The LED pixels will move according to the readout values from the accelerometer.
- Rain: Pixels falling down from top to bottom according to tilt measured by accelerometer
- Confetti: Randomly colored speckles that blink in and fade smoothly from FastLED library
Step 8: Casting
Now it is time for casting the LED matrix into resin. As suggest in a comment in my previous build it would be nice if the refractive indices of the resinf and the glass would match so that the glass would be invisible. Judging from the refractive indices of both components of the resin I thought this might be possible by slightly varying the mixing ration of the two. However, after doing some test I found that I was not able to change the refractive index noticeably without ruining the hardness of the resin. This is not too bad as the glass is only sligthly visible and in the end I dicided to roughen the surface of the resin anyway. It was also important to find a proper material that could be used as mold. I was reading about the difficulties to remove the mold after casting in similar projects like lonesoulsurfer's resin cube. After some unsuccessful trials of my own I found that the best way was to have a mold 3D printed and then coated with silicone sealent. I just printed a single layer of a 30 x 30 x 60 mm box using the "spiralize outer contour" setting in Cura (.stl file attached). Coating it with a thin layer layer of silicone on the inside makes the mold very easy to remove afterwards. The mold was attached to the bottom PCB also using silicone sealent. Make sure that there are no holes as of course the resin will seep through and also air bubbles will form in the resin. Unfortunately, I had some tiny leak which, I believe is responsible for small air bubbles that formed near the wall of the mold.
Step 9: Polishing
After removing the mold you can that the cube looks very clear due to the smooth silicone coated surface of the mold. However, there were some irregularities due to variations in thickness of the silicone layer. Also the top surface was warped towards the edges due to adhesion. Therefore, I refined the shape by wet sanding using 240 grit sanding paper. Originally, my plan was to repolish everything by moving to ever finers grits, however, in the end I decided that the cube looks nicer with a roughened surface so I finished with 600 grit.
Step 10: Mount Into Housing
The housing for the electronics was designed with Autodesk Fusion 360 and then 3D printed. I added a rectangular hole in the wall for the switch and some holes in the back to mount the GY-521 module using M3 screws. The TinyDuino processor board was attached to the bottom plate which was then attached to the housing using M2.2 screws. At first I mounted the switch into the housing using hot glue, then the GY-521 module was mounted, after that the protoboard and battery were carefully inserted. The LED matrix was attached to the proto board using Dupont connectors and the processor board can just be plugged in from the bottom. Finally I glued the bottom PCB of the LED matrix to the housing using a general purpose adhesive (UHU Hart).
Step 11: Finished Cube
Finally the cube is finished and you can enjoy the light show. Checkout the video of the animated cube.
Participated in the
Colors of the Rainbow Contest