Saturday, February 24, 2007

H-Bridge PCBoard + Arduino Code

PCB layout for connecting the H-bridge to Arduino w/four input slots (for photocells, resistors, switches, etc.) The L293E (SN754410) is placed in center with traces for connecting to Arduino, the two motors, 4 photocells, resistors, capacitor, etc. The four inputs allow for a variety of sensors and/or switches to be on one board which can be used as inputs for Arduino.

The following is a revised version of Arduino code, which allows two photocells to control the direction each motor is rotating. The motors will rotate in one direction if exposed to light + another if the light level is reduced. Changes to the threshold amount determines how sensitive the sensors react.

/* Controlling Two DC Motors Using H-Bridge + PhotoCell
* ------------
*
* Uses an H-Bridge (L293E or SN754410) to control the direction of two DC motors.
* Additional DC motor added. Photocells used to control direction of each motor.
* Modification to Physical Computing tutorial:
* http://itp.nyu.edu/physcomp/Labs/DCMotorControl
*
* Modified 23 February 2007
* By Kyle Janzen
* http://kylejanzen.blogspot.com/
*
* based on an original by Physical Computing @ ITP
*/

int photo1Pin = 1; // select analog input pin for photocell1
int photo2Pin = 2; // select analog input pin for photocell2
int val1 = 0; // variable to store the value coming from photocell1
int val2 = 0; // variable to store the value coming from photocell2
int threshold1 = 410; // threshold1: adjust to light conditions
int threshold2 = 250; // threshold2: adjust to light conditions
int motor1Pin = 3; // H-bridge leg 1
int motor2Pin = 4; // H-bridge leg 2
int motor3Pin = 5; // H-bridge leg 3
int motor4Pin = 6; // H-bridge leg 4
int speed1Pin = 9; // H-bridge enable pin 1-2
int speed2Pin = 10; // H-bridge enable pin 3-4

void setup()
{

// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(motor3Pin, OUTPUT);
pinMode(motor4Pin, OUTPUT);
pinMode(speed1Pin, OUTPUT);
pinMode(speed2Pin, OUTPUT);

// set speedPin high so that motor can turn on:
digitalWrite(speed1Pin, HIGH);
digitalWrite(speed2Pin, HIGH);

}

void loop()
{
val1 = analogRead(photo1Pin); // set val1 to equal reading of photo1Pin
if (val1 >= threshold1) {
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
}else{
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
}
val2 = analogRead(photo2Pin); // set val2 to equal reading of photo2Pin
if (val2 >= threshold2) {
digitalWrite(motor3Pin, LOW); // set leg 3 of the H-birdge low
digitalWrite(motor4Pin, HIGH); // set leg 4 of the H-bridge high
}else{
digitalWrite(motor3Pin, HIGH); // set leg 3 of the H-bridge high
digitalWrite(motor4Pin, LOW); // set leg 4 of the H-bridge low
}
}

Thursday, February 22, 2007

Graphite Forms + Devices

Conical shell form attached to a 12V DC motor. The cone's base was sanded to an angle which causes the device to be off-balanced which gives a rougher, more sparatic movement. This lack of balance, in rotation, should give the device uneven wear patterns as well as complex + changing markings on the drawing surface.

Device resting upright on slanted base.
Device on side w/view into the hollow center of cone.
Device on side.
Graphite shell - approx. 1/4 of a sphere w/sanded edges + three points.

Wednesday, February 21, 2007

Controlling Two DC Motors w/Arduino

Using an H-Bridge (L293E or SN754410) + Arduino it is possible to control the direction of two DC motors. Using the Physical Computing tutorial (DC Motor Control), I've added an additional motor + delay function, which sets timed intervals for each direction. This allows the powered mirror mount to move up/down + side to side. By adjusting the delay intervals + order of code the motor begins to move in a complex way.

Here's is the modified Arduino code:

/* Controlling Two DC Motors Using H-Bridge
* ------------
*
* Uses an H-Bridge (L293E or SN754410) to control the direction of two DC motors.
* Delay functions have been added. Additional DC motor added.
* Modification to Physical Computing tutorial:
* http://itp.nyu.edu/physcomp/Labs/DCMotorControl
*
* Modified 21 February 2007
* By Kyle Janzen
* http://kylejanzen.blogspot.com/
*
* based on an original by Physical Computing @ ITP
*/

