Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts

4.6.09

lets look at the tech

Because I find it all so interesting.

I've spent a lot of time in the project exploring different possible technologies to use, including hacking wiimotes, Arduino, RFID, and colour tracking. I explored all the different strengths and weaknesses of each tech: colour tracking being pap in low light, and interfered with by similarly coloured objects, wiimotes being temperamental little things and prone to errors in Processing in my experience, Arduino being one of the most appealing technologies I looked into, but all the fun components get a little bit expensive on my budget, and RFID only reading tags, not tracking. I'm now going to look into the uses of the two technologies that I have decided to use, and the potential uses of what I have created using them.

When I first started this project I was quite interested in tracking the users around the space, which still interests me, but as I progressed through the project I found myself becoming more interested in creating a tactile interface, and the technologies that were best to create one were what I ended up using - Arduino and RFID tagging. The RFID tagging allowed me to create physical objects that could be recognized by the computer, allowing the real world to interact with the data in the computer. The Lilypad allowed me to create objects that were not only clever and glowy and wow, but allowed me to create objects that the user wants to pick up and interact with. The knitting also helped with that, people seem to be comfortable with the objects and find them familiar because of the way they are made.

"In of itself, I don't find RFID that exciting. When it's connected to a greater network (e.g. a database, the web, other intelligent devices, etc.) , that's when it can get really interesting." - Doria Fan

Doria fan uses RFID tags to create objects that are imbued with personal histories, without overpowering the object with technology. Her RFID enabled medical history bracelets are still bracelets, the technology does not interfere with the practicality of the object.



The tags inside the medical bracelets contain activate a link to the patients online medical history, making it a beautiful but practical object, containing the wearers personal history.

iTea is another RFID tagging system which uses the internet to bring up data.



Dropping your conference pass in a tea cup scans the internet for data about you. Some information is taken off a social network site, some is googled, allowing the user to see their personal profile made by the internet, whether it's true or false.

To sum it up, the wonderful thing about RFID is that it enables an object to be two different things. It remains the object it was or was intended to be, the bracelet is still a bracelet, the big wooly cloud is still a big wooly cloud, but it allows the object to take on a different aspect as well. It becomes an object that can interface with the digital world, and can bring up data that not only relates to the object, but adds to its meaning.

I've looked into the uses of the Arduino lilypad before, so this bit will be a little bit shorter. Basically, after my experimentation and research in my last project, which focused on the lilypad being a technology to create wearable textiles, I found myself wanting to experiment with it more in a different context. I have researched in toy hacking as part of this project, looking into the creations from the mediamatic workshop, which while were brilliant examples of the toys getting new functionalities, the objects lost some of their identities as toys, what with the wires poking out of them. Granted they were prototypes from a workshop, but I wanted to create objects that were still objects. My little wooly friends were designed to be wired up, and buzzing around around the place and blinding people with ultra bright LEDs, but I wanted them to retain the element of familiarity and softness brought about by creating them by knitting, even before i knew I was going to knit them or reminded myself how to knit. By using the lilypad I was able to make them into "shiny wow wow's", but by using soft circuits was able to keep them as approachable objects.

So then, how could what I have made be used? My program, even there are around a thousand lines in it, is rather simplistic. It gets the feed, matches it up with the RFID tag and spits it out to the screen. And makes some swirly animations. All rather nice but the data it's getting, and the way it gets it could be used in other ways. Some examples are in the RFID examples above, using the technology to personalise objects and drag in data from the internet. The use of the weather data itself lends it to be used with a mapping system like google maps, returning the data to it's geographical context, and reminding people who don't have such a detailed map in there heads of where places are in relation to each other. The weather feed could also be used in conjunction with other feeds, perhaps used with flickr, to create a link between a weather state and the most recent and geographically appropriate geotagged photo uploaded, creating a visual representation of the weather that is more closely related to the data than my swirly graphics.

There are many things it could be used for i suppose, now that I've figured out how to do the simpler parts (getting the feed, getting it to the screen, using RFID tags), I plan to keep exploring the possibilities.

