Gyroscopes! Infrared LEDS! Sounds! Balls! YOUR WILDEST DREAMS!

I dealt with a few things this weekend, so I’ll just start at the top.

Wireless Gyroscope

It looked like this, but with more tape.

Last week in class, I started working on making my gyroscope in the ball wireless. Lief was kind enough to lend me an xBee since one of mine was dead (discovering and confirming this fact wound up eating many hours unfortunately). I did get the ball wirelessly transmitting a good approximation of its velocity, though.

Ugly, but self contained.

Some lessons learned here:
-Shaping the foam is going to be hard. Cutting out a space for the arduino and all of its parts/power supply/wires/sensors was pretty messy in terms of getting everything to fit right. This definitely needs to be carefully considered.
-Baud rate matters. Transmitting at the standard 9,600 proved to be way too slow. At Lief’s suggestion (thanks again!) I upped it to 157,600 which seemed to work much better.
-I need to consider how the balls are turned on or off. There will need to be some kind of switch accessible on the outside of the ball or the battery will just die. This is fine for testing, but definitely needs to be adressed

The next step for me was getting the whole thing running with my openFrameworks sketch to really track the incoming data in a useful way. I tried getting OF to read from the serial port the xBee was attached to, but this kept causing my computer to lock up. I suspect the increased baud rate may have had to do with this, but I’m sure it can be done.

IR Sensors

Testing the Radioshack (left) and Sparkfun (right) LEDs


I played around with the IR sensors and emitters I got from Sparkfun. I had two types of receivers, an emitter, and some plain old IR LEDs (both from Sparkfun and Radioshack).

Sparkfun IR Receiver Diode
This one was pretty easy to rule out: It turns out that this devices receives and interprets pulse signals from IR devices (such as remotes) and sends them to serial. While this may be cool, it is not useful for what I’m doing.

Sparkfun IR Reciever
This worked pretty well. The further away the IR source was, the lower the value returned. The scale was completely exponential and will need to be linearized in order to be used to estimate distance, but that’s just a matter of popping some readings into Excel. One problem, though, was that sunlight would cause noise, essentially placing an artificial cap on the distance that could be read. If the IR source was far enough away that the natural light IR in the room matched or exceeded the strength, it would be lost.
Also, these are only sold with the emitter, which I really don’t need. I’ll have to try and find a source that sells just the receiver.

LEDs
The Radioshack and Sparkfun LEDs performed at about the same levels. They were both very directional, but could get results from about 5 feet away under reasonably good conditions.

Sparkfun IR Emitter
This worked alright, but I found the LEDs to be both stronger and definitely cheaper.

Amusingly, testing to make sure the LEDs were even on became complicated since I can’t see the light myself. Luckily, my phone can, so I generally had the camera out so I could point it at the LED and see if it was on.

Putting it in a ball


The next step was to take my LEDs and put them on the perimeter of a ball. I only have 6 LEDs at the moment (another 100 are on their way), so I decided to try to put them all in one ball. This proved harder than I expected. Wire wrapping them resulted in mysterious shorts. I tried using the jumpers, and although they are way longer than I needed, which became a problem when trying to close the ball, they did keep their connection fairly well.

The finished ball was somewhat oblong and certainly ugly, but it had 6 functioning LEDs so it seemed good enough to test

 

The ball with the test receiver.

I do not have enough receivers at the moment to make another proper ball with them, so I just used one, raised to roughly the level it would be on a ball. The tests were not amazing. Moving the ball around, the receiver would pick up one of the LEDs occasionally, but not all that often. In writing the code, I will have to account for the fact that 99% of the readings will be noise and should be ignored and that even if two balls are close, they may only register as such some of the time. The balls will have to have some memory of the balls that are around them during these periods of blindness.

Brainstorming

I’m trying to think of more ways that the user can interact with the sounds. I spent some time trying to think of different types of balls that could be incorporated. Most of these balls would use a gyroscope to determine speed, and IR LEDs to let other balls know where they are. Not all of them would need IR receivers, though, as not all of them would need to know their own distance from other balls.

OF sounds

Next up was trying to create an interactive prototype in OF of how a few of these might work with each other. The user just drags the balls around, similar to my last prototype. In this one, the balls make sounds on any impact regardless of if it is with the walls or another ball. Right now, the impact detection is a little imperfect: some movement sets it off by accident. For example, moving a ball in a circular motion will set it off consistently. I’ll need to work on this

The balls function as follows:
Teal-Normal- Whines when moved and makes chimes on impact. The pitch of these sounds are based on its distance from the other balls
Blue-Heavy- Makes deep, long sounds
Red-Tiny- Makes high, quick sounds
Black-Drum- Makes drum kit sounds. The velocity on impact determines what sound is made.

Here’s the code if you want to play with it.

Parts I need

As always, there are more parts I need. A few things I’m orderring:
-Small breadboards. My big ones do not fit in the ball, making it hard to work with
-Small Arduinos. A few Ardweenys are on their way.
-Shorter jumpers. These have proved really useful for testing these balls, but the 12 inch length is making them hard to work with
-More foam balls!

Those are just the things I need right now. Other bits like a few more gyroscopes and xBees will come into play soon.