subscribe to my newsletter!
contact: geoffroy tremblay | gef@ponnuki.net | 514.303.2647

arduino


k-12 presentation

June 19th, 2010 — 4:40pm

I know it’s been a month now that I haven’t blog! Too much is happening here – from wordpress moving to version 3, to my come back to school (in information technology) to all my project moving forward, and summer kicking in ~ there wasn’t much time left. I also prepared a introduction to processing and opensource technology for computational art for a k-12 school, and that was really fun, read more below!

Last week I went to do a presentation to a k-12 school here in Crawford Bay. Since I started learning processing I realized how helpful that could be for the new generation to learn an easy way to program. Learning processing (and programming in general) also merge all the mathematical knowledge you have, with a solid foundation in problem solving and computer usage. I feel that if programing was re-introduce in school, it should build on processing.

I started programming on vic-20 and never really wanted to learn programming language until I discovered Processing. So I tough that giving a presentation to a k12 school would be really interesting. Like many k-12 school in small villages, there is not many students, and keeping the school alive becomes quite a problem compare to urban schools. To remedy this, the director of the school, Dan Rude, and the teachers there decided to open up the doors for Mentors to come and help inspire the kids. I grabbed that opportunity to present Processing and Arduino, with a quick overview of pure:dyne and how can kids benefit from open source technologies.

I presented most of my project that I posted here on ponnuki, from the fish pond, to the spaceship game, to the video cam project to controling processing with a Nintendo DS (upcoming post about that) and creating a video animation with processing and using the arduino to do a laser show. I wanted to give an example of all the inputs that can be used in processing to give a solid foundation about all the possibilities that opens up when learning a programming language.

The video you see here is an integration of audio in processing using the minin library. As you can see the music is not too much in sync with the sketch ~ it’s probably due in part because of my computer power (yes I will get a more powerfull machine for your eyes pleasure in the spring) and also processing is not optimized for audio.

In the future for project that binds audio with visual I will research more about pureData feeding osc into processing, for that presentation I didn’t have much time to come up with something visually appealing. You can see that I added some Penrose system and snowflake (the green structure growing from the center), two example that are part of the main processing installation.

audio – processing integration from Geoffroy Tremblay on Vimeo.

It was great to see the kids enjoying the presentation, and I hope I will be able to mentor one or 2 of them in a video game/ multimedia creation next year! Meanwhile I continue my Processing quest!

3 comments » | arduino, processing, programming

2nd step DIY audio mixer processing & arduino

April 25th, 2010 — 6:12pm

I created my first prototype of the mixer. It’s more an experiment than a prototype from the fact that I only attached 6 knob to the arduino to start with.

Here are some picture of the making of the mixer. I used a normal plastic project box to do the trick, to give it some sort of finish to the product. Using hand drill and bee wax and my main tool (yeah I know really professional !) I glued the knob in place.

The main part of the experiment was to link the mixer to output to the computer. The first layer is the physical knob, then the arduino chip then processing. For the processing – arduino communication there is already a library. You can load a firmware in arduino (firmata) that helps the communication. Then in processing you can load the arduino library. By the way, the default library you can download from arduino site has an error. The library is named Arduino.jar, which gives you an error if you try to load it. You have to rename it arduino.jar, without the capital in order to make it work. (using pure:dyne I got an error renaming the file, I had to rename it to something else first then to arduino.jar – the file system assuming that Arduino and arduino is the same thing it wouldn’t let me rename the file!)

Here is where you can get more information about the arduino processing http://www.arduino.cc/playground/Interfacing/Processing. Make sure to rename the library in processing ~ there was a problem at first with the arduino library having a capital letter at the beginning…

Once that is installed properly I tried an example program and then modified it to my need. I wanted to have a visual that would translate a better more the knob feeling. It’s also a very simple example of popMAtrix and pushMatrix and rotate function. Here the push and popMatrix are used to prevent all the knob to be affected by each other rotation – while it was kind of fun to rotate the whole canvas!

import processing.serial.*;
import cc.arduino.*;

Arduino arduino; // new arduino object

void setup() {
  size(470, 280);
  smooth();
  arduino = new Arduino(this, Arduino.list()[0], 57600);

  for (int i = 0; i <= 13; i++)
 {
    arduino.pinMode(i, Arduino.INPUT);
 }

}

void draw() {
  background(0);
  stroke(255);
  strokeWeight(10);
  noFill();

  for (int i = 0; i <= 5; i++) {  //cycling trough the 6 analogue input

    pushMatrix();

    translate(60+i*70, height/2);
    rotate(arduino.analogRead(i)/30); // Rotating with the analogue in

    ellipse(0,0,60,60);   // Creating the knob
    line (0,0,0,30);

    popMatrix();

  }
}


