Bio-electronic interface for body response

Progress divided:
Hydrogel Development: We experimented with BTB as a pH indicator, testing both agar-agar and sodium alginate to create a reactive hydrogel. While agar-agar showed good reactivity, it was unstable over time, prone to fracturing, and retained moisture. Sodium alginate, though slower to dry, proved more stable and transparent, making it a better option for future iterations.






Ferrofluid Creation: Producing stable ferrofluid was challenging. We initially used iron oxide but later switched to metal shavings, which were more magnetic. The best suspension medium was hypersaturated saltwater, which stabilized the ferrofluid and prevented separation. We learned that the ferrofluid must be fully submerged to maintain its integrity.



Circuit and GSR Integration: We built a circuit using a GSR sensor to detect skin conductivity changes, intending to control electromagnets for ferrofluid movement. However, the GSR sensor provided overly stable signals, insufficient to drive the electromagnets effectively. We adapted by creating a variable intensity circuit suitable for different sensors or considering a simpler on/off control mechanism.

Wearable Design and Molding: The device was designed to be worn on the neck, with 3D-printed molds used for silicone casting. Some materials were too fragile, and we found that thinner silicone walls improve the electromagnetic response. Adjustments are needed to optimize the mold design, possibly replacing the hydrogel with liquid-filled capsules for clearer sweat visualization.
#define BTN_PIN 7
#define BTN_PINUP 6
#define EM_PIN 8
int GSR = A5;
//int POTPIN = A0;
int sensorValue=0;
int gsr_average=0;
// Adjust the value using the clamp function
int minValue = 380;
int maxValue = 379;
unsigned long T1 = 0, T2 = 0;
uint8_t TimeInterval = 1; // 5ms
void setup() {
Serial.begin(9600);
pinMode(BTN_PIN, INPUT);
pinMode(EM_PIN, OUTPUT);
DDRB |= (1 << DDB1) | (1 << DDB2); // Set ports
TCCR1A = (1 << COM1A1) | (1 << COM1B1) | (1 << WGM11); // Fast PWM mode
TCCR1B = (1 << WGM12) | (1 << WGM13) | (1 << CS10); // Fast PWM mode, no clock prescaling possible
OCR1A = 3240; // Start PWM just below MOSFET turn on
ICR1 = 8191;
}
void loop() {
long sum=0;
for(int i=0;i<10;i++) //Average the 10 measurements to remove the glitch
{
sensorValue=analogRead(GSR);
sum += sensorValue;
delay(1);
}
gsr_average = sum/10;
Serial.print("GSR Average:");
Serial.println(gsr_average);//*
int human_resistance = ((1024+2*gsr_average)*10000000)/(516-gsr_average);
Serial.print("human_resistance=");
Serial.println(human_resistance);
delay(1);
// Use the function to clamp the value within the given range
//int adjustedValue = clampValueToRange(gsr_average, minValue, maxValue);
//clampValueToRange(gsr_average, minValue, maxValue);
if (gsr_average < minValue) {
minValue = gsr_average; // Set to the minimum if the value is below minValue
} else if (gsr_average > maxValue) {
maxValue = gsr_average; // Set to the maximum if the value is above maxValue
} else{}
// Print the original and adjusted values
Serial.print("Original Value: ");
Serial.print(gsr_average);
Serial.print(" Adjusted Value: ");
//Serial.println(adjustedValue);
Serial.print("MinValue: ");
Serial.println(minValue);
Serial.print("MaxValue: ");
Serial.println(maxValue);
delay(600); // Wait a bit before reading again
T2 = millis();
if( (T2-T1) >= TimeInterval) // Every 5ms
{
int mappedvalue = map(gsr_average,minValue,maxValue,3242,8191);
Serial.print("Mappedvalue:");
Serial.println(mappedvalue);//*
// Read The Electromagnet Enable Button State
//int test = 8100;
//analogWrite(A1,test); // This writes the power to the Mosfet from 0-1024.
//3242-8191
OCR1A = mappedvalue;
T1 = millis();
}
}
```
Reflection
In order to finish the prototye, we still need to fill the ferrofluid into the mold. The ferrofluid we found in fablab can be carried in saltwater.
The data that GSR sensor collects is very steady, we tried to map the data range in coding to make a obvious change for electricity current that go through the electromagnet, but the change was still tiny to make the movement in ferrofluid.
It was a lot of tasks to complete for 4 days
Last updated