Development of A Smart Clothing Product Using An A
Development of A Smart Clothing Product Using An A
Development of A Smart Clothing Product Using An A
2478/ijasitels-2021-0002
Abstract
This paper presents a "smart" clothing product implemented as a jacket that
contains sensors, a processing unit for display and interaction. The system has the
ability to remotely read the data provided by the sensors, ensuring the monitoring
of several parameters of the wearer.
The following characteristics have been considered: body temperature and
humidity, atmospheric temperature, pressure and altitude, the heart beat and
number of steps converted into the number of calories consumed and traveled
distance.
The data is acquired and processed by an Arduino AT Mega 2560, via the I2C bus,
digital ports and analog to digital converters, depending on the type of sensors. The
processed information is printed on a 128x64 pixel display. To be able to view more
pages of information, one can interact with the 4-key keyboard that has been
connected to the digital input ports or through a proximity sensor, which will
function as a gesture sensor.
The processed information can also be accessed from a web server, built on the
ESP8266 Wi-Fi module, connected to Arduino's TX/RX lines. A mobile phone or
another device can connect to the Access Point and open a web page which
displays the values of all sensors, as well as other information. The embedded
system was inserted on a jacket and wired according to the sensors and modules
usage.
Keywords: smart clothing, embedded system, Arduino, wearable electronics, e-
textile
1. Introduction
The concept of e-textiles refers to textile fabrics and embedded devices with
the purpose of detection, communication, decision making, sensing. As
textiles are washable, light, flexible, the embedded devices have to be
powered, breakable and cannot be washed [1]. For the textile industry, the
potential offered by combining these two fields is very large. Beginning with
smart medical products (which will be preferred to the classic ones due to
their multi-functionality), passing through the field of protective clothing
(another field in which smart materials are and will be widely used) and
finishing with interior design objects, we are certain to express that smart
textiles are the future of this industry, whatever will be their application [2].
38
International Journal of Advanced Statistics and IT&C for Economics and Life Sciences
December 2021 * Vol. XI, no. 1
The Wi-Fi module communicates with Arduino through the TX and RX pins of
the Serial Port 1. In this way, communication does not interfere with Serial
Port 0 connected to the USB. The pulse sensor is powered at 5V and provides
an analog output connected to pin A0, from which the value is converted
numerically by an ADC.
The Arduino Mega 2560 development board [7] uses the ATmega2560
microcontroller, which has 54 digital I/O pins, 16 analog pins, 4 serial
interfaces, a 16 MHz clock, a USB connector, a power connector and a push -
reset button.
The OLED display module [8] can be used to display alphanumeric or
graphical data with low power consumption. The resolution available for the
device used is quite high, allowing the display of 128 x 64 pixels. It has a
consumption of only 0.1W, a diagonal of 0.94 inches and a viewing angle
greater than 160°.
Regardless of the size of the OLED display, the SSD1306 driver has a 1KB
Graphic Display Data (GDDRAM) RAM that contains the bit image that will be
displayed. This 1K memory area is organized into 8 pages, where a page
(1)
(2)
Communication with the microcontroller is done via the I2C interface. The
default resolution is set to 14 bits for relative humidity and 12 bits for
temperature reading. The measured data is transferred in two-byte packets,
i.e. in frames with a length of 8 bits where the most significant bit (MSB) is
transferred first (from left to right).
(3)
To calculate the altitude at the current location in relation to the sea level, the
variable Po is assigned the value of 1013.0 and P is the measured pressure at
location.
to the infrared light intensity reflected by the skin surface and is in the range
0.3 V - 5 V.
The APDS-9930 [13] is used for ambient light detection and a complete
single-chip proximity detection system. The proximity detection function is
activated by strong sunlight up to low ambient light. The wide dynamic range
also allows operation in a low power mode between ALS (Ambient Light
Sense) and proximity measurement.
The APDS-9930 offers I2C communication in a single 8-pin package. The
ambient light sensor uses a dual LED to approximate 0.01 lux. The proximity
sensor can detect objects at up to 100mm. It works perfectly both in sunlight
and in dark rooms. It has micro-optical lenses to provide efficient infrared
transmission and reception.
ESP8266 [14] is a low-cost Wi-Fi module that belongs to the ESP family,
which you can use to control your electronic projects anywhere in the world.
It has a built-in microcontroller and a 1 MB flash memory that allows it to
connect to a Wi-Fi. The TCP / IP protocol stack allows the module to
communicate with Wi-Fi signals. The maximum working voltage of the module
is 3.3 V.
We will configure ESP8266 through its serial interface, using AT commands.
The Arduino program must generate AT commands to reset the Wi-Fi module
(“AT + RST”). The next step is to configure this module as a Wi-Fi access
point (“AT + CWMODE = 2”). After this step, read the IP address of the
module, 192.168.4.1, using the command: “AT + CIFSR”, which will also print
the MAC address. To obtain the connection information (SSID), we will run
the command (“AT + CWSAP?”): the network name and password will be
returned (by default there is no password), and then we can configure the
system to accept multiple connections (“AT + CIPMUX = 1“) and we will start
the web server on port 80 (“AT + CIPSERVER = 1.80”). Each AT command
must end with carriage return and newline (“\ r \ n”).
loop, we used for most of the sensors and the display system the libraries
offered by the manufacturer, without the need to manage the I2C
communication with the device. In the case of the 3-axis acceleration sensor,
we tried the direct use of the command, status and data registers.
From the following subchapters, it will be seen that we used the default
functions specified above, to which we had added others, necessary to read
the data from the sensors or to communicate with web clients.
void setup()
{
Wire.begin(); //INIT. OF THE COMMUNICATION ON I2C
Wire.setClock(400000); //SETTING OF THE I2C BUS CLOCK AT 400 KHZ
// INIT.THE AMBIENT LIGHT SENSOR AND THE ATM.PRESSURE/TEMP.SENSOR
apds.init();
bmp.begin();
// DIGITAL PINS FOR THE KEYBOARD
pinMode(key1, INPUT_PULLUP);// SETTING OF PIN 2 AS input
pinMode(key2, INPUT_PULLUP);// SETTING OF PIN 3 aS input
pinMode(key3, INPUT_PULLUP);// SETTING OF PIN 4 aS input
pinMode(key4, INPUT_PULLUP);// SETTING OF PIN 5 aS input
// INITIALIZATION OF ADXL345
writeTo(DEVICE, 0x2D, 0); //MEASUREMENT START ORDER
writeTo(DEVICE, 0x2D, 16);
writeTo(DEVICE, 0x2D, 8);//BIT D3 HIGH FOR MEASUREMENT IS ENABLED
// WE CONFIGURE THE PULSESENSOR OBJECT, WITH OUR OWN VARIABLES
pulseSensor.analogInput(PulseWire);
pulseSensor.setThreshold(Threshold);
pulseSensor.begin();
// TURNING ON THE APDS-9930 LIGHT SENSOR
apds.enableLightSensor(false);
// WE OPEN SERIAL COMMUNICATION FOR THE WIFI MODULE
Serial1.begin(115200);
wifi_init();
delay(100);
void loop()
{
read_ambient_light(); // CALL THE GESTURE DETECTION FUNCT.
// THESE FUNCTIONS ARE USED TO GET TEMPERATURE,
// MOISTURE, ALT., PRESS. VALUES
TempC = sht.getTemperature();
Humidity = sht.getHumidity();
TempA = bmp.readTemperature();
Pressure = ceil(bmp.readPressure()/100);
Altitude = bmp.readAltitude();
input keys or inside the function that determines the change of light intensity
detected by the light sensor.
BREAK;
}
}
DISPLAY.DISPLAY(); // DISPLAYING THE CURRENT DISPLAY
}
VOID READ_KEY()
{
INT KEY1S = DIGITALREAD(KEY1); // READING IF KEY1 IS PRESSED
INT KEY2S = DIGITALREAD(KEY2); // READING IF KEY2 IS PRESSED
INT KEY3S = DIGITALREAD(KEY3); // READING IF KEY3 IS PRESSED
INT KEY4S = DIGITALREAD(KEY4); // READING IF KEY4 IS PRESSED
IF(!KEY1S) // IF THE KEY1 HAS BEEN PRESSED, GO TO THE NEXT PAGE
++STATE;
IF(!KEY2S) // IF THE KEY2 HAS BEEN PRESSED, GO TO THE PREVIOUS PAGE
--STATE;
IF (STATE<0)// FROM THE FIRST PAGE TO PAGE 3
STATE=3;
IF (STATE>3)// IF ON PAGE 3 THE KEY1 HAS BEEN PRESSED, GO TO PAGE 0
STATE=0;
IF(!KEY4S) // IF THE KEY4 HAS BEEN PRESSED, STEPS COUNTER IS RESET
STEPS=0;
}
VOID READ_AMBIENT_LIGHT()
{
INT I;
FLOAT STD=0, SUM=0;
FLOAT AMBIENT_LIGHT_T[5];
// THE INDEX OF THE LAST PAGE IS 3 AND THE STATE WILL BE RESET
IF(STATE==4);
STATE=0; // GO TO THE FIRST PAGE
}
The variations of the ambient light intensity are determined and, also, the
presence of some peaks in these variations, as can be seen from figure 6.
JACKET\",\"12345678\",10,4\R\N",1000);
ESTABLISHCONNECTION("AT+CIPMODE=0\R\N",100);// TRANSPARENT MODE
ESTABLISHCONNECTION("AT+CIPMUX=1\R\N",100);//MULTIPLE CONNECTIONS
// CREATING A TCP SERVER ON PORT 80
ESTABLISHCONNECTION("AT+CIPSERVER=1,80\R\N",1000);
}
The ESP8266 module responds with the string "OK" to the correct completion
of AT commands. Since these commands have different completion times, it
was necessary to call the establishconnection() function. It receives as
parameters the command (type string) and the waiting time for response. The
command is sent through serial port 1 to the module and a time-out equal to
the specified one is expected. Correspondingly, if no response has been
received after the first command, at least twice attempts will be made to
resend the command.
The WI-FI module uses a special command to send data through its modem,
namely AT + CIPSEND = 0, N, where N represents the number of characters
that will be sent immediately after receiving the command. The senddata()
function receives the string, measures its length, terminates it with an enter
(CRLF) and sends it via the modem.
DELAY(100);
SERIAL1.PRINT("AT+CIPCLOSE=0\R\N"); // THE TCP CONNECTION TO THE CLIENT IS
CLOSED
}
Figure 7 shows the web page via the Safari browser of an iPhone connected
to the e-jacket’s AP.
4. Results
The first version of the system was used for testing purposes was tied to a
cardboard panel. The interconnections were made with wire strips,
dimensioned for their future placement on the jacket. As seen from figures 8
and 9, connectors were used for the connection between the module’s wiring
and the Arduino module.
After assembling the electrical connections and wiring, the software was
implemented via the Arduino IDE. The source code was written for each
module separately and an attempt was made to calibrate them. Optimal
values were assigned to their corresponding variables in each code part. The
OLED display can display, with a special set of characters, a maximum of 3
lines of text, as seen in figure 10. Therefore, we present the 4 screens
displaying the data.
a) b)
Figure 8. Connecting a) the pulse sensor, the ambient light sensor and the OLED display; and
b) the two combined sensors of temperature, humidity, altitude, pressure on the I2C
a) b)
c) d)
Figure 9. Connecting a) the acceleration sensor and b) the Wi-Fi module; c) the keyboard and
d) the Arduino module to the other sensors
a) b)
c) d)
Figure 10. The display of the e-jacket data; a) the body temperature and humidity; b) the
outdoor temperature, atmospheric pressure and altitude; c) the BPM detection; d) the
number of steps, calories burned and the distance traveled
The jacket has two layers; the first one made of the base material of 100%
cotton fabric, which is completed by an inner layer, the lining, with 100%
cotton fabric. The devices will be placed in the clothing product so that they
can perform their functions. The Arduino development board and the battery
will be inserted in the inside pockets of the jacket and the temperature and
humidity sensor will be fixed inside it, so that they can measure the two
parameters as close as possible to the body. The Wi-Fi module can be fixed
on the shoulder line, and the 3-axis accelerometer sensor, as well as the
proximity and gesture sensor, the keyboard and the display can be fixed on
the surface of the two sleeves. The pulse sensor can be fixed on a finger
using a Velcro as shown in figure 11.
a) b)
c) d)
e)
Figure 11. Positioning the display, keyboard and sensor; a) their position and the cut of the
interior pockets and the display window; b) inscriptions by thermal transfer; c) position of the
pulse sensor; d) the final clothing product; e) position of the battery, the Arduino module (in
the pocket) and the sensors
a) b)
c)
Figure 12. Connecting the e-jacket to the Wi-Fi module; a) retrieving the SSID of the e-
jacket’s access point; b) the TCP/IP configuration received from the e-jacket’s DHCP server;
c) the values displayed while accessing the e-jacket web server using a web browser
5. Conclusions
References
[1] Ismar, E., Kurşun, S., Kalaoglu, F., Koncar, V., Futuristic Clothes: Electronic Textiles
and Wearable Technologies , Global Challenges, 4, 2020
https://doi.org/10.1002/gch2.201900092
[2] Raluca Brad, E-textile: imbracamintea computerizata de la cercetare la productie ,
Sesiunea de Comunicari stiintifice, Academia Fortelor Terestre "Nicolae Balcescu",
2003
[3] Koncar, Vladan, Smart Textiles and Their Applications , Woodhead Publishing, Print
ISBN: 9780081005743, 2016
[4] Choudhry, N.A., Arnold, L., Rasheed, A., Khan, I.A. and Wang, L. Textronics - A
Review of Textile-Based Wearable Electronics, Adv. Eng. Mater, 2100469, 2021
https://doi.org/10.1002/adem.202100469
[5] Wang, Shuguang and Wang, Zhongwu and Li, Jie and Li, Liqiang and Hu, Wenping,
Surface-grafting polymers: from chemistry to organic electronics , Mater. Chem.
Front., vol. 4, iss. 3, pp. 692-714, 2020 doi = 10.1039/C9QM00450E
[6] Bedon, C., Rajčić, V., Textiles and Fabrics for Enhanced Structural Glass Facades:
Potentials and Challenges, Buildings, 9, 156, 2019
https://doi.org/10.3390/buildings9070156
[7] https://www.arduino.cc/en/Guide/ArduinoMega2560
[8] https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
[9] http://www.farnell.com/datasheets/1780639.pdf
[10] https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf
[11] https://www.analog.com/media/en/technical-documentation/data-
sheets/ADXL345.pdf
[12]https://components101.com/asset/sites/default/files/component_datasheet/Pulse%20
Sensor%20Datasheet.pdf
[13] https://docs.broadcom.com/doc/AV02-3190EN
[14] https://www.espressif.com/sites/default/files/documentation/0a -
esp8266ex_datasheet_en.pdf