How to build a DIY 3D tilt sensor Bluetooth HID controller
Fun, educational to build, and a bit like magic. Check this video of the DIY 3D tilt sensor hooked up to Philips Hue. The project is designed to be made in a FabLab (Zürich represent!) with a laser cutter, a 3D printer and a soldering iron. Because the project is based on Adafruit's Bluefruit EZ-Key, no programming is required.
https://www.flickr.com/photos/tamberg/13939001466/ (switching animated GIFs)
https://www.flickr.com/photos/tamberg/14034330334/ (controlling the Philips Hue connected light bulb)
- PLA in 6 colours
- gray acrylic, 3mm
- 24 copper nails, 2.5 x 25 (e.g. on eBay)
- 1 aluminium ball, 20mm diameter (e.g. on eBay)
- 10 jumper wires, F-F (e.g. http://www.adafruit.com/products/266)
- some hookup wire (e.g. http://www.adafruit.com/products/290)
- 1 3.7 V LiPo battery (e.g. http://www.adafruit.com/products/1578)
- 1 LiPo charger (e.g. http://www.adafruit.com/products/1304)
- 1 Bluefruit EZ-Key module (http://www.adafruit.com/products/1535)
- a used 1" bike inner tube to make DIY rubber bands
- 3D printer
- Laser cutter
- Soldering iron
- Heat sink (e.g. a clamp)
- Pliers and a wire stripper
Step 1: Idea, prototyping and iterations
(This step documents the development process and can be skipped.)
The goal was to build a cube that is aware of its orientation in space (or at least which side points up), without using an accelerometer.
Standard 1D tilt sensors are not much more than a ball in a tube, so I thought this could be generalised to three dimensions. Note that using three 1D sensors would probably not work, as many orientations would leave some of the switches in an undefined floating state.
So the idea was to force a single ball to the side of the cube pointing down. As in the 1D case gravity is your friend here. All you need is an inner chamber holding the ball, with one vertex per side of the cube.
To test the idea a quick "cut-away" cardboard prototype was built. This seemed to work as intended, so I started designing the cube in Sketchup. Only then I realised that the inner chamber is not a cube, but an octahedron.
To test the switch (made from nails) an improvised aluminium ball was used with an LED and a battery.
It's often hard to get everything right in the first try.
In this case it turned out that the size chosen for the cube and chamber did not allow enough space for the electronics. Also, the thick acrylic took too long to laser-cut. An additional iteration was needed to add small cuts for the rubber bands holding everything together. The solution is simple: iterate until it works.