Programme your heated textile
Let’s get your fingers warm with this heated textile sensor. Have you ever dreamed of warm fingers and warm toes? With the WEARIC heating textile you are already on step closer. Make it!
This 10 minute tutorial tells you how you can switch on and off the textile heating element and how to regulate the temperature with a PWM-Controller.
Requirements:
• WEARIC Expansion Board
• nano controller V3.0 Atmel Atmega328
• Software Arduino IDE
• mini USB wire
• Textile Heating Element
• Textile Push Button
Safety Information:
Only use the WEARIC Expansion Board together with the WEARIC textile heating element. Also it is only allowed to supply the textile heating element with maximum 5V.
If you didn’t use the Arduino IDE software yet, please go to “Get started” to receive a step by step manual how to use it. Otherwise, let’s jump directly into coding.
To receive an overview how the textile heating element basically works we take a look on the circuit diagram of the WEARIC Expansion board.
The transistor Q1, which acts as a switch here, can be switched with the pin heating (pin 12 at the Nano). If the pin is set to HIGH (5V), the fabric heats up, when the pin is switched back to LOW, the textile cools down again.
The code is therefore very simple, since just one pin has to be switched to HIGH:
1. First of all we test if the heating element is connected properly to the expansion board by heating it with the maximum possible value.
Connect your nano controller V3.0 to your computer and start the Arduino IDE software. Place the following programming code into the software:
#define HEAT_PIN 12
void setup() {
// put your setupcode here, to run once:
pinMode(HEAT_PIN, OUTPUT);
digitalWrite(HEAT_PIN, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
}
Upload the code now on your nano controller and place it on the WEARIC Expansion board. Furthermore take the heatable textile sensor and place it on the board as well.
Your heating element should now be supplied with constant 5V. With a power consumption of 500mA it should reach a Temperature difference of about 17K.
2. The next step is to switch the heating element on and off with our push button.
Connect the push button with the expansion board and place the following programming code into the software:
#define HEAT_PIN 12
#define BUTTON1_PIN 8
void setup() {
pinMode(HEAT_PIN, OUTPUT);
pinMode(BUTTON1_PIN, INPUT);
}
void loop() {
if(!digitalRead(BUTTON1_PIN))
{
digitalWrite(HEAT_PIN, !digitalRead(HEAT_PIN));
delay(10);
while(!digitalRead(BUTTON1_PIN));
delay(10);
}
}
With pressing the first push button you now switch the heating element on. By pressing it again you can swich it off.
If you want to get a feedback if the heating element is on you can use the LED on the nano controller to show if the heating is active or not:
#define HEAT_PIN 12
#define BUTTON1_PIN 8
#define LED_PIN 13
void setup() {
pinMode(HEAT_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON1_PIN, INPUT);
}
void loop() {
if(!digitalRead(BUTTON1_PIN))
{
digitalWrite(HEAT_PIN, !digitalRead(HEAT_PIN));
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(10);
while(!digitalRead(BUTTON1_PIN));
delay(10);
}
}
3. The last step of this tutorial is the regulation of the heating element with the second push button
Therefore we use the integrated PWM controller of the nano controller and the electronic circuit of the expansion board. More information about the PWM-Setup you get in our LEARN section.
#define HEAT_PIN 12
#define BUTTON1_PIN 8
#define BUTTON2_PIN 9
#define LED_PIN 13
byte heatVal = 0;
void setup() {
pinMode(HEAT_PIN, OUTPUT);
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON1_PIN, INPUT);
pinMode(BUTTON2_PIN, INPUT);
}
void loop() {
if(!digitalRead(BUTTON1_PIN))
{
if(digitalRead(LED_PIN))
analogWrite(HEAT_PIN, heatVal);
else
analogWrite(HEAT_PIN, 0);
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(10);
while(!digitalRead(BUTTON1_PIN));
delay(10);
}
if(!digitalRead(BUTTON2_PIN))
{
heatVal ++;
delay(20);
}
}
Now you can apply the heating textile in your glove by ironing of the nonwoven with adhesive coating or sewing it. Note that the supply lines to the heating element should be very low resistance.
Try it out and have fun!