As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.
Showing posts with label sensor. Show all posts
Showing posts with label sensor. Show all posts

Friday, April 25, 2014

Jered and Ciera | Arduino | Sensor Experimentation

Using an Arduino can sometimes make it difficult to control high-voltage devices. The maximum voltage that the Arduino can output from its pins is +5 volts. Say we wanted to control a motor running at +12 volts? How could we do it?

The answer is transistors. Transistors are very powerful because they allow manipulation of very high voltages using only a very low voltage signal. Think of a transistor as a signal amplifier. A transistor can use a +5v signal from the Arduino to turn on or off a higher voltage +12v motor.


In common transistors like the TIP120, the "base" pin can connect to a control signal which controls current across the "collector" and "emitter" pins.

In the schematic below, a potentiometer is used to control the speed of a 12 volt DC motor via PWM. The potentiometer acts as a sensor and is connected to pin A0 as well as +5v and GND. Extra power comes from an external "wall wart" which provides a +12v current. Note: it is very important to connect all the grounds together in circuits like this. The ground from the wall wart is connected to the ground of the Arduino even though they output different voltages.


To get this circuit to run on the Arduino, simply use the unmodified example code from Examples > Analog > AnalogInOutSerial. The Arduino reads the analog signal from the potentiometer on pin A0, and then outputs an equivalent PWM signal from pin 9. The transistor then amplifies the PWM signal in order to control the flow of +12v current through the motor.


Try it for yourself!

Arduino Sensor Experiment | Anjelica Harlow + Albert Lui

Hi there. This is Albert and Angelica, we are now officially a group. I'm leaving for Toronto soon and wont be in class on next week so I figured I would get this out of the way as soon as possible. Pretty simple, I'm using a momentary push button as my 'sensor.'
Whenever the button is pressed down, the red LED lights up. I actually had to build my circuit with a resistor. Our textbook never really tells us why this is necessary and how the circuit actually works. I understand the code completely, but I don't quite understand the electronics. I have a few questions I'm hoping to ask Dominic in person.

Pressing the momentary button down to light up the red LED.

/*
Turns on an LED when the momentary switch is held down.
 */

int led = 13;
int button = 7;
int val = 0;

void setup() {              
  // initialize then digital pins as input/output for the LED an switch
  pinMode(led, OUTPUT);
  pinMode(button, INPUT);
}


void loop() {
  val = digitalRead(button);
  if (val == HIGH) { //switch is pressed
    digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  } else {
    digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  }
}