2.6.09

testing everything

I decided to try to use my new shiny Duemilanove to test my little wooly bits, and the not so wooly ones. Turned out to be a lot easier than using the lilypad to test them. Instead of having to spend ages sewing up circuits just to rip them back out. I simply plugged one end into the 5v and one into the ground.

This is the only thing that's faulty beyond squishing it into working! The vibe board in the cloud works, but the little sun doesn't light up. This is a bit annoying as I tested it quite extensively while making it.



Here's another cloud with a vibe board in it, this one works fine, although you can't see it in the photo.



Here's my sun..



and my raindrops...





Now I need to fix my sunny cloud, and hook them up to the lilypad.

31.5.09

more making things - clouds

My hands are going to be wrecked by the end of this week. This weekend I have been putting the final touches to my clouds, amongst other things, which I will blog about later.

After putting the knitting together to at least partially look like a cloud, I got the vibe boards ready to sew into the clouds. I've been using scraps of material to hold each of the components, so it can be put together like a puzzle, which is nice and easy.



I've placed the vibe boards on the back of the clouds, so while the user is holding it they can feel the vibe better. Here's me placing it...



And it sewn in...



I then worked on the little sun for the partially sunny cloud, finishing off the back of the circuit and sewing it up.



Here he is all poofy and ready to be sewn in. The threads sticking out of him are conductive threads, ready to feed into the cloud to continue the circuit for the vibe board up to the little sun.



I then used some more scraps to make a little path for the conductive thread to go along inside the cloud.



Put the sun where I wanted him, and sewed him in.



I then tested him to make sure that he still worked, here's me attaching a temporary power source to test it.



I then connected the little sun circuit down to the vibe board circuit, and tested it all again..



'ello!



Now I just need to stuff him and put the RFID card in. The RFID reader was being a little temperamental last night but seems to be working now, hopefully will still be working for the exhibition.

29.5.09

Arduino workshop



Today I tottered off to a tinker.it workshop at old broadcasting house in Leeds, and it was immense. I learnt about the history of the arduino, which is funnily enough named after a pub. And how to make circuits with the big boy arduinos, the one I was given today was a Duemilanove, which seemed complex compared to the little lilypads I'm used to. So many holes to put things in, and analog and digital input go in two different places which seemed weird. Most of the day was spent making circuits for some of the different example codes that come with the arduino programming environment, which I was grateful for as the circuits seemed very different to what I make with the lilypads. I learnt how to use a breadboard to do prototyping, and got a little bag of toys!!

The above circuit is for the button example. I'm suprised how easy it is to prototype with it.

I'm glad i went, using a different arduino board with proper wires seemed a bit daunting. Shame that there's only a week left on my project. I feel like I'm a step closer to hacking stuff instead of making it from scratch.

17.5.09

forgetting things is sometimes good.

I remembered to order my RFID reader and some cards..



forgot to order the USB connector. *face palm*

So while I've been waiting for that to appear I've been working on my code, using a button based system. As any other tech I use will use the same basic way of working; something sending a signal, something waiting for a signal, and when that signal is received running the script which looks at the weather feed and spurts it out when necessary.

(Actually it works a bit more like this, pulling in the weather feed every five seconds or whatever, and saving it. Then waiting for a signal stating what weather the user wants to look at, looking at the saved weather feed, and spitting out the appropriate weather.)

I've been using arduino for this, programming my buttony lilypad to send a signal to processing. I was having a few problems at first, once the signal was sent it wouldn't stop sending it, or processing wouldn't stop reading it. New button presses weren't even registering, which confused me a bit. I did a bit of research and found out how to debounce buttons, and now it works. Once a button is pressed it will keep displaying that weather until a new button is pressed. I would like to make some kind of rest state, where if nothing is pressed something else happens, not sure how to do it, may involve timers in processing, sending a resting state from arduino just jams the signal for button presses.

That might not make sense to you, but makes perfect sense to me. Here's the arduino code I'm currently using:


