Electronics¶
As the electronics part was a very important element in my project, I would love to explain everything I learned, experimented with, and created throughout the process.
WHY I used Electronics in my project¶
When I first thought about my project, I asked myself: what is more exciting than experiencing something interactive that makes you feel more connected to it?
The electronics component added an interactive and dynamic layer to my work. I wanted my piece to respond to others or react to user input, and electronics gave me the ability to do that. It helped bring the concept to life in a more engaging and meaningful way.
Tools I used ?¶
Circuit Playground Express¶
One of the main boards I used in this project was the Circuit Playground Express by Adafruit. It's a beginner-friendly microcontroller that comes with built-in sensors, LEDs, and touchpads, which made it perfect for experimenting with interactive wearable electronics.
What makes it unique is that it includes:
- 10 RGB NeoPixels (individually addressable LEDs)
- Light, sound, motion, and temperature sensors
- Capacitive touch pads
- A built-in speaker and microphone
- USB programming, compatible with Arduino, MakeCode, and CircuitPython
Using this board allowed me to prototype quickly without needing many external components, and it helped me understand how inputs and outputs can work together in an interactive system.
Sensor: Linear Hall Effect Sensor¶
At the beginning of the project, I didn’t plan to use a sensor. I was thinking of simply using an on/off button to trigger the lights — just to simulate the interaction.
But then I realized that using a real sensor would make the experience much more realistic, immersive, and technically advanced. That’s when I decided to use a Linear Hall Effect Sensor.
This sensor detects the presence of a magnetic field. So when a magnet comes close, the sensor sends a signal to the Circuit Playground Express, which then triggers the code to either turn on or fade the lights.
This small change added a magical and invisible interaction that really enhanced the final outcome.
NeoPixels¶
To bring my project to life visually, I used NeoPixels, which are individually addressable RGB LEDs. These LEDs allowed me to create dynamic lighting effects — like fading, color transitions, or reactive patterns — all controlled by my code.
The Circuit Playground Express already comes with 10 built-in NeoPixels, which made it super convenient to experiment without needing extra wiring.
Working with NeoPixels also taught me how to control things like brightness, color (RGB values), and timing through Arduino code.
Bonus: The moment the lights responded for the first time felt like magic! ✨
Jewel 7¶
In addition to the built-in NeoPixels on the Circuit Playground Express, I also used the NeoPixel Jewel, which features 7 RGB LEDs arranged in a circular shape on a small board.
This component was great for adding extra brightness and spatial light effects to my project. The circular design gave me more room to play with symmetry, fading animations, and pulsing patterns that added a lot of visual interest.
Some reasons I loved using the NeoPixel Jewel:
- Each of the 7 LEDs is individually addressable
- It’s small and easy to integrate into wearable or compact projects
- It added a layer of depth and detail to the lighting interaction
- I could chain it with the Circuit Playground Express using just one data pin
This gave me more control and flexibility in how I designed the lighting — whether I wanted it to respond together with the built-in NeoPixels or react separately for more complex animations.
Experementation¶
Diffusing the light¶
I conducted several tests using different fabrics, colors, and layering techniques to discover the best way to diffuse the light coming from the NeoPixels and the Jewel.
This step was essential for transforming the lighting from just a functional element into an integrated design feature.
Without any diffusion, the light appeared as harsh, concentrated dots, which took away from the softness and magic I wanted in the design. The raw LEDs were too sharp and didn’t blend well with the overall aesthetic.
When it comes to layering materials to help diffuse the light, I ran several experiments to find the most effective method.
I discovered that leaving at least 1.5 cm of space between the LEDs and the outer fabric significantly improved the diffusion. This gap allowed the light to spread out more smoothly, reducing harsh spots and creating a more even glow.
In addition, adding a diffuser material (such as a soft translucent fabric) between the LEDs and the outer layer helped extend the visible lighting area on the dress, making the effect more immersive and visually appealing.
To achieve the best light diffusion, I covered the LEDs with layered white muslin fabric. Its soft and lightweight texture helped spread the light evenly without completely blocking it, creating a smooth and gentle glow.
magnet sensor¶
Magnet Sensor: Why I Chose It
The reason I chose to use a magnet sensor was because I wanted something that could react to proximity—something that would trigger an effect when a person or object gets close, but without using a traditional distance sensor.
Unlike distance sensors, which are often bulky and visible, I needed a solution that could be completely hidden beneath the 3D-printed pieces of the costume. After testing a few options, I discovered that a magnet sensor was the perfect fit. It allowed me to maintain the aesthetic of the piece while still creating an interactive and responsive experience.
This decision helped keep the technology invisible yet functional, preserving the magic of the design without compromising on interactivity.
:
Testing the Magnetic Sensor with Circuit Playground Express¶
I started testing the magnetic sensor by connecting it to the Circuit Playground Express (CPX) board and uploading the following code:
#include <Adafruit_CircuitPlayground.h>
int ANALOG_MAG_PIN = A0; // A0 from sensor → A0 on CPX
int DIGITAL_MAG_PIN = A5; // DO from sensor → D2 on CPX
void setup() {
Serial.begin(9600); // Start Serial Monitor
CircuitPlayground.begin(); // Initialize CPX and NeoPixels
CircuitPlayground.clearPixels(); // Turn off any active NeoPixels
pinMode(ANALOG_MAG_PIN, INPUT);
pinMode(DIGITAL_MAG_PIN, INPUT);
}
void loop() {
int mag_D = digitalRead(DIGITAL_MAG_PIN); // Read digital signal (HIGH/LOW)
int mag_A = analogRead(ANALOG_MAG_PIN); // Read analog value (0-1023)
Serial.print("Digital: ");
Serial.print(mag_D);
Serial.print(" | Analog: ");
Serial.println(mag_A);
if (mag_A > 55) {
Serial.println("No magnet detected. Turning LED OFF");
CircuitPlayground.clearPixels(); // Turn off NeoPixels
} else {
Serial.println("Magnet detected! Turning LED ON");
CircuitPlayground.setPixelColor(0, 255, 0, 0); // Red
}
delay(100);
}
🔍 What the Code Does It reads both digital and analog signals from the magnetic sensor.
It displays the values in the Serial Monitor.
If the analog value is greater than 55, the code assumes no magnet is near and turns off the LED.
If the value is lower, it assumes a magnet is detected and turns on a red NeoPixel on the CPX.
🎥 Watch the video below to see it working in real time!
Testing Magnetic Sensor with Circuit Playground Express & NeoPixel Jewel (ON/OFF Logic)¶
This code is used to light up the NeoPixel Jewel (7 LEDs) when no magnet is detected, and turn off the lights when a magnet is near.
#include <Adafruit_CircuitPlayground.h>
#define ANALOG_MAG_PIN A0 // Sensor A0 → A1 on CPX
#define DIGITAL_MAG_PIN A5 // Sensor DO → A5 on CPX
#define NEOPIXEL_PIN A1 // External NeoPixel Jewel
#define NUM_PIXELS 7 // NeoPixel Jewel has 7 LEDs
void setup() {
Serial.begin(9600); // Start Serial Monitor
CircuitPlayground.begin(); // Initialize CPX
CircuitPlayground.strip.setPin(NEOPIXEL_PIN); // Set NeoPixel Jewel pin
CircuitPlayground.strip.begin();
CircuitPlayground.strip.show(); // Turn off all LEDs
pinMode(ANALOG_MAG_PIN, INPUT);
pinMode(DIGITAL_MAG_PIN, INPUT);
}
void loop() {
int mag_A = analogRead(ANALOG_MAG_PIN); // Read sensor value
Serial.print("Analog: ");
Serial.println(mag_A);
if (mag_A > 55) {
Serial.println("Magnet detected! Turning NeoPixel OFF");
CircuitPlayground.strip.clear(); // Turn off all LEDs
CircuitPlayground.strip.show();
} else {
Serial.println("No magnet detected. Turning NeoPixel ON");
for (int i = 0; i < NUM_PIXELS; i++) {
CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.strip.Color(255, 0, 0)); // Red
}
CircuitPlayground.strip.show();
}
delay(100);
}
💡 What This Code Does It reads the analog value from a magnetic sensor.
If the sensor detects a magnet (analog value > 55), it turns OFF all the LEDs on the NeoPixel Jewel.
If no magnet is detected, it lights up all 7 LEDs in red.
This gives a clear visual indication of magnetic presence using colored LEDs.
✨ Testing Magnetic Sensor with Circuit Playground Express & NeoPixel Jewel¶
I tested the magnetic sensor with a NeoPixel Jewel (7 LEDs) connected to the Circuit Playground Express (CPX). I uploaded the following code to test the interaction between the sensor and the NeoPixel lighting.
This version of the code is now used to create a breathing light effect under 3D-printed pieces, making them glow in response to a magnet. 🌟
#include <Adafruit_CircuitPlayground.h>
#define ANALOG_MAG_PIN A0 // Sensor A0 → A1 on CPX
#define DIGITAL_MAG_PIN A5 // Sensor DO → A5 on CPX
#define NEOPIXEL_PIN A1 // External NeoPixel Jewel
#define NUM_PIXELS 7 // NeoPixel Jewel has 7 LEDs
bool lightOn = false; // Variable to track if the lights should stay on
void setup() {
Serial.begin(9600); // Start Serial Monitor
CircuitPlayground.begin(); // Initialize CPX
CircuitPlayground.strip.setPin(NEOPIXEL_PIN); // Set NeoPixel Jewel pin
CircuitPlayground.strip.begin();
CircuitPlayground.strip.show(); // Turn off all LEDs
pinMode(ANALOG_MAG_PIN, INPUT);
pinMode(DIGITAL_MAG_PIN, INPUT);
}
void fadeEffect() {
// Fade in
for (int brightness = 0; brightness <= 255; brightness += 2) { // Smoother fade
for (int i = 0; i < NUM_PIXELS; i++) {
CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.strip.Color(
map(brightness, 0, 255, 80, 255), // Warmer orange-red
map(brightness, 0, 255, 30, 120),
map(brightness, 0, 255, 5, 20)
));
}
CircuitPlayground.strip.show();
delay(15); // Slower transition
}
// Fade out
for (int brightness = 255; brightness >= 0; brightness -= 2) { // Smoother fade
for (int i = 0; i < NUM_PIXELS; i++) {
CircuitPlayground.strip.setPixelColor(i, CircuitPlayground.strip.Color(
map(brightness, 0, 255, 80, 255),
map(brightness, 0, 255, 30, 120),
map(brightness, 0, 255, 5, 20)
));
}
CircuitPlayground.strip.show();
delay(15); // Slower transition
}
delay(500); // Pause between breaths
}
void loop() {
int mag_A = analogRead(ANALOG_MAG_PIN); // Read sensor value
Serial.print("Analog: ");
Serial.println(mag_A);
if (mag_A <= 55) { // Magnet detected
Serial.println("Magnet detected! Fading NeoPixel ON");
lightOn = true; // Turn the light on permanently
}
if (lightOn) {
fadeEffect(); // Keep breathing effect running
}
delay(100);
}
🔍 What This Code Does: Reads analog values from a magnetic sensor.
If a magnet is near (value ≤ 55), the code starts a fade-in/fade-out (breathing) light effect using the external NeoPixel Jewel.
Once triggered, the lights stay on permanently, running the breathing effect in a loop.
Uses warm orange-red tones to give a glowing, subtle response to magnet detection.
Check out the video below to see the soft breathing lights activated by the magnet in action!
Circuit Design¶
Last Touches — Time to Wrap This Project Up!¶
After finalizing the design of the circuit and testing the logic, it was finally time to solder everything in place.
I started by creating three different cracks (prototypes):
Crack 1: I used the built-in NeoPixels on the Circuit Playground Express board.
Crack 2: I connected an external NeoPixel Jewel (7 LEDs) to explore a more focused light design.
Crack 3: I designed a circle of 5 NeoPixels, arranged manually to create a unique glowing ring effect under the 3D-printed structure.
Each version gave me different lighting effects and helped me decide how I wanted the final interaction to feel when a magnet is near.
I intentionally gave each crack a different light behavior — not even similar effects — to enhance the idea of a broken soul, where each crack carries its own story, its own energy, its own light
After testing these variations, I realized that the light wasn’t covering enough space on the dress.
And here you can see the first time I try all lights with the dress
So, to expand the glowing area and create a more immersive effect, I added a full circle of NeoPixels surrounding both the board and the Jewel 7.
This made the whole piece feel more alive — like the light is leaking out of every crack.
!
Circuit Schematic¶
Circuit Schematic
This schematic represents the electronic setup behind the piece. I used [Circuit Playground Express, Linear Hall Effect Sensor, Jewel 7, resistors, Neopixels.] to create a responsive lighting system.
Each connection was carefully planned to allow the lights to behave in a way that supports the emotional story of the project — soft, reactive, and subtle. The circuit tested multiple times, and later integrated into the final wearable structure using wires for flexibility and comfort.
This step helped bridge the gap between emotion and technology — turning light into a language of feeling.
Final code¶
#include <Adafruit_CircuitPlayground.h>
#define HALL_SENSOR_PIN A3 // Linear Hall sensor pin
#define JEWEL_PIN 6 // Pin for the NeoPixel Jewel
#define EXTRA_PIN 9 // Pin for the 18 extra NeoPixels
Adafruit_CPlay_NeoPixel jewel(12, JEWEL_PIN, NEO_GRB + NEO_KHZ800);
Adafruit_CPlay_NeoPixel extra(18, EXTRA_PIN, NEO_GRB + NEO_KHZ800);
int lastBrightness = 255; // Store brightness to ensure a smooth transition
bool lightOn = false; // Tracks if breathing effect should start
int baseValue = 512; // Midpoint for Hall sensor (adjust as needed)
void setup() {
Serial.begin(9600);
CircuitPlayground.begin();
CircuitPlayground.setBrightness(150);
jewel.setBrightness(150);
extra.setBrightness(150);
jewel.begin();
extra.begin();
jewel.clear();
extra.clear();
CircuitPlayground.clearPixels();
jewel.show();
extra.show();
pinMode(HALL_SENSOR_PIN, INPUT);
}
void loop() {
if (!lightOn) {
int hallValue = analogRead(HALL_SENSOR_PIN);
Serial.print("Hall Sensor Value: ");
Serial.println(hallValue);
int threshold = baseValue - 50;
if (hallValue <= threshold) {
Serial.println("Magnet detected! Starting Breathing Effect...");
lightOn = true;
slowFirstFadeIn();
}
} else {
smoothBreathing();
}
}
// 🔹 First Fade-In: Start from 0 brightness, reach 255 in 5 sec
void slowFirstFadeIn() {
for (int step = 0; step <= 100; step++) {
float ratio = step / 100.0;
int brightness = ratio * 255;
updateLights(brightness, brightness, brightness);
lastBrightness = brightness;
delay(50);
}
}
// 🔹 Perfectly Smooth White Breathing Effect
void smoothBreathing() {
for (int brightness = lastBrightness; brightness >= 100; brightness -= 2) {
updateLights(brightness, brightness, brightness);
delay(8);
}
for (int brightness = 100; brightness <= 255; brightness += 2) {
updateLights(brightness, brightness, brightness);
lastBrightness = brightness;
delay(6);
}
}
// 🔹 Function to Update All LEDs
void updateLights(int r, int g, int b) {
for (int i = 0; i < 10; i++) {
CircuitPlayground.setPixelColor(i, r, g, b);
}
for (int i = 0; i < 12; i++) {
jewel.setPixelColor(i, jewel.Color(r, g, b));
}
for (int i = 0; i < 18; i++) {
extra.setPixelColor(i, extra.Color(r, g, b));
}
jewel.show();
extra.show();
}
Challenges & How I Solved Them¶
Challenges & Solutions
After lighting the dress for the first time, I realized that I needed to add more Neopixels to achieve the depth of meaning I wanted. Initially, the design included only 30 Neopixels, which didn’t quite convey the emotional impact I had envisioned.
To solve this, I integrated additional Neopixels, allowing for a more dynamic and immersive lighting effect. The new arrangement provided the desired gradual transitions and subtle glow, giving the dress a more powerful emotional presence. By layering and distributing the lights thoughtfully, the final result became a reflection of the theme, where light moves like a heartbeat — responsive, ever-changing, and full of emotion.
What I Learned¶
What I Learned: Electronics in My Project
Throughout this project, I gained a deeper understanding of how electronics can be seamlessly integrated into wearable art. I used the Circuit Playground Express board and programmed it using the Arduino app, which gave me hands-on experience in both hardware and software aspects of interactive design.
Here are some key lessons I learned:
-
Circuit Design & Prototyping: Planning the connections and understanding how different components interact was essential. I tested the system thoroughly to make sure it would work reliably when embedded in the dress.
-
Power Management: Managing the power needs of the Neopixels was a learning curve. I became more confident in understanding voltage requirements, avoiding overloads, and using external power sources effectively.
-
Soldering & Wiring: I practiced precise soldering and explored how to securely connect components to a wearable form.
-
Programming the Circuit Playground Express: Even though I wasn’t using a classic Arduino board, the Arduino programming environment allowed me to customize the lighting behaviors. I explored different coding logic, timing effects, and animations to enhance the storytelling aspect of the piece.
-
Blending Art & Technology: The most meaningful lesson was learning how to merge electronics with emotion—using light not just as decoration, but as a way to tell a story and evoke feeling. This taught me how powerful wearable technology can be in performance and design.
This experience gave me more confidence in working with interactive electronics, and I’m excited to continue pushing these creative boundaries in future costume and fashion work.