Some years ago, my brother had a brilliant idea for a product he called Blinky Light Thing. It was a near useless gadget that served only to amuse the owner with blinking lights, vibrations, and some sort of primitive motion (like a single foot it could wobble on). It would have been like Pet Rock for the new millennium. It never got made.
Flash forward to now. I had an idea for a game involving flashing lights, beeps and touch sensors. It seemed more practical but still a "thing" with "blinking lights" and so the name got appropriated for this device!
What is Blinky Light Thing?
Hereafter referred to as BLT, it is a small hand held object (currently a cube) on which you can play a number of games. Each side of the cube can light up and also sense touch. The cube also knows which way it is oriented and can sense movement.
But here's the cool part (well, besides the blinky lights and everything else..). It has the ability to communicate to other BLT's! It does this through Bluetooth Low Energy, or BLE. This enables games involving more than one cube, and games with multiple players.
Originally, when the inspiration hit me, I imagined much smaller cubes and having a number of them. I quickly concluded this was too complex to pull off as a first prototype, and settled on the idea of having just 2 larger cubes to prove the concept. The first design was going to built as a hard cube with acrylic sides, with an insert containing the electronics and panels mounted on an inner frame. Also in the original design, the built in LEDs on the Circuit Playground would illuminate the cube sides via 'light pipes' made from bent acrylic. Overall this was very clever but probably also over engineered! I got as far as making the cube, the panels and the inner structure before realizing it was just too complicated.
At one point early in my sketches I had layed out all the components on a flat drawing of the cube sides, just to visualize things better. Much later, I returned to this idea and thought, maybe I could actually make it flat and then "fold" it up. I thought I could do this with the acrylic panels by laying them out flat, mounting all the parts and then "folding" it all into position.
Then, later, I thought, well why not just go ahead and make a prototype from paper/cardboard and literally fold it up? I had already played with the ideas of a fold up computer and a fold up robot, so why not this too?
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Parts List
Parts to make a single Blinky Light Thing. The NeoPixels generally come as a 1 meter strip, which is enough to build 2 cubes with a bit left over.
2" Reflective metal foil tape - $3.38
Acrylic sheet 8" x 10" - $3.38
2 sheets of Card stock, 8.5" x 11" - $3.99. I used blue but any dark color would work well.
HM-10 BLE module - $4
Small gauge wire. I used a recycled ribbon cable - $1.77 from an old floppy drive connector.
1 meter NeoPixel strip - $6 (30 leds, we only need 12)
3x AAA battery holder - $140
Tacky Glue - $1.29 or other glue for paper
Wire strippers or careful use of a razor blade..
Acrylic scoring tool or appropriate x-acto blade
Scoring tool for cardboard, or a good ball point pen
Clamps (makes cutting acrylic easier)
Engraver or other Dremel-like tool.
Fine grit sand paper
Bic lighter (if you want to flame polish the acrylic)
Step 2: The Cube
The completed BLT is a cube, 2.5" square. This size was arrived at as a good compromise in order to contain the Circuit Playground (a 2" circle) and the acrylic panels, the battery holder, etc.
The sides of a cube can be layed out flat on a sheet of card stock. Did you know there are 11 different ways to do this? I didn't! I had further constraints, though. It had to fit on a standard sized sheet of paper/card stock (8.5" x 11") and it had to fold in such a way to minimize the bends in the wiring. The pattern I chose fits almost perfectly to make the 2.5" cube. It also allows for each side of the cube to have an outside and a fold over, which forms the backside of each acrylic panel.
I printed this out (png and editable svg included) on an inkjet printer (which can print right to the edges, unlike a laser printer) and used an x-acto knife to carefully cut it out. You could have it laser cut or cut with a Cricut if you have access to one. I used a simple ball point pen to score the lines where it will fold.
Step 3: Glow Panels
Each side of the cube has an edge-lit glow panel. These are each sized to be 2 inch squares, with about a 1/4" extra on one side. This extra bit will be where the LEDs are mounted. I used .08" thick acrylic from Plaskolite, which I bought at Lowes in 8 x 10 sheets. One sheet will get you all the parts for one cube. You could get these parts laser cut from a service like Ponoko, but I did it by hand.
To cut the parts, you need a scoring tool. I used one of the blades from my x-acto kit. I put a print out of the parts under the plastic, and then scored along the lines on top. You have to think about which lines to break off first because you have to break the plastic from one edge to the other. You can't do this to make a hole, for instance. I recommend clamping the plastic to the edge of a table with the score line right on the edge of the tabletop. Then with a quick downward push the plastic will break. This leaves a relatively smooth edge but you will then want to sand it as flat as you can.
All the edges are then sanded with fine grit sand paper to get them as smooth as possible, and also slightly rounded which will help keep the light reflecting inside the plastic. Finally, I've "flame polished" the edges with a simple Bic lighter. On one edge (the long dimension, IE, the extra 1/4 inch) I have sanded a roundish bevel, which will help reflect the light towards the rest of the panel. Instead of attaching the LEDS to the edge, which would be hard to do in this design, the leds will attach on the other side of the bevel, flush with the surface of the panel.
The patterns are engraved into the plastic with a Dremel tool and a small round grinding bit. This makes for surfaces where the light can be deflected, thus producing the glowing patterns. To get the best glow, you want the patterns on the backside of the plate. The plates are then backed with a fold-over to give the glowing features more contrast. For extra light containment, I've used some of the foil tape around the bend area and around the LED.
You would probably get better results having a service like Ponoko laser cut and engrave the panels, but I wasn't patient enough for this prototype so I did it by hand.
For my first cube, I used a pattern of Galifreyan words for each side. If you are a sci-fi fan you will instantly recognize what these are, even if you don't know what it says... :)
Step 4: Fold Over
Now we want to attach the panels. I found that tacky glue didn't really stick to the acrylic. I ended up using double sided tape. I only realized after I completed the cube that the double sided tape also tended to glow, so it wasn't a good idea to use it on the entire backside of the panel, you should only attach at the four corners.
Note the arrangement of the panels so that you can fold over and they end up situated correctly. I pressed down around the edges of the panels to enclose them with the card board. Tacky Glue works great here as it grabs the paper quickly and holds it.
Step 5: Sensors
To detect touch, each side of the cube has a capacitive sensor. This is made from foil tape, which you can easily buy from a home supply store like Lowes. Its normally used in air ducts to seal the duct pieces. A single wire is stripped on one end and placed near the edge of the sensor and then secured to it with another small square of foil tape. The tape is 2" wide which is the perfect size, and use three lengths to get two touch sensors each.
All the sensors are connected together and grounded with a circle cut in the middle of each panel and connected by a wire.
Experimentation was important here. My first go I used a simple square of foil. This worked OK when directly touching the foil, but did not work well or at all when behind the acrylic. For my next attempt, I cut a circle in the center of the foil with an approximately 2mm gap to the remaining outside foil. The sensor wire connects to the center while the outside foil is grounded. This worked considerably better and was sensitive behind even two layers of plastic.
5 sensors are all the same, but the sixth sensor is where the Circuit Playground is. I wanted to be able to still use the internal LED's on this board, so, a pattern was made and used to cut circles in the foil as well as the card stock backing.
Step 6: Blinky Light String
In my original design, I purchased individual 5050 SMT LED's and soldered wires to them. This was awkward and complicated, and the resulting string didn't fit with the paper folded up version I ended up making. So I purchased a 1 meter length of NeoPixels with 30 pixels per meter. This was almost the perfect spacing to get two pixels per panel. Problem is, I would have to bend the string around a corner no matter how I layed out the cube. The bend would also be a compound bend, not just a simple fold.
You can order strips that have an "S" shape that are meant to be folded in such a way, but I didn't want to wait a month to order it from china. So I got the standard strips and carefully cut three holes to get a more flexible strip. Be careful here because you want to leave enough of the copper traces so it still works. I calculated how much power the strip would use and thus how wide the traces needed to be, so as long as its still around 2 millimeters wide you should be fine.
Even with the holes, its a little tricky to get the strip in place. It is held down by a blob of hot glue half way between each LED. Since the strip is glossy you can easily pull it off the hot glue, so be careful. Its hard to see, but, for each fold, I've given the led strip a slight upwards "dimple" so that when the cube gets folded it will fold inward. This is necessary because otherwise they would make it hard to fold up, as the strip is too stiff.
Also make sure you orient the strip so the input end is near the panel where the Circuit Playground will be mounted. You'll need to solder three wires to the end of the strip here.
Step 7: Power
I've used 3 AAA batteries to get 4.5V, which is more than enough to power Circuit Playground (which will regulate that to 3.3v for the BLE module) and just enough for the LED strip (ideally, 5V, so they might not be as fully bright as they could be, but its good enough).
Using some more card stock in green (just for fun) I created a simple box around the battery holders. I used a 2 x AAA holder and another single AAA holder because thats what I had on hand. The battery holder holder box will make a secure mounting for the batteries and also add some more strength to the final cube.
Step 8: The Circuits
To control the cube, I've used an Adafruit Circuit Playground. These are more expensive than an Arduino Nano or Pro Mini, however they have lots of built in goodies like the accelerometer and speaker, microphone, and two buttons. It also has 10 NeoPixels on board. Originally I had planned to use acrylic to create light pipes that would bend around inside the cube to redirect the light to all six sides. This got too complicated and in tests it seemed like the light would not end up bright enough, so I went with the NeoPixel strip. The built in pixels will be used for other indicators.
The HM-10 module wants 3.3v levels for the serial communication, and since the Circuit Playground also runs at 3.3v there is no issue directly connecting them. If we were to use another kind of Arduino like a Nano or Pro Mini running at 5V we would want to reduce that voltage on the RX input on the HM-10 with a couple resistors (a voltage divider).
Because we are using a bluetooth module to communicate between cubes, we are left with just six I/O lines, one for each capacitive sensor for the sides of the cube. That doesn't leave any I/O for the external NeoPixels. Because of the strict timing necessary for the NeoPixels to be programmed, we can get away with using one pin for both the pixels and a sensor. We check the sensor periodically and then when needed, use the pin to program the pixels. The pixels don't really notice the sensor, and of course the sensor doesn't care about the programming pulses. In theory the sensor adds capacitance to the line which could affect the pixels, but, it doesn't appear to be enough to cause a problem.
What does happen, however, is a coding issue. Since the capacitive sensor is an input, the code sets the pin to input mode. When you then try to control the NeoPixels, it doesn't work. Simply manually setting the pin back to output mode fixes the problem.
The Fritzing diagram shows an HC-05 bluetooth module but we're really using an HM-10 BLE module, which has the same pinout. It also shows 4 AAA batteries but we only needed 3. Finally, the capacitive sensors are not pre fabbed ones but made from foil tape... the diagram serves mainly to show how it all hooks up. The wires are grouped to show how the ribbon cable was used.
Step 9: BLE Module
We need to configure the BLE wireless module. The easiest way to do this is with a simple FTDI programmer, which is also commonly used to program Arduino's that don't have a built in USB (like a Pro Mini, for example). You can get these for just a few dollars. You'll want to wire up the Gnd and Vcc connections to the BLE module, and the RX and TX connections but these are swapped. So the RX on one board goes to the TX on the other board. This makes sense because one board Transmits to the other board Receiving.
When you plug the USB of the FTDI into your computer you should be able to connect to it through the serial monitor in the Arduino IDE (I use the online version at https://create.arduino.cc/editor). You'll need to set the Baud to 9600 if it isn't already.
To make sure its working, type:
and hit the Send button. You should get a response with the current name of the device (+NAME=whatever). Mine was initially named BT-05 which is a different module (AT-09 *) than the standard HM-10, but in the photo you can see I've already renamed it BLT (the name is limited to 12 characters.. so "Blinky Light Thing" wasn't going to work). To rename it, type:
And then I had to reset it for the name to show up:
Because we are making multiple cubes that need to talk to each other, one of the cubes must be the "master" (or "central" in the BLE specs) and control/talk to the other cubes ("slaves" or "peripherals"). To do this, for the master we need to send these commands (the modules default to slave/peripheral).
This tells the module to auto connect (the first command) and then to be a "central" device (the second command).
My module(s) were AT-09 modules (the larger "breakout" board) with an HM-10 (the smaller board) stuck onto it. The actual chip that does all the work is a Texas Instruments CC2541. There's a lot of variations of these modules so be careful what you are ordering. You want to find genuine modules from Jinan Huamao.
Mine were also containing a firmware I could not identify, and so it did not respond to almost all the interesting AT commands. I had to reflash it to the firmware from Jinan Huamao (http://www.jnhuamao.cn/download_rom_en.asp?id=). If you end up with one of these, here's the process to "fix" it, (http://forum.arduino.cc/index.php?topic=393655.0)
Step 10: Final Wiring
For the final wiring I used a recycled ribbon cable from an old floppy drive connector. Any thin wire would work here, but the ribbon cable made it easier to keep things clean and organized. The ribbon cable is flexible enough to bend and buckle where needed.
I've used dots of hot glue to hold things down or in some places just more foil tape. The Circuit Playground is held in place with another folded bit of card stock.
Step 11: Testing
Before finalizing anything, always test things to see how it works (if it works!).
Even before assembling anything at all, I wanted to test the sensors and also the LED string. Because one pin has to be shared between the LED string and one sensor, this was the first thing I tested. This is where I discovered that it did not work, but that the reason was only that the shared pin had to be set back to an output pin after using the sensor.
The first sensor I tested was just a simple square of foil. This worked, but not really sensitive. The Circuit Playground is configured to allow capacitive touch directly to its pads (by way of a smaller resister). Unfortunately, to get more sensitivity you need a larger resister, but we can't change whats already on the board. My second test I used a circular sensor in the middle of the foil square with about 2mm of removed foil, with the rest of the foil grounded. This made for a much more sensitive sensor that worked even behind the acrylic panels.
Unfortunately, after getting the whole thing assembled but still in "flat" form, I tested the sensors again and they did not work well, requiring a direct touch to the foil. I believe this to be the result of parasitic capacitance in the ribbon cable, something I had not considered.
Step 12: Sensor Redesign
The first thing I tried was to mitigate the effects of parasitic capacitance. I realized using the ribbon cable that all the sensor wires were right next to each other, creating more capacitance. This resulted in the furthest two sensors acting together, IE I could press either one and get the same reading on either input pin. In retrospect I could have used more wires in the ribbon cable, with a ground wire in between each sensor wire. I didn't want to rewire the whole thing at this point, so, I came up with a clever solution.
Instead of a dedicated ground wire, I could change all the sensor pins to be outputs with a logic value of 0, which means they would be grounded. Then the one sensor I wanted to read would be the only input. This would be repeated to read each sensor. This helped a great deal just with a little extra programming!
Additionally, I separated the wires from the BLE module away from the sensor wires so they did not interfere.
Still, the sensor would not detect touch behind the acrylic screen. Finally, I decided that the Circuit Playground's built in capacitance sensing just wasn't going to work. It was designed for direct touch, and so it has a 1 megohm resistor on each input. Since I can't change this, and there were no more pins available, I had to detect capacitance with only one pin and an external resistor.
I added a 10 megohm resistor to each input, connected to 3.3v pin, and switched to a capacitive sensor library that works on a single pin. The reason this makes the sensor more sensitive is that the higher resistor causes it to charge more slowly, allowing for a more accurate measurement.
Step 13: Code!
The code is what makes this all work, of course. I have multiple games in mind for this cube as well as for multiple cubes. Currently I just have the simon-like game implemented. You can find the code here: https://create.arduino.cc/editor/greywire/10dfa4c0-4d8b-4104-96a1-a217c43ec732/preview
Step 14: The Final Fold
Now that we have everything attached, and tested, we can do the final folds that turn this 2D creation into a 3D cube. Starting with the long dimension of the assembly, fold the three inner folds and then put the tab into the slot, forming the main body of the cube. Glue this with Tacky Glue. Next, fold the top panel (the one with the Circuit Playground) onto the cube, putting the tabs into the slots. You should tape this in place because you will probably need to open it for reprogramming purposes.
The final side, which acts as the cover for the batteries, shouldn't be glued in, but it does need some tape or something to hold it in place. In a subsequent design it could have a locking tab that would slot into the main tab to hold it in place, like a lot of product packages use.
You now should have a fully functional Blinky Light Thing!
Step 15: The Future
This was the prototype of the Blinky Light Thing. The goal is to make several more cubes. The cubes will be able to communicate with each other and enable games played with multiple cubes, and / or multiple players. The final design should be a nice laser cut acrylic cube, or possibly a 3D printed body with acrylic panels. I would like to make this as a kit and have it be simple enough to build for a child. The LED's, sensors circuits could be built onto a flexible PCB to make it much simpler to build.
Or who knows, perhaps it could be manufactured as a toy? I need to play test it with people to see what they think. Already as a prototype I have several kids and adults wanting to play with it and asking what it is..