Instructables
Picture of DIY 3D Tilt Sensor

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.

Cheers, @tamberg

Video

https://www.flickr.com/photos/tamberg/13939001466/ (switching animated GIFs)

https://www.flickr.com/photos/tamberg/14034330334/ (controlling the Philips Hue connected light bulb)

Material

- 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

Tools

- 3D printer
- Laser cutter
- Soldering iron
- Heat sink (e.g. a clamp)
- Pliers and a wire stripper

 
Remove these adsRemove these ads by Signing Up

Step 1: Idea, prototyping and iterations

Picture of Idea, prototyping and iterations
13386270185_caeaf625e1_z (1).jpg
13392732963_974a18619e_z.jpg
13892113925_2dd4fdbfc3_z.jpg
13949807655_aea89f250e_z.jpg

(This step documents the development process and can be skipped.)

Idea

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.

Prototyping

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.

Iterations

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.

akshay19981 month ago
cool
wilgubeast1 month ago

I love it when people share DIY sensors. I also have a soft spot for pennies. This is perfect.

You even cleaned it up with an enclosure and everything! 10 stars. Would read again. :D

tamberg (author)  wilgubeast1 month ago
Thanks! Glad you like it.