For the “Simple Learning Game” assignment, I collaborated with Kristina You and worked on the “Color Palette” that allows learners to interact and learn the basic of color mixing.
We started by brainstorming ideas about learning games, and Kristina came up with an idea about color mixing. We then created sketches, thought of sensors that could be used to create interactions, and finalized the design.
During the work, I was in charge of creating the circuit and coding while Kristina worked on the physical design and fabrication. We first laser-cut the cardboard to test if it’s in a good shape and size, in order to store the circuit inside.
After finalizing the design with cardboard, we tested the circuit and built the high-fidelity prototype using an acrylic sheet.
Final prototype: Color Palette
I’m really happy with the result! Although the prototype is not highly polished, I think the interaction works well. This Color Palette learning tool encourages learners to explore and experiment with color mixing methods in a basic level. However, if I’m going to develop this prototype in the future, I would make the interaction more related to real-world color mixing actions, add more colors to the prototype, and include some instructions or activities in the learning kit.
Arduino Code
#define trigPin1 6
#define echoPin1 7
#define trigPin2 8
#define echoPin2 9
#define trigPin3 12
#define echoPin3 13
long duration, distance, RightSensor,BackSensor,FrontSensor,LeftSensor;
int red_light_pin= 2;
int green_light_pin = 3;
int blue_light_pin = 4;
void setup()
{
Serial.begin (9600);
pinMode(red_light_pin, OUTPUT);
pinMode(green_light_pin, OUTPUT);
pinMode(blue_light_pin, OUTPUT);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(trigPin3, OUTPUT);
pinMode(echoPin3, INPUT);
}
void loop() {
SonarSensor(trigPin1, echoPin1);
RightSensor = distance;
SonarSensor(trigPin2, echoPin2);
LeftSensor = distance;
SonarSensor(trigPin3, echoPin3);
FrontSensor = distance;
Serial.print(LeftSensor);
Serial.print(" - ");
Serial.print(FrontSensor);
Serial.print(" - ");
Serial.println(RightSensor);
if (LeftSensor > 10 and FrontSensor > 10 and RightSensor > 10) {
RGB_color(0, 0, 0);
} else if (LeftSensor < 10 and FrontSensor > 10 and RightSensor > 10) {
RGB_color(255, 0, 0); //red
} else if (LeftSensor > 10 and FrontSensor < 10 and RightSensor > 10) {
RGB_color(0, 0, 255); //blue
} else if (LeftSensor > 10 and FrontSensor > 10 and RightSensor < 10) {
RGB_color(255, 127, 0); //yellow
} else if (LeftSensor < 10 and FrontSensor < 10 and RightSensor > 10) {
RGB_color(255, 0, 255); //purple
} else if (LeftSensor < 10 and FrontSensor > 10 and RightSensor < 10) {
RGB_color(153, 76, 0); //orange
} else if (LeftSensor > 10 and FrontSensor < 10 and RightSensor < 10) {
RGB_color(0, 255, 0); //green
} else if (LeftSensor < 10 and FrontSensor < 10 and RightSensor < 10) {
RGB_color(150, 150, 150); //white
delay(500);
RGB_color(0, 0, 0); //white
delay(500);
}
}
void SonarSensor(int trigPin,int echoPin)
{
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
}
void RGB_color(int red_light_value, int green_light_value, int blue_light_value)
{
analogWrite(red_light_pin, red_light_value);
analogWrite(green_light_pin, green_light_value);
analogWrite(blue_light_pin, blue_light_value);
}
C++