// edited the example to use two buttons
//edited the example further t o send a signal to processing.
//and debounce code from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241461190

int ledPin = 13; // LED is connected to digital pin 13
int switchPin = 2; // switch connected to digital pin 2
int switchPin2 = 5;
int switchValue; // a variable to keep track of when switch is pressed
#define BOUNCE_PERIOD 150

long last_read_time;
long last_value;

int val = 0;
int val2 = 0;

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
pinMode(switchPin, INPUT); // sets the switchPin to be an input
digitalWrite(switchPin, HIGH); // sets the default (unpressed) state of switchPin to HIGH
pinMode(switchPin2, INPUT); // sets the switchPin to be an input
digitalWrite(switchPin2, HIGH); // sets the default (unpressed) state of switchPin to HIGH

Serial.begin(9600);
}

void loop() // run over and over again
{
// If we are past our bounce period
if (millis() - last_read_time > BOUNCE_PERIOD){

// Check the button
val = digitalRead(switchPin);
val2 = digitalRead(switchPin2);
// If the button has changed since last bounce period

if (val != last_value){
digitalWrite(ledPin,val);
if (val == LOW) Serial.print("A");
last_read_time = millis();
last_value = val;
delay(10);
}

if (val2 != last_value){
digitalWrite(ledPin,val2);
if (val2 == LOW) Serial.print("B");
last_read_time = millis();
last_value = val;
delay(10);
}
}
}


I've also been knitting my second cloud and light raindrop... the knitting never ends!!!!

11.5.09

mmm buttons.

I've decided to look back into buttons, incase all the fancy RFID and wiimote trickery doesn't work. My backup idea is a simple button based system, with all the little toys or rather tactile bits wired up to a lilypad, with a boring button to press to send the signal, to see what the weather is like.



As I couldn't get ellie to work, I found a tutorial that tells you how to make switches. Turns out that one end of the button should connect to the - bit of the lilypad.



I've even got it working with two buttons, because I'm so clever!

10.5.09

from arduino into processing

is not as simple as I first thought it would be. This is for the light sensor I will be using in my final piece.

I've been trying two approaches, the first one getting processing to hijack the serial communication that the lilypad sends to arduino, to see the values the light sensor sends back. This was a bit weird, the values in processing were quite different and didn't make much sense, there didn't seem to be any correlation between the numbers I was seeing and the changes in light.

I've then been looking into firmata, which allows you to program the arduino board from processing itself, but this method recieved even stranger results, this time only printing out 0. It seemed to be receiving a signal from the light sensor but that was only to say that there was no light. I've found someone with a similar problem on the processing forum, so hopefully they'll be able to help me, but it's confusing me at the moment.

6.5.09

it works... i think...

You may remember my aforementioned buzz buzz, which is a little lilypad arduino circuit with has a light sensor and some vibe boards. I wanted it to vibe when it sees a certain amount of light. After much googling and hair pulling I couldn't figure out what was wrong with my original code.

I decided to come back to it today, and try again. After another couple hours of googling I found this site which had the kind of code i was trying to make. I looked at it and made some changes to my code and now it works!


//if there is light, vibe.

int pins[] = { 9, 10,}; // an array of pin numbers
int num_pins = 6; // the number of pins (i.e. the length of the array)
int ledPin = 13; // LED is connected to digital pin 13
int sensorPin = 0; // light sensor is connected to analog pin 0
int sensorValue; // variable to store the value coming from the sensor


void setup()
{
int i;

for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins - 1
pinMode(pins[i], OUTPUT); // set each pin as an output

Serial.begin(9600); //initialize the serial port

}

void loop()
{

int i;

sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer


if (sensorValue > 450) {

digitalWrite(pins[i], HIGH);
delay(100);
}
else {
digitalWrite(pins[i], LOW);
delay(100);
}


}


It's a bit tempermental, I think it's more to do with the circuit instead of the light sensor or the code. I'm going to use the data from the light sensor to bring up a feed of where it's sunny now.

25.4.09

progress...

slow and painful, till i get my loan through and get my hands on more shinyness.