int motor1Pin = 3; // H-bridge leg 1
int motor2Pin = 4; // H-bridge leg 2
int motor3Pin = 5; // H-bridge leg 3
int motor4Pin = 6; // H-bridge leg 4
int speed1Pin = 9; // H-bridge enable pin 1-2
int speed2Pin = 10; // H-bridge enable pin 3-4

void setup() {

// set all the other pins you're using as outputs:
pinMode(motor1Pin, OUTPUT);
pinMode(motor2Pin, OUTPUT);
pinMode(motor3Pin, OUTPUT);
pinMode(motor4Pin, OUTPUT);
pinMode(speed1Pin, OUTPUT);
pinMode(speed2Pin, OUTPUT);

// set speedPin high so that motor can turn on:
digitalWrite(speed1Pin, HIGH);
digitalWrite(speed2Pin, HIGH);

}

void loop() {
{
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge low
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge high
digitalWrite(motor3Pin, LOW); // set leg 2 of the H-bridge low
digitalWrite(motor4Pin, HIGH); // set leg 2 of the H-bridge high
delay(5000); // set time 'on'
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
digitalWrite(motor3Pin, HIGH); // set leg 3 of the H-bridge high
digitalWrite(motor4Pin, LOW); // set leg 4 of the H-bridge low
delay(5000); // set time 'on'
digitalWrite(motor1Pin, LOW); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, HIGH); // set leg 2 of the H-bridge low
digitalWrite(motor3Pin, HIGH); // set leg 3 of the H-bridge high
digitalWrite(motor4Pin, LOW); // set leg 4 of the H-bridge low
delay(5000); // set time 'on'
digitalWrite(motor1Pin, HIGH); // set leg 1 of the H-bridge high
digitalWrite(motor2Pin, LOW); // set leg 2 of the H-bridge low
digitalWrite(motor3Pin, LOW); // set leg 3 of the H-bridge high
digitalWrite(motor4Pin, HIGH); // set leg 4 of the H-bridge low
delay(5000); // set time 'on'

}
}

Video - the motion of the powered mirror mount.

Graphite Forms: rounded cone shell

I've started to place the soft graphite mixture onto objects to create shell-like forms. The test was successful, in that the dried graphite held the object form + texture and was relatively easy to remove. One problem was that the shell forms were not very strong; the test piece broke during hand-sanding. I am currently testing new forms with increased thicknesses.

Here are some images of the test piece; the inside of the form has a smooth surface.

DC Motor Control Using an H-Bridge

Here is a link to an Arduino tutorial about controlling motors using an H-Bridge chip. The H-Bridge allows the current to be alternated causing the motor to function in forward and reverse.

DC Motor Control

Monday, February 19, 2007

Drawing bot w/housing

The intent of is to allow the drawing bot to sway + erode away as it come in contact with the drawing surface. The device will be suspend + set into motion by an arduino controlled dc motor. The drawing surface will shift back and forth on another arduino controlled set of motors (from a powered car mirror). The movements caused by both the bot + surface will cause the graphite form to wear in an unpredictable manner; with continually wear, the graphite will build up upon the surface potentially activating and/or changing other circuits. Arduino will be used to take in analog data (photocells, switches, etc.) and out digital data determining forward/reverse of the motors + possible speed. The analog inputs/sensors will collect information from the site + record it in a form of drawing.

The changing environments will wear the graphite uniformly causing the device's movement to be constantly altered (effecting drawing consistency, pattern, speed, weight, etc.).

Tuesday, February 06, 2007

Monostable Timer Circuit

This circuit produces a pulse when triggered; the pulse is a given amount depending on the following equation: T = 1.1 x R1 x C1, where T is time. The circuit I am using is a slight variation to this one; the pulse is given to darlington transistor, which closes a switch until the pulse is completed. When this switch is closed another circuit is activated ie: motor, LEDs, etc. I plan to develop a switch mechanism that is activated by the movement of passing trains, traffic, and pedestrians. The switches would become the triggers for the circuit.