Here is a simple video demo of the mixer in action, next step is to try it out with puredata just for the fun of it and soon will be the test with the USB64! The Doepfer usb64 seemed to be quite a challenge at first (I haven't done soldering for years - I think the last time I did I was around 12 !!) but I finally got a hang of it ! Stay tune for part 3 of the DIY usb audio mixer!

Comment » | arduino, music, processing, programming

diy audio mixer prototyping with arduino and processing

April 3rd, 2010 — 3:43pm

So here is my first step into my plan to make my own mixer. The idea is in the next few months I want to built a complete USB mixer (I say months not to get anyone hopes to high ;) )t . This mixer will be used to play with mixxx, which by the way will paticipate in the next google summer of code, where young programmer are giving the opportunity to code for few weeks on a certain project. These events in the past has help mixx to become quite solid mixing engine with a lot of neat feature and I am quite happy that it will again have a boost of new codes. That makes mixxx my prefered software for mixing – even if it’s not as solid sometime as other pro dj software – it’s open source and really easy to configure with a diy mixer for example :).

I chose Mixxx because it’s open source, it work on puredyne really well (far better than on ubuntu and a lot less ressource intensive than on mac) and work really well with my netbook with a 7inches screen. It’s also feature full and the midi mapping is really simple and kool.

The hardware I choose is the USB64 from doepfer that offer 64 connections that talk directly in MIDI trouh it’s usb port. But I soon realize that Doepfer make dyi gear that are not aimed toward the beginner in electronic, so my first step will be to start prototyping the device with my arduino mega board a sensor shield and 6 knob, 5 fader, some buttons and led.

One of the problem with arduino and midi is that the device itself is registered by the computer as a serial device, which create the needs to have a driver or a software that translate the serial output to midi output. I will probably use Processing to receive these serial message and display them as visual entry, or I might move that project to puredata ~ we will see what make more sense, puredata seems to be built to receive serial inputs, but I am more familiar with processing for now.

Once the prototype will be created and I will have some sort of casing and figured out the interface, I will jump on the soldering an cabling of the USB64.

Stay tuned for the development of this project, meanwhile enjoy some gear porn with these pictures of the parts I will be using. To keep it simple I got some pre-assembled knobs and fader that will connect directly to a sensor board that connect to the arduino mega. It’s a solder free prototype so I can focus on the software implementation.

Comment » | arduino, music, processing, programming

arduino & laser

March 22nd, 2010 — 9:41pm

This is a real beginner post – if you never played with arduino and laser you might find it fun, but it’s at the ‘hello world’ stage of arduino programing.

So I got myself some laser! I had a nice kaleidoscope green laser but I wanted to temper with it and ended up breaking it… Green and blue laser apart from being quite a nice colore laser, are really expensive. So I decided to buy some red laser to start with.

The Laser have 3 main component. The diode, which emits the light, the lens that focus that light, and the driver or the electronic component that help regulate the electricity to the diod itself, that is quite fragile by the way. My first instinct was to purchase the diode themselves, but realizing that there was some extra work needed to make them work for me, I also bough some more complete laser with the drivers and lens. Long story short I got some diodes, and some complete kit.

My plan is to create a device with arduino to have some sort of laser show. The first step was to connect one laser to the arduino board and see what are the posibility. Using the kaleidoscopic part of my other device I was able to put it on top of the laser.

Now the hard part is to find what can be interesting using only one laser and no motions control. Blinking feel too much like christmas light, strobing could be interesting, but can become annoying after a while, pulsating could be interesting… So the base is the arduino control over analogue port. A loop and analogue write.

Of course the most interesting would be to link the arduino react on the music rhythm, but that is a bit further down the road. I’ll tryout the basic arduino loop to create something interesting. The first thing I try was to simply input digital high and low – that was simply to make the laser blink. Using the digitalWrite to simplify the process. Later I started to play more with the analogue setting. I tried all I could with the blinking but the red blinking light was really resembling christmas light.

void() loop {
digitalWrite(LASER, HIGH); // turn the laser up
delay(120);                             //wait for a moment
digitalWrite(LASER, LOW);// turn the laser down
delay(120);                            // wait for a moment
}

So that wasn’t it. I tried modifying the delay, the pause and the length of the high value. Strobing was also an interesting effect, since the laser is connected to a kaleidoscope, but again not the effect I am looking for.

Adding random to the code made it a little more interesting

void() loop {
digitalWrite(LASER, HIGH); // turn the laser up
delay(int(random(1,100)));                             //wait for a RANDOM moment
digitalWrite(LASER, LOW);// turn the laser down
delay(int(random(1,100)));                            // wait for a RANDOM moment
}

That created an interesting effect. It started to give some sort of rhythm… but there is some sort of beat that is not there. Moving into the analogue realm I only started playing with fade in and fade out, as you can see, I didn’t get very far:


