Paintboard

I started the stupid patrick with something rather different than what I actually made. I thought about using pulse sensor but ended up experimenting and using the conductive paint instead.

What’s good about the paint is that it gives you the power to draw your own wires on a piece of paper or cardboard instead of having the actual wire spaghetti( I have them on the back of my board anyway). The darker side of the story is that, I created a not-so-stable system because the conductivity of the paint became not as good as advertised overtime. So what I did was attaching pieces of cardboard featuring some world landmarks to the name of the cities they are located, which is painted black. The back of the cardboard pieces are also painted so that they serve as switches, and I have one potentiometer on the board too. Then I added a few actuators, one RGB and one normal LED, a speaker, a servomotor. These things work together to create effect. The video of the paintboard at work is here:

.

A picture of the board not at work looks like this:

PaintBoard.pic

The code I used was pretty simple:

#include <Servo.h>

int YellowSwitch = 2;
int GreenSwitch = 6;
int BlueSwitch = 7;
int GraySwitch = 13; 

int RedLight = 5;
int GreenLight = 4;
int BlueLight = 3;
int YellowLight = 12;

int rVal = 255;
int gVal = 0;
int bVal = 255;

int PotVal = A0; 
Servo myservo;

int piezo = 10;

void setup() {
  // put your setup code here, to run once:
  pinMode(YellowSwitch, INPUT);
  pinMode(GreenSwitch, INPUT);
  pinMode(GraySwitch, INPUT);
  pinMode(BlueSwitch, INPUT);
  pinMode(RedLight, OUTPUT);
  pinMode(GreenLight, OUTPUT);
  pinMode(BlueLight, OUTPUT);
  pinMode(YellowLight, OUTPUT);

  analogWrite(RedLight, rVal);
  analogWrite(BlueLight, bVal);  
  
  myservo.attach(11);   
  
  pinMode(piezo, OUTPUT);

}

void loop() {
  
  if (digitalRead (GreenSwitch) == HIGH ) {
    for(int i=0; i<255; i=i+3) {
    rVal = i;
    bVal = 255-i; 
    analogWrite(RedLight, rVal);
    analogWrite(BlueLight, bVal);
    delay(33);
    }

    for(int i=255; i>0; i=i-3) {
    rVal = i;
    bVal = 255-i;
    analogWrite(RedLight, rVal);
    analogWrite(BlueLight, bVal);
    delay(33);
    }
  } else {
    digitalWrite(RedLight, LOW);
    digitalWrite(BlueLight, LOW);
  }

  if (digitalRead(YellowSwitch) == HIGH) {
     digitalWrite(GreenLight, HIGH);
     delay(100);
     digitalWrite(GreenLight, LOW);
     delay(100);
    } else {
     digitalWrite(GreenLight, LOW);
     }


  int YellowLightDelay = analogRead(PotVal);
  
  if(digitalRead(BlueSwitch) == HIGH) {
    digitalWrite(YellowLight, HIGH);
    delay(YellowLightDelay);
    digitalWrite(YellowLight, LOW);
    delay(YellowLightDelay);
  } else {
    digitalWrite(YellowLight, LOW);
    }

    
  int ServoVal; 
  
  ServoVal = analogRead(PotVal);
  ServoVal = map(ServoVal, 0, 1023, 0, 180);
  myservo.write(ServoVal); 
  delay(15);  

  if(digitalRead(GraySwitch) == HIGH) {
    for (int i = 45; i < 500; i = i + 33) {
    tone(piezo, i);
    delay(50);
    noTone(piezo);
    delay(50);
    }

    for (int i = 455; i > 0; i = i - 33) {
    tone(piezo, i);
    delay(50);
    noTone(piezo);
    delay(50); 
    }
  }
}

If more time is granted, the paintboard would have more functions controlled by all 10 switches and also some combined features. I want to make the whole thing more stable too, probably by adding a case made of some hard material at the back, and handle the paint a bit more nicely. It’s good to see other people’s work, which has some of  the characteristics I definitely want my own project to have too.

Leave a Reply