i've been working more on my little buzz buzz, which detects light and buzzes away happily, but doesn't want to detect light and then let that determine wether or not it buzzes. annoying. it seems pretty simple it my mind but all the scripts i've tried don't work, and i can't find anything online...

here's the basic one i've started out with...


//if there is light, vibe.

int pins[] = { 9, 10,}; // an array of pin numbers
int num_pins = 6; // the number of pins (i.e. the length of the array)
int ledPin = 13; // LED is connected to digital pin 13
int sensorPin = 0; // light sensor is connected to analog pin 0
int sensorValue; // variable to store the value coming from the sensor


void setup()
{
int i;

for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins - 1
pinMode(pins[i], OUTPUT); // set each pin as an output

pinMode(pins[i], OUTPUT);
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
Serial.begin(9600); //initialize the serial port
digitalWrite(ledPin, HIGH); // turn the LED on
}

void loop()
{

int i;

sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer


if (sensorValue == 'HIGH') {

digitalWrite(pins[i], HIGH);
}
else {
digitalWrite(pins[i], LOW);
}


}


there are several other variations that FAIL.

21.4.09

making a buzz buzz

I a currently working on another little prototype, this time playing with light sensors and vibe boards, to make a little critter that buzzes around when there's enough light. i'm not sure if anything in my final piece with behave in this way, but i want to see how useful light sensors and vibe boards are.

so far all i've done is make a simple circuit, and run the program from this tutorial.



I've got the light sensor working, now i just need to get the vibe boards vibe-ing away and i will have a BUZZ BUZZ.

19.3.09

fio has a very long to do list...

after a couple of days of offending people through the lovely violet mirror, i am coming to the conclusion that i need to get it into processing for things to get really interesting. i'm not sure at this point of how to do it, but i'm hoping that after a little bit of research i'll be able to get my head round it.

i'm interested in using some of the applications that come in built with the mirror, such as sending tweets and counting how many times and object has been placed on the mirror, but i would like it to be intertwined with the apps that work the wiimote and arduino boards as well, i'm aware that i'm probably going to be making things hard for myself by squeezing as much different technologies into one piece but i'm up for a bit of fun.

i'm going to try to get some more RFID tags to play with too.. must.. tag.. everything..

i also need to either get or make some more toys... i want to use vibe boards to make things move around the place.

17.3.09

failing...

at getting buttons to work...

int pins[] = {10, 11}; // led
int num_pins = 4;
int inPin[] = {6, 7}; // choose the input pin (for a pushbutton)
int val = 0; // variable for reading the pin status

void setup() {
int i;

for (i = 0; i < num_pins; i++)
pinMode(pins[i], OUTPUT); // declare LED as output
pinMode(inPin[i], INPUT); // declare pushbutton as input
}

void loop(){
int i;

val = digitalRead(inPin[i]); // read input value
if (val == HIGH) { // check if the input is HIGH (button released)
digitalWrite(pins[i], LOW); // turn LED OFF
} else {
digitalWrite(pins[i], HIGH); // turn LED ON
}
}

14.3.09

oooh...



all my shiny new toys came in one day!
Which is very nice.

I've got another Lilypad, with some buttons, vibe boards and some light and temperature sensors, to make some hybrid toys with. I'm not sure how effective the light and temperature sensors will be, but i want to play.

In another box of joy was the Violet mirror, which was packaged so very lovely.



It's so dinky! and you get BUNNIEZ!!

12.3.09

screw you bbc!

hmm...

yeah, bbc, that's very nice. YOU CAN'T WEAR IT THOUGH.

look at his smug face makes me want to punch him gajkng;uoavbjrklea...

5.3.09

ellie is misbehaving



I've been trying to get a similar thing to terry going on, instead using arduino. I'm trying to make her ears light up when a colour appears on screen. The colour recognition is working fine but i can seem to get it sending the right signal to the arduino. i think my brain is too mushy.

4.3.09

wilkos is awesome.

felt puppets for 50p!! OMGZ.