void() loop {

for ( int i =0; i<1000; i++)
{
analogueWrite(LASER,i);
}
delay(20)
}

Nothing very fancy, but I tried to match this with a fade out - creating another for loop. Again the effect is interesting - not too exciting but getting somewhere. And... that is where I got! If you have any idea what can be fun ~ I am giving up for now until I find more to do with arduino programming. I have also ordered some servo or controllable engines to give more flexibility with the project. Also I will be looking into the music integration where there could be some sort of reaction to the music from arduino, but that seems far down the road.

Comment » | arduino, programming

thinkering with arduino ~ lcd monitor and some knob

February 20th, 2010 — 3:24pm

So I’ve been playing with an arduino lately – with the help of pure dyne to connect to it.

The arduino is a toy for hacker – for hardware hacker or electronic enthusiast. I got it on ebay with an lcd screen with it and since I am starting to built a midi mixer (with some doepfer diy kit) I wanted to test some knobs and pots actions.

I’m not at the point to send signals from the arduino to the computer just yet – I am sure it’s not hard but haven’t been there. So in order to test any knob action I decided to use the lcd. To make thing even easier I bough some premade potentiometer with a shield that connects the potentiometer to the arduino. I agree that is being really lazy because when you start using the arduino you find quite early that connecting a switch or a potentiometer is the ‘hello world’ of arduino, or in layman term ‘it just take 3 wires and a resistance’. Cutting the crap here is what I did:

  • arduino mega board
  • 9v battery connector
  • shield for knobs and sliders
  • LCD shield to show the result

Without any idea of what I was doing I made a sandwich with the 3 board, stacking the sensor shield in between the arduino and the lcd shield, then connecting a knob to the first connection. I loaded the default example that comes with the lcd screen. At first the button on the screen wouldn’t work anymore. I realized that it was connecting on the same ‘in’ as my potentiometer. So playing around with the potentiometer I saw it was changing something on the screen! Hurray!

Hacking the example a little, to create something that make sense I ended up prototyping a volume knob that would indicate the level on the lcd screen. That was fun!

It was fun to realized that the shield are stack-able. Of course at this point this system is not usable it was mostly to test the interactivity with some knob action. Since I got an Arduino I can’t realize how easy it is to create fun stuff. This is also my first step at creating a complete usd midi mixer system to work with Mixxx

Comment » | arduino, programming

arduino + puredyne + netbook = fun

January 29th, 2010 — 2:24pm

pure-arduino

So I received my first arduino board, right after I successfully installed puredyne on my eeepc.

Puredyne is a wonderful system optimized for multimedia creation and computer art. It’s filled with all the linux tools to play music, program, edit images, video, audio. Loaded with pure data, super collider, processing and arduino to name a few – there is also a load of soft synth, dj mixing tools, multimedia player and also the basic file system and web browsing. It’s built on top of Ubuntu karmic koala so it offers quite a solid architecture while offering a good user interface and easy customization. It’s built with xfce instead of gnome in order to minimize the resources usage of the system, keeping the computing power of your machine for multimedia task.

puredyne Systems like puredyne are mostly created for a certain type of user, a user that care more about the power of the tool than the presentation, artist and thinkerer. When an artist is painting – he doesn’t really care if the paint container is nicely label, he doesn’t care if the studio he works in is a mess an located in an industrial building – what is important is that the tool respond to his or her creative impulse. That is what puredyne is, an artist tool crafted to be as powerful as possible for the computer artist.

It’s interesting to note that in this time of computing, where we rely more an more on browser based system, cloud computing and ‘thin client’ (sorry kids if you don’t get the thin client story… cloud computing has been around a lot longer than last year), I am asking why would we waste computer power on the user interface and the graphical system itself, the only real need is the multimedia factor of your machine. Operating system like puredyne is a really logical move in the overall operating system evolution.

0000003_300Arduino is, in short, a prototyping electronic device that you can program from a simple interface. Since I started learning processing, I was interested in Arduino since you can program Arduino with processing. So the processing-arduino integration provide a complete interactive creative system for computer artist. Arduino bards are pretty inexpensive and easy to purchase and they’re also modular, you can plug them in different shield (proto board that add to the main board) to create what you want to create, from controller to musical instruments.

In this example I used a lcd-keypad module from ekitszone.com directly on a arduino mega board. Every add on to the arduino needs some library and if you get boards that are minimally maintained you shouldn’t have much to worry. In this case I simply had to download the library from ekitszone and add it to my arduino library (opt/arduino/hardware/) and there were even example to get me started on that.

Where is it all going ? I feel with the learning of processing, arduino and my recent acquisition of electronic music devices there is something being blended together for my creative expression to flourish in some way. Hopefully something fun will come out of all that – but it might only be to keep my brain alive ;)

happy hacking!

Comments Off | arduino, programming

Back to top