PComp Analog I/O

Development of Analog Input/Output lab.

Materials, and different Analog sensors: potentiometers, microphone, photocell, graphite.
These were used to light a LED in an analog way, the light dims an lights with different intensities, not only on and off.

Mapping of sensor ranges:
microphones:
give a range that is very erratic.
max:~800 min:~100

photocell:
max:~560 min:~20

pencil drawing, graphite:
max:600 min:~0, it depends on the drawing and distance.

///////
creative. Using drawing made with graphite pencil
//////
/*
………………draw until its ok………….
You start with empty canvas (almost empty on the documentation shown here), the idea is to make a drawing with sufficient traces or amount of graphite in order to make the led to change from red to green.
You have a yellow LEDto indicate that you are making progress (analog output)
The yellow LED lights up more as you get closer to achieving a drawing that its ok.

The point is to document how people react to a “drawing, self race, or approved drawing”. It could be taken patiently, and committing to the drawing of an specific idea (making a “gracious” drawing in a symbiotic way with the goal) , without giving in into desperation to achieve the goal and giving up the idea or flow to be drawn(making just desperate pencil marks).
………………………………………..
*/

Pictures of materials, mounting and sensors:

videos of each sensor used:

potentiometer

microphone

photoresistor

CREATIVE!!! YOUR DRAWING IS OK…..are you?

creative CODE:
/*
………………draw till its ok………….
You start with an almost empty canvas, the idea is to make a drawing with sufficient traces or amount of graphite in order to make the led to change from red to green.
you have a yellow led to indicate that you are making progress
the yellow leds lights up more as you get closer to your goal
………………………………………..
*/

int pinDrawing = 3; // Analog input pin, from the drawing
int valueDrawing = 0; // value of drawing
int redLeds = 9;
int ledMeter = 11; //pwm
int minValue=0;
int maxValue=600;

void setup() {
//pin outputs, to light the leds
//Serial.begin(9600);
pinMode(redLeds,OUTPUT);
pinMode(ledMeter,OUTPUT);//yellow led PWM!!!
}

void loop() {
valueDrawing = analogRead(pinDrawing); //read the drawings value
int brightness = map(valueDrawing, minValue, maxValue, 0, 255);
analogWrite(ledMeter, brightness); // lights analog like the yellow led
//ask if drawing is ok
if(valueDrawing >= 100){
//change leds to green
digitalWrite(redLeds,HIGH);//take the ground off this pin
}else{
//leds are red
digitalWrite(redLeds,LOW);//put ground on this pin
}
}

ANOTHER VERSION of the code: in this version, you have a potentiometer or other analog input sensor (with a full range), to calibrate the ok value (amount of drawing or graphite), in which the drawing will be ok.

int pinDrawing = 3; // Analog input pin, from the drawing
int valueDrawing = 0; // value of drawing
int redLeds = 9;
int ledMeter = 11; //pwm
int minValue=0;
int maxValue=600;
//adjustments
int okValue=0; //it controls how much energi needed for drawing to be ok
int pinAdjust=5; //analog in to change the ok value

void setup() {
//pin outputs, to light the leds
//Serial.begin(9600);
pinMode(redLeds,OUTPUT);
pinMode(ledMeter,OUTPUT);//yellow led PWM!!!
}

void loop() {
valueDrawing = analogRead(pinDrawing); //read the drawings value
int brightness = map(valueDrawing, minValue, maxValue, 0, 255);
analogWrite(ledMeter, brightness); // lights analog like the yellow led

okValue = analogRead(pinAdjust);
okValue = map(okValue, 0, 1023, minValue, maxValue);

//ask if drawing is ok
if(valueDrawing >= okValue){
//change leds to green
digitalWrite(redLeds,HIGH);//take the ground off this pin
}else{
//leds are red
digitalWrite(redLeds,LOW);//put ground on this pin
}
}

One Response to PComp Analog I/O

  1. Tom Gerhardt says:

    I like the use of graphite!
    Do you draw alot? If so, I wonder what would happen if you somehow incorporated the idea of variable resistance into the act/practice of drawing…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s