Meet Ellie and Terry. Now i just need to think of ways to make them all fun and interactive for the presentation on fri. May include wiimotes and arduinos. these are just going to be little examples of how i may use objects.

12.2.09

play: part two - Hybrid Toys!

in part two of my little adventure into the world of playing, i am going to look at hybrid toys - hacking stuff to make it fun, in a computery interactive way.



This is a musical pot, by the good people at mediamatic. Inside each flower there is a RFID tag, which controls the pitch the pot resonates, while the big flower has a wii remote inside it which controls the tempo.



This little horsey will spout a recorded message while there is a light source. when it goes dark it shuts up.


I think i need to get some toys in and play around myself.... and some more arduino boards and some RFID tags and nick a wii remote and and and...

12.12.08

the final thing



this is what it looks like, and that's what it all means.

final processing code:


//finds a word, sends a signal to the lilypad then stops the loop.

import processing.serial.*;

Serial port;

String[] tokens; //array
int counter;

void setup() {
size(100, 100);

println(Serial.list());
port = new Serial(this,Serial.list()[0], 9600);

//load file and split up words
String[] lines = loadStrings("http://twitter.com/fiowantscoffee");
String allText = join(lines, " ");
tokens = splitTokens(allText, " ,.?!:;[]-");

}

//so it's now pulling in that sentence and splitting it up.

void draw() {
background(255);
fill(0);

String s = tokens[counter];
counter = (counter +1) % tokens.length;
//look at the words one at a time please



// mood uno: cuppa -------------------------------------------------------------------------------


if (s.equals("coffee")) {
println("coffee");
port.write('A');
noLoop(); //DON'T LOOP IT BAHBEE.
}




// mood zwei: love -------------------------------------------------------------------------------

if (s.equals("love")) {
println("love");
port.write('B');
noLoop(); //DON'T LOOP IT BAHBEE.
}


// mood tres: sex -------------------------------------------------------------------------------

if (s.equals("sex")) {
println("sex");
port.write('C');
noLoop(); //DON'T LOOP IT BAHBEE.
}



// mood funf: fail -------------------------------------------------------------------------------

if (s.equals("fail")) {
println("fail");
port.write('D');
noLoop(); //DON'T LOOP IT BAHBEE.
}


// mood six: internet -------------------------------------------------------------------------------



if (s.equals("internet")) {
println("internet");
port.write('E');
noLoop(); //DON'T LOOP IT BAHBEE.
}


// mood seiben: twitter -------------------------------------------------------------------------------


if (s.equals("tweet")) {
println("tweet");
port.write('F');
noLoop(); //DON'T LOOP IT BAHBEE.
}




// mood acht: geeking out -------------------------------------------------------------------------------

if (s.equals("geek")) {
println("geek");
port.write('H');
noLoop(); //DON'T LOOP IT BAHBEE.
}

}


final arduino code:


//getting it to keep one light lit up

int timer = 10000000; // The higher the number, the slower the timing.




// geeking
int geek[] = { 3, 4 };

// fail
int fail[] = { 5, 6 };


//internet
int net[] = { 7, 8 };


//twitter
int twitter[] = { 9, 10 };

// cuppa
int drink[] = { 11, 12,};

// sex
int sex[] = { 13, 14 };

// love
int loves[] = { 15, 16 };







int num_pins = 18; // the number of pins (i.e. the length of the array)
int val;

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

int i;

for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins - 1

pinMode(drink[i], OUTPUT);


pinMode(loves[i], OUTPUT);


pinMode(sex[i], OUTPUT);


pinMode(fail[i], OUTPUT);


pinMode(net[i], OUTPUT);


pinMode(twitter[i], OUTPUT);



pinMode(geek[i], OUTPUT);





}

