Ideation
For this project, I created an unusual switch that does not require the use of hands. The switch is activated when two animal-shaped toys from Kinder Surprise make a “kiss.” I used copper foil to conduct electricity, enabling the switch to complete or break a circuit when the toys touch or separate.
Concept and Design
The switch mechanism is based on the principle of completing a circuit when conductive surfaces meet. The copper foil serves as a conductive material, allowing current to flow when the toys touch, thereby activating a response in the circuit.
I initially created a simple circuit where an LED lights up when the toys make contact. Later, I expanded the project by incorporating a second LED to indicate different states:
- When the toys “kiss,” a green LED turns on.
- When they are apart, a red LED shines instead.
Circuit 1: Basic Contact Switch
-> When the toys make contact, the circuit closes, and an LED turns on.
Code:
const int toyInputPin = 2; // Pin connected to copper tape
const int ledPin = 13; // LED output pin
void setup() {
pinMode(toyInputPin, INPUT_PULLUP); // Enable internal pull-up
pinMode(ledPin, OUTPUT);
}
void loop() {
int contactState = digitalRead(toyInputPin);
if (contactState == LOW) {
// Toys are touching — circuit is closed
digitalWrite(ledPin, HIGH);
} else {
// Toys are apart — open circuit
digitalWrite(ledPin, LOW);
}
delay(10); // Small debounce
}
Circuit 2: Dual LED Indicator
-
- The red LED is on by default.
- When the toys touch, the red LED turns off, and a green LED lights up.
Code:
const int toyInputPin = 2; // Copper tape contact pin
const int ledB = 13; // LED that turns ON when toys touch
const int ledA = 12; // LED that is ON by default, turns OFF when toys touch
void setup() {
pinMode(toyInputPin, INPUT_PULLUP);
pinMode(ledB, OUTPUT);
pinMode(ledA, OUTPUT);
}
void loop() {
int contactState = digitalRead(toyInputPin);
if (contactState == LOW) {
// Toys are touching
digitalWrite(ledB, HIGH); // Turn ON contact LED
digitalWrite(ledA, LOW); // Turn OFF default LED
} else {
// Toys not touching
digitalWrite(ledB, LOW); // Turn OFF contact LED
digitalWrite(ledA, HIGH); // Turn ON default LED
}
delay(10); // Debounce
}
Challenges and Learnings
- Initially, the copper foil contacts were not always reliable. Adjusting the positioning of the conductive material improved accuracy.
- The switch was sensitive to small movements, causing flickering. A small delay (10ms) in the code helped stabilize readings.
Future Improvements
Would be interesting to integrate a buzzer that plays a sound when the toys kiss.