Arduino Leviosa
Materials used:
- Arduino Nano
- 9DoF IMU Breakout
- DC Toy Motor
- 28BYJ-48 Stepper motor
- ULN2003 Driver
- 9V Battery
- 330 Ohm Resistor (270 recommended)
- 1N4004 Diode
- PN2222 Transistor
- Breadboard
- Solid Core Connecting Wires
- Thread
- Cardboard
- Duct Tape
Software/Libraries used:
- Arduino IDE
- IMU Library
- Code Repository
Brainstorming/Prototypes
This project required use of an IMU (motion sensor) and some type of motor provided in our kits, either a Servo motor or a DC toy motor. Because of this, our ideas included those that could be accomplished with either type of motor and controlled with some form of motion input.
The first idea we gravitated towards (in no small part for it being hilarious) was an eyebrow tracker that would recognize the movement of the user's eyebrows and replicate the expression on a constructed face with moveable eyebrows and mouth.
IMUs would be attached to the user
The Servo Motors would move to match the expression relayed by the IMUs
The first issue we encountered with this idea was the user laughing too hard to make consistent eyebrow movements, which also creates the problem of having unstable mounts on the user. We also found the use of only the two IMUs in our combined kits quite limiting, as we wouldn't be able to track the user's mouth movements, and as such decided that this project would be better suited to a camera-based sensor, like the Xbox Kinect.
The next project we considered was inspired by some health issues that Louise's dog, Sophie, encountered a few weeks prior to this project. Sophie experienced some vestibular troubles, which is the part of the inner ear that controls balance. Because of this, she would walk slightly slanted, as if she was always walking on a slight incline or about to fall over.
We prototyped a stuffed animal with a paper cutout attached to a servo motor and attached an IMU to a make-shift collar.
While we found this idea cute and endearing for it essentially being a dog Life Alert system (Pup Alert), we found leaving such technology attached to a dog may prove to be a bit too unpredictable for the scope of this project. This is not to mention difficulty in distinguishing normal dog behavior, such as lying down, rolling over, from her tendency to tip, providing faulty data to the corresponding stuffed animal.
We then moved on to two ideas that hinge on the same basic mechanisms, but with slightly different implementations. The first was having an IMU attached to a dollar bill, with that same dollar bill attached to a piece of thread, which is in turn attached to a spool fixed on top of a DC motor. When the IMU senses that it is being picked up, the motor triggers and quickly rips the dollar out of the person's hand.
The fishing line would then be attached to a spool fixed to a DC motor, shown here:
Choosing the Final Idea
While we also found this idea hilarious, we didn't feel all that confident having the IMU being aggressively tugged about by the motor, nor were we certain that a user might not grip the bill too hard and create some issues in our hardware setup, so we slightly modified this idea to create a sort of simulated "levitation spell". A user would wave a "wand" with an IMU attached to it, at which point the dollar bill would levitate through the same basic spool attached to the motor functionality.
We then got to work setting up the IMU to detect motion and testing what readings it would pick up during a flick of a wand:
Research
We recorded data from both of us performing the wand movement with the IMU 5 times, as well as some control data from leaving the IMU sitting on the table and moving it around in the air as if it was being carried around normally. We then plotted this data as a way to determine what would be the best metric to compare against in order to program when the levitation should take place. Here's an example of all of the metrics we plotted for a specific wand flick, as well as the control data:
Using these plots, we determined that one of the most consistent variables to compare against was acceleration in the Z axis, which reliably produced at least two major peaks during the wand movement, and this was true across all of our performances of the spell. We also saw a strong pattern in the gyroscopic measurement's Y axis, which produced two peaks and one major valley through each performance of the movement.
After writing code to look for these value changes, we began work creating a stand on which to attach our motor/spool.
First (Semi) Functioning Prototype
Using a simple setup of cardboard, solid core wire, a plastic lid taken from a set of dice, and some duct tape, we created this first technically working version:
The reason that this only technically works is because the wand movement would cause the motor to spin like we expected, but the spool wasn't properly attached, so the spool did not spin with the pin sticking out of the motor.
First Fully Functioning Prototype
We added onto this setup with significantly more duct tape in order to properly attach all the components, as well as affix the cardboard holding the motor to whatever surface it's sitting on so that the motor doesn't cause the entire setup to move unpredictably. We also swapped out the wires connected to the motor to use longer solid core wires so that the wand has more of a range of motion. We then attached a few feet of thread to the spool and subbed in a 5 dollar bill for a feather since we didn't find the time to hunt for any ducks along the Tennessee River.
Video Demonstration
Improving the Motor/Spool
While this technically functioned, we found working with the DC motor without having a compatible driver to more precisely control its speed a bit obtuse. For this reason, we pivoted to using a stepper motor in its place. This allowed us to turn the spool much more slowly, creating more of a graceful levitation effect. The stepper motor also has a rectangular pin that spins rather than the perfectly round pin attached to the DC motor, making it easier to affix items to it. Because of this, we created a more reliable spool with a large diameter, so that we could physically control the speed in which the thread would be pulled up without having to worry about the limitations of the stepper motor.
We then began working on connecting our new motor to the IMU wand, and quickly realized that the mess of wires would most likely require some sort of housing in order to be manageable.
After finding an appropriately-sized box, we affixed the motor stand to the inside, as well as puncturing a hole in the side with the pencil to act as a stabilizing mechanism for the spool.
Comments
Post a Comment