For our Halloween-themed mid-term project, Louise Lessel and I made a wand that draws dripping blood onto projected background image. When you blow into the end of the wand (magic flute?), blood also splatters onto the screen - how much depends on how hard you blow.
For this we had to use the following sensors and equipment:
Arduino Pro Mini 328 - chosen for its small size which fit into the wand
Adafruit Bluetooth EZ-Link - for wireless serial communication
Adafruit’s 9-DOF Absolute Orientation Sensor - used to get the wand’s pointing direction
Modern Devices’s Wind Sensor Rev. C - to measure the MPH of wind blown at the end
Conducting Fabric - to turn the drawing tip on and off
Momentary Button - to reset our microprocessor and clear out drawing
If you want to see the javascript and Arduino code associated with the project, visit the project on Github.
The first thing we wanted to do was make sure each sensor was working in such a fashion as we could extract a useful value out of their outputs. So we coded and tested each part discreetly before putting it together. For the Wind Sensor, I was able to find good documentation and a Arduino code example from the manufacturer’s website. The wind data was translated into floating point MPH which was easily useful. The wind sensor took some calibrating as it has a “Zero Wind Adjustment” which you establish with the sensor covered. But once this was dialed in, the sensor worked very well. The unit also has a temperature output which could be more useful if the wand is being waved around quickly. If the temperature goes up, you would know whether someone is waving the wand or blowing from the heat of their breath. You can see it in action below.
For the orientation sensor, Louisa made a great blog post. We had first used a knockoff BNO055 from Tinkersphere, but Louisa found the outputs were quite difficult to make useful. The Adafruit 9-DOF AOS, of the same BNO055 part number, came with ample online instructions was able to do a lot of the difficult math in the code and output intuitive, useful values without a lot of manipulation on our end. She was able to extract rotational motion along the X and Z axis' which she mapped to X and Y values of our p5 sketch. You can see a video below of a the accelerometer on the breadboard and see the interaction.
Louise also did a lot of work getting the p5 sketch to draw the blood and have it drip. You can see a demo in the video below as well as the code for the sketch.
Size was a consideration in the design, even though the layout wasn’t as small as we would have wanted in the end. Mounting all of the hardware was a big challenge as once things come off the breadboard, they have to be wired point-to-point and secured in place. I used a number of stackable headers to drop the hardware into and mounted these on a narrow strip of acrylic. The stackable headers were nice because they could be bent at 90º angles and taped at the female end to the acrylic. This way, I could pop out my boards as needed. I used wire wrap (tool and wire) to connect the most of the analog and data pins. This way I wouldn’t have to solder any of the hardware pieces, as this was a prototype. As such, there were a million stray wires that were pretty cumbersome to wrangle. A PCB layout would be ideal for a permanent design. Below you can see the skeleton of the wand with all the blue wire-wrap.
For distributing the power connections, I used a thin strip of perf board that I scored and cut to size. I had to sand down to size in the shop as the edges were pretty rough after snapping off the edge along the scoring. I knew I didn’t want the grounding and power rails exposed lest something short, so I made the power board small enough to fit inside a larger piece of shrink wrap. Below is a breadboard diagram of the whole circuit.
Future plans: While we stuck to the Halloween theme, the applications are endless once you get the wand working in p5. Whatever can be mapped to a value can be controlled essentially. I would like to use the wand as a musical controller, using the drawing mechanism to choose between notes with on-board buttons to jump a 5th or octave or bend notes.