Parts list: 555 Timer, ULN2804 Darlington Transistor, 10 uf capacitor, 100k resistor, 27k resistor, 1k resistor, LED, dc motor, 2-9 volt batteries, and various resistors to adjust the time period. PCBoard.

PCBoard schematic:
Link: 555 Timer Circuits

Sunday, February 04, 2007

Simple Drawing Bot

After letting the second mixture of graphite, clay flour, charcoal, and water dry, it was attached to the end of a 12V motor. In the first attempt (first video) a lower-end 9 volt battery was used which didn't provide enough power to overcome the friction of the drawing surface. In the second test (second video) a higher quality 9 volt battery was used which allowed the device to move on its own. The graphite form dried hard enough to not crumble completely away, though some smal piece did break off. The next step is to test different forms/shapes/moulds of graphite and observe the way the act on the surface.

Here is the first video:
Here is the second:
This image is of the outcome of both tests.

Thursday, February 01, 2007

Generative Drawing

Generative Process - Using electricity to power mechanical devices, which move in an algorithmic-type motion. I started to experiment +
create machines capable of drawing; with the intention that a drawing was no longer an end product but a constantly evolving act. This act will continue to be informed by the devices, but also by their environments.

Activators

Wind - relatively unpredictable when consider in long period of time, changes day to day, if not throughout the day. Air movement fluctuates which adds complexity to the system. Creates motion + potentially controlled movement. The amount of air movement increases as height increases. Potential uses: moving contacts together + apart, propelling objects + components to cause movement, changing orientation of device and/or component + sensors.

Sound - relatively unpredictable, certain locations have repetitive sounds; Disraeli Freeway, railway, etc. Used with microphones + circuitry to active device and/or components. 'Cinderella' circuit; using sound to activate motors, LEDs, etc. Limited to range + potential circuitry complications.

Light - predictable, in terms of sunlight, from a day to day basis. Complexity is added when other sources of light are made possible; headlights, changes in shadows, street lights, etc. Photocell may be used as resistors, triggers for relays (with appropriate circuitry), and detection of light. Solar panels and/or photovoltaic cells with or without circuitry (solar engines) to produce electric current + voltage. Used to power and/or activate device + components. Used as resistors in circuitry. Limited to areas receiving light; lack of sunlight may cause device to be non-functional for a given period of time, which adds complexity to the system.

Movement - predictable in ways, sources of movement include; air, trains, automobiles, doors, etc. Vibrations + movements from these or similar objects may cause switches to be opened + closed momentarily, thus activating devices + components.

Various combinations of these attributes could be used with each device, which would ultimately add a multitude of complexity to the system. This would allow for an unpredictable outcome in terms of product and/or behavior. If the system is able to be sustained by solar power then the device could left for long periods of time without attention and/or service.

Moulding Graphite

I've started to experiment with making my own graphite, which is to be used as the drawing medium for the devices. The process involves combining powdered graphite, clay flour, and water into a sludge-like mixture for moulding. Once moulded the mixture is left to dry, then fired at 1800 F (1000 C). The following images show the products used + the preliminary tests.

Products - Graphite lubricant (used by locksmiths) + Clay flour (for sculpting + modelling).
Powdered contents - finely ground graphite.
Powdered contents.
Simple forms created after mixing graphite, clay flour, and water in a small bag. (2:1, graphite to clay ratio)
The forms are left to dry before firing, which I haven't tested yet. Some concerns: strength of the fired graphite, darkness of lineweight (small dried, unfired pieces appear to draw on paper relatively well). To address these concerns more clay may need to be added to the mixture + charcoal powder for darkness.

The industrial manufacturing process is described at: How a pencil is made

Site: plan + section + detail

Plan of railway bridge + surrounding area @ Annabella.
Section showing the relationship of the roadway + sidewalk to the bridge + its opening. Height from: road to underside of bridge - 13'0", sidewalk to underside of bridge - 11'6", underside of bridge to topside of bridge - 6'0".
Detail of the opening between two of the bridge structures (opening of 18" to 36")

Drawing bot

Drawing bot: the motor of the device is weighted causing it to vibrate around the drawing surface on three graphite legs. Complexity is added to the movement when + if the legs start to wear unevenly. The activators for the device could be; changes in light qualities, vibrations + movement of vechicles, trains, + pedestrians, sound and wind.