View My Stats
Showing posts with label Bill Turkel. Show all posts
Showing posts with label Bill Turkel. Show all posts

Wednesday, February 3, 2010

A motor is not a potentiometer… the more you know.

In IED we have been experimenting with Arduinos and physical computers. For one exercise my colleague Jordan Goldstein and I attempted to work a motor with a potentiometer and pulse width modulation. After some confusion between what was a motor, what was a servo, and what was a potentiometer we eventually were able to get a servo responding to the potentiometer.

Controlling a servo with the Arduino (sweep)

Since we first had difficulty with the potentiometer, labouring under the assumption that the motor was actually the potentiometer, we first experimented with controlling the Servo directly with a programming language.

We had : a Servo
Arduino
Arduino software
Breadboard
several jumper wires

Taking the servo, we connected the red wire (positive wire) to the 5V Analog pin on the Arduino, the white (input) wire to the 9 pwm pin, the black to the GND Analog pin. Then we uploaded this code to the Arduino:

// Sweep
// by BARRAGAN

#include

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}


void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}


This code can be found in the Arduino Program, under Examples, then under Servo. It is called Sweep. If you do this then the Servo begins to rotate back and forth from one position to another.

Controlling the Servo with the Arduino (Knob)

Having figured this out we played with the length of the delay by changing the value of delay(15). We also experimented by changing the value of pos, and pos+ and played with the speed of the servo.

Once we understood this, and had found an appropriate potentiometer, we attached the potentiometer and servo to the breadboard, and used the potentiometer to control the movement of the servo.

First we attached the potentiometer to the breadboard, then ran one wire to the Analog 0 pin on the Arduino. Then we attached the positive wire to the positive input on the breadboard, and the negative to the negative output on the same breadboard.

Then we attached the servo to the breadboard. The white (input wire) from the servo was connected to 9 PWM pin on the Arduino. Then the positive was connected to the positive input on the breadboard, and the negative to the negative. Then we connected the breadboard to the Arduino, running a wire from the positive input to the 5v Analog pin on the Arduino, and the negative output to the GND Analog pin.

Then we uploaded this code:

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott

#include

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}

This code is found again in the examples, under servo, as Knob. This allowed us to turn the servo by turning the potentiometer.

In the end this is what the set up looked like.




This is another step in our understanding of the importance of physical computing as a potential tool for interactive and active history.

Thanks to Lucky Larry for a very useful tutorial.

Tuesday, January 12, 2010

Interactive Mapping Medievalism Exhibit Design at the Canadian Frontier?

From my last post you will see that I am involved in two projects (among many) this year that have special significance. Just for clarification these are initial thoughts about the Interactive Exhibit Design project, not my project for Mapping Medievalism, however the title will become clearer as my thoughts unfold (or unravel, one of the two).

Self doubt is about as attractive in academia as it is in dating. The rule is fake a little self confidence until you actually become self confident, then pretend you were sure of yourself all the way along. If you believe in you, then others will too. Of course, looking back through my previous blogs one can tell that I have not always followed this rule. In fact I am not very good at it. See.. there. I often feel that the only way to have control over my insecurities is to admit to them ... frequently, perhaps somewhat annoyingly.

For instance, all through the Christmas Break I was trying to come up with an appropriate project to start in Interactive Design. The thoughts kind of went like this ... "well maybe if I make a map of where ... " "maybe I could map out where..." "maybe people could press a button and have it show up on a map where ...", and so on and so forth. I kept coming back to map, but it occurred to me that I am still missing something key to this project.

The problem is I am still thinking in terms of an 'analog' exhibit, and imposing digital and technological elements on to it. We talked about this a great deal in Digital History, where many scholars, when it comes to the internet, are not exploring what the internet can do when they publish works there; instead they are imposing the conventions of the printed book or magazine on the internet. Stephen Robertson has an article about this phenomenon as he observed it in one of his classes. This is what I found myself stuck on in this project.

Not that the technology should necessarily dictate the ideas, but that the technologies should help you change the way you think about presenting history to the public. For instance, at the fairly new Lincoln Library, BRC Imagination Arts is doing amazing things with what they have termed Holavision to make the history interact with the public, including an 'hologram' of Abraham Lincoln. I was particularly intrigued by Prof. Turkel's vision (and Prof. Robert MacDougall's revisionist version) of the History appliance. This is when the possibilities of what it means for technology to interact with the public started to come across.

While technology should free, not limit the ideas, at the same time I will be limited by it because I am not skilled enough (yet) to make it do all the things I would like it to; so I shall ask not what the technology can do for me, but instead what I can do with the technology. At the same time that is quite a bit. I have been toying with the idea of projecting something, like historic apparel, that people could walk into and pretend that they are wearing. Or maybe I could make a 3D model of a Viking Ship (though my gut tells me someone may have beat me to the punch), or maybe one of a local historic building. I may yet do one of these things, we shall see how things go. Or maybe I could make a map.

I was definitely stuck. It was my colleague, Catherine Caughell, who suggested, hey, you re helping set up an exhibit, why not make something for that. And that, of course, brings me back to map, as the title of that seminar, as has been stated, is Mapping Medievalism. Therefore, if it is possible, I am going to be trying to create something appropriate for that exhibit. That will give me a few extra incentives, including trying to take into account what would be appropriate for the exhibit, and designing it to suit a specific audience. Not that it will necessarily be put in the exhibit, but perhaps if I am able to fake confidence long enough it might turn into something worthwhile. Also, it gives me license to do a map, which my brain was clearly set on.

Some initial thoughts on that project would include digitizing maps that are going to be part of the exhibition (and ones that aren't, but that are relevant to the topic and are available), making them zoom-able, and then locating the maps on a larger map of Canada, so that someone would select the geographic region to see the smaller maps. It would also include some information from the exhibition represented spatially, in a way that is not obvious in the exhibit. I am not sure if I could accomplish this with a screen that you could touch, so that you touch the map to access the information you want, or whether I would go larger and have someone stand back with something more like a remote or a mouse, and access the information that way.

I do not yet know how I will do this. Something in my mind is saying SMART Board, but I am not sure that is the way to go, or if that would be appropriate for what I am envisioning. Nor am I sure that this is what I will do, or that it is worth doing. The map idea still seems a little ... 2D, I suppose is the word, and not quite pushing the limits of what is possible. Then again, this would not be an ordinary map. Again, to be clear, this is not the project that I am doing for Mapping Medievalism, this is what I could be doing in Interactive Exhibit Design. It just happens that I might be able to help the former with something I am already doing in the latter, especially if I was going to be doing a map anyway. If I find it is not useful to mesh these two then I won't, likewise if my professors or colleagues find some of my other ideas more interesting, but for now I like the idea of trying to design with a purpose and an audience, even if the audience is not guaranteed.

So here we go.

Also, I apologize for that horrendous 'ask not what your country ..' joke a few paragraphs back. Had to be said (though many may disagree), and if you can't be cheesy in your blog when can you (implied, never)?