void loop()
{
int i;

if (Serial.available()) {
val = Serial.read();

//cuppa --------------------------------------------------------------------------


if (val == 'A') {
digitalWrite(drink[i], HIGH);
}
else {
digitalWrite(drink[i], LOW);
}



//love --------------------------------------------------------------------------

if (val == 'B') {
digitalWrite(loves[i], HIGH);
}
else {
digitalWrite(loves[i], LOW);
}


//sex --------------------------------------------------------------------------

if (val == 'C') {
digitalWrite(sex[i], HIGH);
}
else {
digitalWrite(sex[i], LOW);
}

//fail --------------------------------------------------------------------------



if (val == 'D') {
digitalWrite(fail[i], HIGH);
}
else {
digitalWrite(fail[i], LOW);
}


//internet----------------------------



if (val == 'E') {
digitalWrite(net[i], HIGH);
}
else {
digitalWrite(net[i], LOW);
}


//twitter --------------------------------------------------------------------------




if (val == 'F') {
digitalWrite(twitter[i], HIGH);
}
else {
digitalWrite(twitter[i], LOW);
}





//geeking out --------------------------------------------------------------------------



if (val == 'H') {
digitalWrite(geek[i], HIGH);
}
else {
digitalWrite(geek[i], LOW);
}


}


}


that's all a lot shorter than i wanted it to be, but oh well.

22.11.08

think i should explain it really...

my boobs lighting up actually has a communicative purpose.

each LED shows when a certain word is found in this twitter feed.



and here's the code controlling it all:

arduino code:


//getting it to keep one light lit up

int timer = 10000000; // The higher the number, the slower the timing.
int happy[] = { 5, 6,}; // an array of pin numbers
int sad[] = { 7, 8 };
int meh[] = { 9, 10 };
int love[] = { 11, 12 };
int fuming[] = { 13, 14 };
int num_pins = 10; // the number of pins (i.e. the length of the array)
int val;

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

int i;

for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins - 1
pinMode(happy[i], OUTPUT); // set each pin as an output
pinMode(sad[i], OUTPUT);
pinMode(meh[i], OUTPUT);
pinMode(love[i], OUTPUT);
pinMode(fuming[i], OUTPUT);
}

void loop()
{
int i;

if (Serial.available()) {
val = Serial.read();
if (val == 'A') {
digitalWrite(happy[i], HIGH);
}
else {
digitalWrite(happy[i], LOW);
}


if (val == 'B') {
digitalWrite(sad[i], HIGH);
}
else {
digitalWrite(sad[i], LOW);
}

if (val == 'C') {
digitalWrite(meh[i], HIGH);
}
else {
digitalWrite(meh[i], LOW);
}

if (val == 'D') {
digitalWrite(love[i], HIGH);
}
else {
digitalWrite(love[i], LOW);
}

if (val == 'E') {
digitalWrite(fuming[i], HIGH);
}
else {
digitalWrite(fuming[i], LOW);
}
}


}


and the processing code:


//finds a word, sends a signal to the lilypad then stops the loop.

import processing.serial.*;

Serial port;

String[] tokens; //array
int counter;

void setup() {
size(100, 100);

println(Serial.list());
port = new Serial(this,Serial.list()[0], 9600);

//load file and split up words
String[] lines = loadStrings("http://twitter.com/allemotional");
String allText = join(lines, " ");
tokens = splitTokens(allText, " ,.?!:;[]-");

}

//so it's now pulling in that sentence and splitting it up.

void draw() {
background(255);
fill(0);

String s = tokens[counter];
counter = (counter +1) % tokens.length;
//look at the words one at a time please



//is the word there?
if (s.equals("happy")) {
println("happy");
port.write('A');
noLoop(); //DON'T LOOP IT BAHBEE.


}

if (s.equals("sad")) {
println("sad");
port.write('B');
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("meh")) {
println("meh");
port.write('C');
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("love")) {
println("love");
port.write('D');
noLoop(); //DON'T LOOP IT BAHBEE.

}

if (s.equals("fuming")) {
println("fuming");
port.write('E');
noLoop(); //DON'T LOOP IT BAHBEE.

}

}


i need to think more about the words that i'm looking for, they really need to reflect what people say in twitter.

20.11.08

my boobs light up!

sheer awesome.



the mister approves.