Sunday, November 1, 2009

// Use this code to test your motor with the Arduino board:

// if you need PWM, just use the PWM outputs on the Arduino
// and instead of digitalWrite, you should use the analogWrite command

// Motors
int irPin = 7; //
int irreading; // the analog reading from the analog resistor divider
int motor1speed = 10;
int motor1dir = 12;
int delayTime;
boolean state = false;

// Setup
void setup() {

Serial.begin(9600);

// Setup motors
pinMode(motor1speed, OUTPUT);
pinMode(motor1dir, OUTPUT);

pinMode(irPin, INPUT);
}

// Loop
void loop() {
irreading = analogRead(irPin);
Serial.println(irreading); // the raw analog reading

/* if (irreading > 135)
{
digitalWrite(motor1dir, LOW);
analogWrite(motor1speed, 200);
}

else if (irreading < 135)
{
digitalWrite(motor1dir, HIGH);
analogWrite(motor1speed, 200);
}*/

if(state)
{
motorForward();
} else {
motorBackward();
}


state = !state;
delayTime = random(4500, 10000);

delay(delayTime);


}

void motorForward()
{
digitalWrite(motor1dir, LOW);
analogWrite(motor1speed, 200);
}

void motorBackward()
{
digitalWrite(motor1dir, HIGH);
analogWrite(motor1speed, 500);
}

process of construction

I used a few tubes of superglue to cement the support frames onto the spacers. I made sure to only stick two large components together at a time as i wanted to be able to control the friction as best as possible when configuring it.

Peeling and sticking together


My final model is taking shape. I have 60 fins to come out so it should look pretty nice

Laser cutting

