hello.build — what the hell is arduino?

Per Mike’s request, here’s some background info on Arduino. Here’s the best intro I’ve seen courtesy of DIY rockstar Bre Pettis. Seriously, this thing is super easy to get started with, even with zero programming or electronics background. Once you run through a few tutorials, it’s pretty easy to get to work on your own ideas, like dot matrix drum machines and remote dog treat dispensers. A great way to spend 30 bucks.

hello.build — dot matrix drum machine

Post one on my latest Arduino project. The goal: get a dot matrix printer and turn it into a step sequenced drum machine using Arduino as the brains….

Last week I acquired the dot matrix printer for free off of a Craigslist posting from Brisbane’s city hall, which is close to my office. This thing weighs about 50 pounds, but it’s perfect for the job. Tonight, I spent a few hours stripping the data cable down to bare wires and tagging each wire with its corresponding pin on the centronics parallel connector. It was a bit tedious, but had to be done. Tomorrow I’m hoping to actually plug these wires into the microcontroller to find out if I can control the printer. Stay tuned…

Dot_Matrix_Machine

Dot_Matrix_Cable

The idea isn’t exactly new, but I wanted to give it a try myself… here’s a really great example of someone re-purposing old computer hardware as an instrument:

hello.build: iPhone Theramin

Here’s a simple use of the touchOSC app and Pure Date to turn the iPhone/iPod Touch into a Theramin of sorts. Feel free to download the Pure Data patch and try it yourself! Some basic instructions to get it up and running:

-You need to download and install Pure Data (free) and touchOSC (a few bucks) on your computer and iPhone
-Get your computer and iphone on the same wi-fi network.
-Open up the Pure Data patch on your computer and make sure the audio is turned on under the menu “Media” >> “Audio On”
-Open up TouchOSC and make sure the accelerometer setting is turned to “On”
-In the Host IP Address menu, you have to enter your laptop’s IP address. To get this, go to your computer’s Network Preferences and choose your wireless connection, click “Advanced”, choose the “TCP/IP” tab, and you should see the IP address there. Enter this number on the TouchOSC “Host” entry box
-Choose any of the layouts, and click Done

Now you should hear the Theramin from your laptop speakers, and you should see a stream of accelerometer data printing on the PureData screen…

Give it a shot and mess around with the numbers 20 and 440 to adjust the scaling (20) and center pitch (440, A). To edit the numbers, you have to be in Edit Mode, which you toggle on and off by pressing command-E.

hello.build: hello world… servo style

Wow- it’s been a long while since my last post, but I’m back to present the first post in a new series: hello.build. This is where we’ll track our progress on some hardware projects we have in the pipeline. More on that soon…

I recently picked up an Arduino, which is an open source microcontroller platform created to make it easy for people to enter into the world of physical computing. Just do a quick You Tube search for Arduino, and you’ll come across tons of really great projects. With a few easy-to-follow tutorials from Make, you can really do a lot of cool stuff.

Tonight, my goal was to get a servo motor up and running, controlling its position with a potentiometer. Here’s the code:

—————

//Hello World, Servo Style!

#define SERVO 9 //The servo is hooked up to PWM output 9
int pot; //Pot is an analog potentiometer input
int servo_position; //This is what value is going to get sent to the servo

void setup(){
pinMode(SERVO, OUTPUT); //Set the servo as an output
Serial.begin(9600); //Open up a Serial Communique so we can see data
}

void loop(){
pot = analogRead(0); //Read in the value of the knob
servo_position = pot/4; //The analog input reads between 0 and 1023, and the PWM
//output needs values between 0 and 255, so divide by 4.
Serial.println(pot); //let’s print what we read in to the computer screen
Serial.println(servo_position); //lets see what value we are going to send out
analogWrite(SERVO, servo_position); //send out the position to the servo
}

—————

And here’s a video of the result: