### 4-channel color changing textile

For this project, I added some computation to attempt to gain more precise control over the color changing qualities of the textile.

I used several n-mosfets and a lilypad microcontroller to control varying sections of the circuit programmatically. A mosfet is a transistor that can be used for switching electronic signals- essentially a voltage controlled gate. By sending a small voltage to the gate pin, a larger voltage can be passed through the drain pin. A pulldown resistor is connected between the gate and the source pin to pull the gate low when no input voltage is being supplied.

(Diagram created by Leah Buechley)

I used 4 n-mosfets to control 4 separate sections of thermochromic pigment by connecting the gate pin of each to a  separate digital pin on the lilypad. I then connected a separate 5v power supply to each individual section of the circuit that corresponded with the sections of the thermochromic pigment.

For programing the lilypad, I assigned each pin a number, and then toggled them on and off using a keyboard inputs via the serial monitor. I had to toggle all of the pins from input to output before switching them on and off, otherwise the voltage supplied by the pins would not be high enough to open the gate for the mosfets. Not sure if this was the ideal solution, but it seemed to work. The code for the project is available here: thermo_swatch.zip

For the current, I calculated the resistance of one of the circuits first:
I added up all of the resistances of the sections of conductive thread. I didn’t include the 10k resistor since the current wouldn’t pass through it when the gate was open.

V= IR
5v =  (14.2 ohms +3.3 ohms +  14.8 ohms) * I
I=  5/32.3
I=0.15 Amps

I*4 = 0.6 Amps total