I cut out lots of the five different components i needed to make up the bot.
3 Fins to each segment.
2 Stoppers between each segment to work as a stop for the fin flicking over.
short segment 1
long segment 2 (these were off centered from each other to make it more layered
spacing segment which sat between each part.

I had some technical difficulties with the laser cutter in the begining but i soon figured out the system and it worked well.


l


freehand model development.


So after testing out my rig i discovered things that would need to be tweaked in order to work efficiently.I found an RC car and pulled it to parts. I decided i would use the axle to drive the fins up and down.

New model


After a long period of time rakking my brain over how to create my spring loaded tube i changed my scheme to something which worked on the horizontal plane.

My new concept is base on the simple mechanics of the mousetrap. I want i to spring out in a rapid motion envoking being startled.

I modeled up test on freehand and printed off a couple of ribs on the laser cutter and tested out the scheme by using a modified rat trap as the test rig.

Sunday, October 11, 2009

materials collection.

We have airsoft rifles at my flat and we 'battle' with them. http://www.youtube.com/watch?v=RIJqPs7btFA
I pulled apart the gun to see how this mechanism works. The gun pulls through a chamber of air when the lever is pushed down. It is then stored until the trigger is set off. I will attempt to mimic this mechanism.
I have been to the dump on three occasions now. I have been looking for old pressurized systems with valves. This will be used instead of springs to 'cock' my mechanism ready for the next 'fright.'

I collected an old coffee grinder which turned out to run off dc power, it was a bit on the dodgy side...
I collected an old 1985 nintendo 'zapper', it is a light emitting gun which was used for point and shoot games using crt monitors,
quoted from wiki:
When the trigger on the Zapper is
pressed, the game causes the entire screen to become black for one frame. Then, on the next frame, the first target area is drawn in all white as the rest of the screen remains black. On t
he next frame, the next target
area is
drawn in white. The Zapper detects this change from low light to
bright light, as well as which frame the change was detected. This is how the game knows which target has been hit. After
all target areas have been illuminated, the game returns to drawing graphics as usual. The whole process is almost imperceptible to the human eye.
I was hoping to use the light emmitter as a trigger. I need to do some more research into it.

I also uncovered a well used rc car without the remote control.
There are some good parts to salvage from it including an AC motor which is hooked up to a drivetrain. The front steering arms could well work as a switch. and its a good base to get my head into figuring out how all the electronics work within it.


Sunday, September 27, 2009

Concept revisited 'Spring Action'











This is a plasmacut steel batarang. (4x10) It folds in half, and is held shut by 2 small but very strong rare earth magnets. The sping loaded batarang quickly pops open when you pry the wings slightly apart with a finger.


I still looking at the notion of fright but i want to push the emotion further. By using springs, wire, strands of elastic and possibly magnets, i will create a volitile creature that cyclicly returns to its original state. the range in reactions and movement will speak of the diversity within species on the planet.

I need to do lots of research into materials and collect springs.


Wednesday, September 23, 2009







Surprise is a brief emotional state due to an unexpected event.

Surprise has different forms it can be neutral,

pleasant, or unpleasant.

Surprise is expressed in the face by

the following

features:

  • Eyebrows that are raised so they become curved and high.
  • Stretched skin below the eyebrows.
  • Horizontal wrinkles across the forehead.
  • Open eyelids: the upper lid is raised and the lower lid is drawn down, often exposing the white sclera above and below the iris.
  • Dropped jaw so that the lips and teeth are parted, with no tension around the mouth.

my creature will relate to the

opening of eyes, dropping jaw and

stretching out reactions. I intend to use

tensor wire to create a creature which

can expand outward.

Spontaneous, involuntary

surprise is often expressed for

only a fraction of a second. It may be followed immediately by the emotion of

fear, joy or confusion. Th

e intensity of the surprise is associated with how much the

jaw drops, but the mouth may not open at all in some cases.

The raising of the

eyebrows, at least momentarily, is the most distinctive and predictable sign

of surprise.

My creature may gain a

threshold to the event of being surprised and its awareness will increase as it

adapts to its surrounds.

My creature could adapt to being Frightened and his emotion could develop further into fear. Charles darwin states fear is: often preceded by astonishment, and is so far akin to it, that both lead to the senses of sight and hearing being instantly aroused. In both cases the eyes and mouth are widely opened, and the eyebrows raised. The frightened man at first stands like a statue motionless and breathless, or crouches down as if instinctively to escape observation. The heart beats quickly and violently, so that it palpitates or knocks against the ribs... That the skin is much affected under the sense of great fear, we see in the marvellous manner in which perspiration immediately exudes from it... The hairs also on the skin stand erect; and the superficial muscles shiver. In connection with the disturbed action of the heart, the breathing is hurried. The salivary glands act imperfectly; the mouth becomes dry, and is often opened and shut.

My creature could cower in
a corner of the box and colours change rapidly as he shudders, possibly vibrating. He would cower until the threat has dissapated.
Early stages of my ideas were looking at creating a mechanical snake, it would work of a servo motor and the driveshaft would rotate a series of graduated piston like screw.

Wednesday, September 9, 2009

DOGBOWL- final handin

My dog Dooley died earlier this year aged 16 years old. In his old age he was extremely lazy. He spent his days snoring curled up in the corner of his room on his favorite sheepskin rug. The only time he was active was when he needed relieve himself outside and waiting for/eating his dinner. Dinner is the arguably the most important time for a dog and my applet shows the eagerness of the dog to get his meal. At dinner time Dooley would wander up to me and just stare, while his tail oscillated with encouragement. Over the last few years I have taken to drawing pictures in my notebooks of him so I thought this sketch-pad aesthetic would be a good correlation between my personal experience of him.

My Arduino was setup to receive signals from a photocell. Photocells measure changes in light conditions and output a corresponding value. By adjusting the range of the values I could scale the numbers to suit the movie-clip I made in flash. As the numbers increased, so did the timeline and therefore created a realistic interaction between the user and Dooley. As the user pics up the bowl he anticipates  being fed.

To house my Arduino and photocell I needed to use something suitable. The dog-bowl is an iconic object of domesticated dogs in the modern world. It’s the grail, the lifeblood of their survival and to a dog it is its prize possession.  I have done my best to house the circuitry as professionally as possible. I tacked the arduino onto the base of the bowl and angled the photocell toward the front.  I then created a synthetic dog-food to fill it. The dog bowl looks as if it is functioning in its original material way until you see the USB cable connected: its virtual potential is discovered.

The user will see Dooley on screen asleep while the bowl is on the table. As they pick the bowl up the light increases and the dog reacts by waking up and gradually getting up. As you move away with the bowl his tail wags as he anticipates his dinner. If I were to continue this project I would have liked to create different inserts in the bottom of the bowl which would change the resistance in the circuit. There would be different reactions to getting meat, water and nothing at all. I am pleased to have come up with a good use of the photocell and it’s helped to make a lively interactive project.

Code


package
{
import flash.display.MovieClip;
import flash.events.Event;

public class Main extends MovieClip
{
public var sensor:ArduinoReader;
public var dist:Number;
public var maxDist:Number = 650;
public var minDist:Number = 20;
public var newDist:Number = 0;
public function Main()
{
sensor = new ArduinoReader();
addEventListener(Event.ENTER_FRAME, sensorLoop);
}
private function sensorLoop(e:Event):void{
dist = sensor.distanceToObject;
if(sensor.distanceToObject > 0)
{
newDist = Math.round(scaleRange(dist, 5, 4, 5, 1));
woof.gotoAndStop(newDist);
trace(newDist);
}
else
{
woof.gotoAndStop(1);
}
}
private function scaleRange(num, oldMin, oldMax, newMin, newMax)
{
var newRange:Number = (num / ((oldMax - oldMin) / (newMax - newMin))) + newMin;
return newRange;
}
}
}

I must give acknowledge Byrons help with coding. Thanks a lot.
I'm compiling all my work and documenting for handin. The following is a series of sketches of the dog.

Tuesday, September 8, 2009

I have created a housing for my sensor and managed to get the values working to create the desired movement in flash. I have used a dog bowl to represent a dog eagerly awaiting to be fed. I have filled the bowl up with a dried fruit to represent dog food. The sensor is just a basic photocell.
If i had more time i would have made the food change the state of the dog. I would have used different inserts into the bowl to change the resistence and therefore the values and the reaction in the dog. It would have been nice to use a thermostat and have him pant and then have a water insert to change his reaction. Anyway i got this working smoothly and i'm happy that it shows one reaction within a dog.

Sunday, September 6, 2009

Flash Workings

Flash isn't a strong point of mine and i'm slowly getting to grips with the functions i need to get it running. I have still have yet to generate a response from my sensor through expression in my a-life creature... I am am working on how to better utilize tweening to get a smoother look on my final swf . Hopefully i'm not to grey by the end of this project.

Sunday, August 9, 2009

Arduino beginnings


So i am moseying along slowly figuring out how to get the arduino functioning. I have have sorted the functional side out of creating circuits with my breadboard and got my buzzer playing mary had a little lamb. the online tutorials are really helpful i just have to figure out how to create my circuit and then how to apply my data into the flash application. 

Wednesday, July 29, 2009

My first ideas





My pet dog passed away this year. He was an old bugger~ 16. My avatar is a re-incarnation of him and I want to attempt to create an electricution machine with my arduino. His outline will change with different amounts of electricity controlled by a dimmer and i have a buzzer which will emulate the sound. I could possibly use a multi colour led to signify the amount of charge blue being low, red being high. Maybe he is already dead and i am trying to bring him back to life. These are some sketches of what he looks like.


Thursday, July 16, 2009

First Reading; Charles Darwin

EXPRESSION

OF THE

EMOTIONS



"that when debility arises from affection of the brain, the influence is greatest on those muscles which are, in their natural condition, most under the command of the will." We shall, also, in our future chapters, consider another proposition included in our first Principle; namely, that the checking of one habitual movement sometimes requires other slight movements; these latter serving as a means of expression.

Monday, July 13, 2009