blog.dfyb justin pierce
Categories: emedia

Arduino and accelerometer breakout board

My accelerometer from SparkFun came in and I have it hooked up to my Arduino. Accelerometers measure g-forces, or movement in 3D space. They allow the Wii and Playstation 3 controllers to detect tilt and movement and are also found in many other electronic devices (iPhone, digital cameras, et al).

close-up of accelerometer breakout board
Here’s a close-up shot of the accelerometer on the breakout board. X and Y pins on the accelerometer go to the 0 and 1 analog arduino pins. GND to GND and VCC pin on accelerometer to 3V3 pin on arduino (or 5V pin, depending on the specifications of your accelerometer).

single axis readings from accelerometer in HyperTerminal
Here you can see a stream of data being sent by the accelerometer for a single axis. This is the raw data I’ll be using in my digital wind chime.

Here’s my arduino code:

int xVal, yVal = 0;

int xPin = 0;
int yPin = 1;

void setup() {
Serial.begin(9600);
}

void loop() {
xVal = analogRead(xPin);
yVal = analogRead(yPin);

Serial.println(xVal, DEC);
//Serial.println(yVal, DEC);
}

Notice that I currently have the lines to print y values commented out — this was to keep the serial output readable. The digital wind chime could potentially read both x and y values and translate them to different audio effects, but I may find that one axis is sufficient — this would simply things and also free up precious analog pins on the arduino; for each analog pin I have available, I can track the movement of another separate chime without having to use an additional arduino for the project.

Categories: emedia

My first new media project was the Digital Wind Chime — it would detect contacts between the ‘chimes’ using magnetic reed switches and produce digital music. I’d like to make an updated version, so I’ve been doing some preliminary brainstorming about how it could work and what it could look like.

One disadvantage of using magnetic reed switches was that they were magnets, and as they’d be attracted to each other, they’d have an effect on the free movement of the chimes. Another disadvantage with my original method was that they’d need to contact in relatively specific locations in order to be triggered.

The solution I’m currently pursuing uses accelerometers. These detect acceleration on 2 or 3 axis in space (2 should be sufficient for my needs) and I can use these not only to detect contact between different chimes (by recording sharp changes in g-forces), but I could potentially also detect subtle movements that don’t necessarily involve physical contact with other chimes. This would allow me to make a more dynamic digital wind chime. Each chime would house an accelerometer.

With the original prototype, I had used a hacked keyboard PCB. Because it’s a digital device, it either detected on or off — no in between. Accelerometers can provide analog signals and I’ll be using an Arduino to read these. I can then have the Arduino board send these figures to custom software running on a PC, which could then translate them into music. Subtle movements could trigger a more ambient sound while sudden jerks (contact between chimes) could trigger a more pronounced sound — I could also potentially differentiate between the X and Y axis to get more variation in sound output. The Arduino has a limited number of analog input pins, so it’ll be a challenge getting multiple hooked up to a single Arduino. I may need to make some compromises — perhaps only tracking a single axis of movement for each accelerator/chime, or using analog accelerators for some chimes and digital accelerometers for others.

As for the physical design, I’ve only barely started to throw around some ideas. Because my chimes don’t actually need to have acoustic qualities, I have a lot of flexibility and I’d prefer to have the device appear very different than a typical wind chime. I’ve been looking at designs for hanging mobiles and other hanging sculptures for inspiration.

Digital Wind Chime Prototype Design
This is one prototype design I’ve sketched in Maya. The tubular components would be painted PVC pipe with colored LED’s inside to give visual feedback. I could potentially employ the color fading code I was using in the LED array project. I’m not satisfied with this design though, and I’ll post other design sketches I make and any progress I make on the blog.

Categories: news

I have many possible projects I’d like to work on during the winter break, but I know I won’t be able to complete all of them. Hopefully I can get a few of these done before school starts back up.

I was having trouble keeping up in my Japanese Adv Language 3060 class, so I’m going to try and review a lot of it over the break. I want to create a quick reference sheet for myself — a few pages with kanji, list of grammar patterns, and some vocab etc. I’ll also be attempting to play an import copy of Persona 4 for extra practice.

Persona 4

This will be hard to do, as the game features quite a few kanji I haven’t learned. I’ve already learned a couple more kanji just with context clues or listening to the dialog and comparing it to the text, so hopefully that trend continues and I don’t get too lost with the game’s story.

LED project

I’d also like to continue working on my interactive LED array. Currently, I have code that can change variables that dictate color-change-frequency and color fading working on two LED panels with 3 LEDs each. I’d like it to adjust the LED color change speed based on the tempo of the song, but that may prove difficult to do within arduino code alone — I’d like to avoid using any Processing, so that I can make this a standalone product that doesn’t need to be connected to a PC to function.

There’s a couple simpler projects I’d also like to do. One is a physical hit counter for my blog. I helped Christina set up hers, so it shouldn’t be very hard at all to get my own running by following the tutorial she found here.

USB station sketch

The other thing I’d like to build is a simple USB station that would sit on my desk. I use a lot of USB devices and I keep my ToDoList on the thumb drive I have on my keychain. It’s annoying having to bend down to plug it in every time, so I’d like something on my desk. I’ll check out some miscellaneous project cases at Tanner’s Electronics to see if any of them would work. I’d keep it simple — probably just have my USB hub sit inside and, using cheap USB cables from monoprice, secure the USB ports to the walls of the box. I might also have one USB port come out of the station with its own cord.

My quick fix for the audio cords I had done is falling apart — I had simply used the screws to secure the wires, but I’m going to go back and properly solder them. Might use this as a chance to update the tutorial with more pictures and details.

I also need to reformat PC for a fresh start, but this time I want to make sure and create a recovery state with my most used software installed — this way, instead of starting from scratch every time I reformat, I can start with my basic needs and save a lot of time.

And lastly, I’ll be trying to work on some of my game projects. I have a few 2D games I’ve been working on, so I may try to pick one to finish over the break.

Categories: game news

LBP

http://sackbook.com/

You can link your PSN ID to the sackbook website and fetch the screenshots you’ve taken. You can also browse levels and all that good stuff.
…To check out more pictures, click here!

108962