Ambient Etch-a-Sketch




We built a pseudo Etch-A-Sketch emulator that modifies its appearance based on the user’s environment – the temperature and light conditions. Instead of only drawing horizontal and vertical lines, we can draw curved lines by changing the slope of the current line to be drawn. We use two potentiometers to serve as the knobs of this “Curve-A-Sketch” and use Processing to display the user’s drawing. The ambient light level controls the color of the drawing, while the temperature controls the width of the stroke. This project was a lot of fun to play with because of the nostalgia of playing with a childhood toy, enhanced with the novel control of changing its color and stroke width – for example, we could change colors simply by touching the temperature sensor, and width by moving our head over the photoresistor. We also wanted to blow on the temperature sensor to change color, but it didn’t quite work out because of some bugs with a clear button. The clear button only worked sometimes, because the circuit was a bit buggy– quick changes in resistance messed up the data we sent from the Arduino to processing.

Sketches

Cascading Style Sheets




Ambient Etch-A-Sketch: Remember the Etch-a-Sketch? This lets you do everything the Etch-a-Sketch did, and more! The features of your cursor , such as color and pen width, change based on your ambient environment conditions (temperature and light).

The upper half of this image shows an LED light array that lights up in concert with the location of your finger. With an added control for color, you can create a mini light show using just your hands.
The lower half shows our Smart Nightlight. As its basic function, the tricolor LED will be brighter if the room is darker (we put a screen between the LED and the photoresistor to eliminate feedback). The user can change the color and the overall brightness of the nightlight.

Storyboard

Ambient Etch-A-Sketch Storyboard

Final System

This video demonstrates the features of our Ambient Etch-a-Sketch. It shows the user controlling the color and pen width with the photoresistor and thermistor, respectively.

List of parts

  • 2x Potentiometer (rotary)
  • 1x Arduino Uno
  • 1x Push Button
  • 1x Photoresistor
  • 1x Thermistor
  • 3x 10KΩ Resistor
  • 1x Breadboard
  • Wires
  • Computer

Instructions

  1. Plug the two potentiometers into opposite sides of the breadboard. Fix an orientation – the one on the left controls the horizontal coordinate, and the one on the right controls the vertical coordinate. Attach the middle pin of the right potentiometer to A0 and the middle pin of the left potentiometer to A1. Attach the side pins of both potentiometers to 5V and ground.
  2. Connect one side of the thermistor to 5V, and the other side to A2 and ground through a 10KΩ pull-down resistor.
  3. Connect one side of the photoresistor to 5V, and the other side to A2 and ground through a 10KΩ pull-down resistor.
  4. Connect one side of the push button through a 10KΩ resistor to 5V and the other side to D2 and ground.
  5. Run the Arduino code, and then start the Processing application
  6. Draw! The extreme settings of the knobs correspond to the sides of the Processing window. You can adjust the color by shadowing the photoresistor (e.g. leaning over so your head blocks some light), and change the stroke width by changing the temperature (the easiest way is by pressing the thermistor between your fingers).

Source Code

Ambient Etch-a-Sketch circuit

Arduino Code

/*
 Ambient Etch-a-Sketch!
 Lab 1
 COS 436: Human-Computer Interfaces
 February 20, 2013

 */

//variables 
int y; //y coordinate of etch-a-sketch
int x; //x coordinate of etch-a-sketch
int temperature; //temperature of the room 
int light; //light ambience of the room 
int clearButton; //clear Button 

//pins
int pinY = 0; 
int pinX = 1; 
int pinTemperature = A2; 
int pinLight = 3; 
int pinClearButton = 7;

void setup()
{
  // initialize the serial communication:
  Serial.begin(9600);

  // initialize the clear button as an input 
  pinMode(pinClearButton, INPUT);

}

void loop() {
  // read data on every loop 
  x = analogRead(pinX);
  y = analogRead(pinY);
  light = analogRead(pinLight);
  temperature = analogRead(pinTemperature);
  clearButton = digitalRead(pinClearButton);

  //test it works
  //Serial.println("Scaled x: \n");
  if((x < 1024) && (y < 1024) && (light < 1024) && (temperature < 1024) && (clearButton <= 1)) {
    Serial.println(x); 
    Serial.println(y);  
    Serial.println(light); 
    Serial.println(temperature);
    Serial.println(clearButton);
  }
  delay(100);
}

 

For more detail: Ambient Etch-a-Sketch




Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Arduino Internals by Dale Wheat E-Book
Arduino Internals by Dale Wheat E-Book

Arduino Internals guides you to the heart of the Arduino board. Author Dale Wheat shares his intimate knowledge of the Arduino...

Close
Scroll to top