Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 46

ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER 1
INTRODUCTION

Sleep, a resting state within which our body is not active and therefore the mind is
insensible. Sleep is that the act of slumbering. At now, our body systems can refresh themselves.
English lexicon outlined sleep as a state of body and mind that relapse for many hours nightly,
the eyes closed, the body muscles relaxed, and the nervous system is idle.

Sleep deficiency can cause the increasing of the risk of heart unwellness, high blood
pressure and stroke. Moreover, it conjointly helps to maintain the balance of hormones within
the body. Lack of sleep causes the increasing of hormone level and also the leptin level can
decrease. In fact, this explains the link between inadequate sleep and avoirdupois. Besides, sleep
conjointly supports growth and developments.
1.1Embedded system implementation
INTRODUCTION:
An embedded system is one kind of a computer system mainly designed to perform
several tasks like to access, process, and store and also control the data in various electronics-
based systems. Embedded systems are a combination of hardware and software where software
is usually known as firmware that is embedded into the hardware. One of its most important
characteristics of these systems is, it gives the o/p within the time limits. Embedded systems
support to make the work more perfect and convenient. So, we frequently use embedded systems
in simple and complex devices too. The applications of embedded systems mainly involve in our
real life for several devices like microwave, calculators, TV remote control, home security and
neighborhood traffic control systems, etc.

DEPT OF ECE, SIETK Page 1


ADVANCED HEALTH SENSING SMART PILLOW

User interface

Embedded system

Software Hardware

Inputs
Output

Link to other systems


Fig1: Overview of embedded system
Embedded system:

Input devices
interfacing
and driver
circuits

Timers Memory
Power Applicati
supply on
and specific
oscillato Processor Serial circuits
r communicat
circuits ion ports

Interru Paral
pt lel
controll port
er s
Output devices interfacing

Fig 2: Block Diagram of Embedded System

DEPT OF ECE, SIETK Page 2


ADVANCED HEALTH SENSING SMART PILLOW

Embedded system includes mainly two sections, they are


1. Hardware 2. Software

Embedded System Hardware:


As with any electronic system, an embedded system requires a hardware platform on
which it performs the operation. Embedded system hardware is built with a microprocessor or
microcontroller. The embedded system hardware has elements like input output (I/O) interfaces,
user interface, memory and the display. Usually, an embedded system consists of:
 Power Supply
 Processor
 Memory
 Timers
 Serial communication ports
 Output/Output circuits
 System application specific circuits

Embedded systems use different processors for its desired operation. Some of the processors
used are
1. Microprocessor
2. Microcontroller
3. Digital signal processor

Embedded System Software:


The embedded system software is written to perform a specific function. It is typically
written in a high level format and then compiled down to provide code that can be lodged within
a non- volatile memory within the hardware. Embedded system software is designed to keep in
view of the three limits:
 Availability of system memory
 Availability of processor’s speed
 When the system runs continuously, there is a need to limit power dissipation for events
like stop, run and wake up.

DEPT OF ECE, SIETK Page 3


ADVANCED HEALTH SENSING SMART PILLOW

Bringing software and hardware together for embedded system:


To make software to work with embedded systems we need to bring software and
hardware together .for this purpose we need to burn our source code into microprocessor or
microcontroller which is a hardware component and which takes care of all operations to be done
by embedded system according to our code.
Generally we write source codes for embedded systems in assembly language, but the
processors run only executable files.The process of converting the source code representation of
your embedded software into an executable binary image involves three distinct steps:
1. Each of the source files must be compiled or assembled into an object file.
2. All of the object files that result from the first step must be linked together to produce a
single object file, called the re-locatable program.
3. Physical memory addresses must be assigned to the relative offsets within the re-
locatable program in a process called relocation.
The result of the final step is a file containing an executable binary image that is ready to run on
the embedded system.
APPLICATIONS:
Embedded systems have different applications. A few select applications of embedded
systems are smart cards, telecommunications, satellites, missiles, digital consumer electronics,
computer networking, etc.
Embedded Systems in Automobiles
 Motor Control System
 Engine or Body Safety
 Robotics in Assembly Line
 Mobile and E-Com Access
Embedded systems in Telecommunications
 Mobile computing
 Networking
 Wireless Communications

DEPT OF ECE, SIETK Page 4


ADVANCED HEALTH SENSING SMART PILLOW

Embedded Systems in Smart Cards


 Banking
 Telephone
 Security Systems
IMPLEMENTATION FLOW:

Stage 1:

Considering the problems of existing methods and giving solution to that problem
by considering the basic requirements for our proposed system
Stage 2:
Considering the hardware requirement for the proposed system For this we need

to select the below components:

1. Microcontroller

2. Inputs for the proposed system (ex: sensors, drivers etc..,)

3. Outputs (ex: relays, loads)

Stage 3:

After considering hardware requirements, now we need to check out the software
requirements. Based on the microcontroller we select there exists different
software for coding, compiling, debugging. we need to write source code for that
proposed system based on our requirements and compile, debug the code in that
software . After completing all the requirements of software and hardware we
need to bring both together to work our system.

DEPT OF ECE, SIETK Page 5


ADVANCED HEALTH SENSING SMART PILLOW

1.3 LITERATURE SURVEY


Table no: 1
S.NO TITLE AUTHOR LEARNING OUTCOMES
1. Sensor pillow system: T. Harada This paper also presents a
monitoring respiration and simple motion model which
body movementin sleep explains the change of the
head pressure distribution
accompanied with
respiration. Based on this
model, respiration count
algorithms are proposed.
2. Smart Pillow— Intelligent Archana devi.S.M This paper describes a non
system to comfort pharmacological solution,
newborn infants called Smart, which Provides
using vibration and monitoring comfort through mediation of
movement of the infants a parent’s physiological
via wireless sensor system features to the distressed
neonate via an intelligent
pillow system embedded
with sensing and actuating
functions.
3. Smart Pillow journal of S.Vandana This paper also presents
analytical and a simple motion model
experimental modal analysis which explains the change of
(2020) the head pressure
distribution companied with
respiration. Based on this
model, respiration count
algorithms are proposed.
4. Smart Pillow for all age groups V. Sahaya Sakila This paper presents a
simple model of pillow to
have peaceful sleep
5. Smart neck pillow designed Adam Fauzi Akbar In this paper it represents a
based on thermal therapy
simple pillow which
prevents tension neck
syndrome.

DEPT OF ECE, SIETK Page 6


ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER 2

METHODOLOGY

EXISTING METHOD
In existing we are using some apps to detect the sleep hours, heart rate and some other
physical activities. With all these things we cannot monitor continuously the sleep environment.
Based on sleep environments also the sleep time will depends.

DRAWBACKS FOR EXSITING METHOD


 In existing method we cannot simultaneously cannot monitor heart beat, room
temperature.
 In existing method we don’t have CPU Fan which operates based on the room
temperature.
 We doesn’t have buzzer to give alarm or warning sounds.
PROPOSED METHOD
In this project we will monitor the parameters like light intensity, temperature and
humidity of the room and temperature and heart rate of the person. If any of the sensor crosses its
threshold values buzzer will alert. Fan will work based on the speed which is based on
temperature of the room.
BLOCK DIAGRAM FOR PROPOSED METHOD

Fig 3: block diagram of proposed method

DEPT OF ECE, SIETK Page 7


ADVANCED HEALTH SENSING SMART PILLOW

2.2.1. Working principle:

The input and output modules are connected to Arduino pins. To make the system to look
real modules and battery are glued to a pillow. DHT11Continuously monitors the temperature
and humidity of the room. Output pin of the sensor is connected to the Arduino. If the
temperature of the room is changing based on that the fan speed will change
continuously.DS18B20 Is a temperature sensor which monitors body temperature so we need to
hold that sensor in hand to show body temperature variation. Heartbeat sensor is to continuously
monitor the heart rate. This sensor will have clip type at one end we need to place our finger in
the sensor clip so that the heart rate will be calculated and will be displayed on LCD. LDR is for
checking light intensity. If any of the sensor crossed threshold value buzzer alert will be given.

DEPT OF ECE, SIETK Page 8


ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER 3
HARDWARE REQUIREMENTS
HARDWARE REQUIREMENTS
ARDUINO UNO

The Arduino microcontroller is an easy to use yet powerful single board computer that
has gained considerable traction in the hobby and professional market. The Arduino is open-
source, which means hardware is reasonably priced and development software is free. This guide
is for students in ME 2011, or students anywhere who are confronting the Arduino for the first
time. For advanced Arduino users, prowl the web; there are lots of resources.
This is what the Arduino board looks like.

Fig4: Arduino UNO Board

DEPT OF ECE, SIETK Page 9


ADVANCED HEALTH SENSING SMART PILLOW

The Arduino programming language is a simplified version of C/C++. If you know C,


programming the Arduino will be familiar. If you do not know C, no need to worry as only a few
commands are needed to perform useful functions.

The power of the Arduino is not its ability to crunch code, but rather its ability to interact
with the outside world through its input-output (I/O) pins. The Arduino has 14 digital I/O pins
labeled 0 to 13 that can be used to turn motors and lights on and off and read the state of
switches.

Each digital pin can sink or source about 40 mA of current. This is more than adequate
for interfacing to most devices, but does mean that interface circuits are needed to control
devices other than simple LED's. In other words, you cannot run a motor directly using the
current available from an Arduino pin, but rather must have the pin drive an interface circuit that
in turn drives the motor. A later section of this document shows how to interface to a small
motor.

To interact with the outside world, the program sets digital pins to a high or low value
using C code instructions, which corresponds to +5 V or 0 V at the pin. The pin is connected to
external interface electronics and then to the device being switched on and off. The sequence of
events is shown in this figure.

DEPT OF ECE, SIETK Page 10


ADVANCED HEALTH SENSING SMART PILLOW

Fig 5: Connection of Digital pins


To determine the state of switches and other sensors, the Arduino is able to read the
voltage value applied to its pins as a binary number. The interface circuitry translates the sensor
signal into a 0 or +5 V signal applied to the digital I/O pin. Through a program command,
theArdiomp interrogates the state of the pin. If the pin is at 0 V, the program will read it as a 0
orLOW. If it is at +5 V, the program will read it as a 1 or HIGH. If more than +5 V is applied,
you may blow out your board, so be careful.
Interacting with the world has two sides. First, the designer must create electronic
interface circuits that allow motors and other devices to be controlled by a low (1-10 mA)
current signal that switches between 0 and 5 V, and other circuits that convert sensor readings
into a switched 0 or 5 V signal. Second, the designer must write a program using the set of
Arduino commands that set and read the I/O pins. Examples of both can be found in the Arduino
resources section of the ME2011 web site.

Atmega328p features:

High Performance, Low Power AVR® 8-Bit Microcontroller


Advanced RISC Architecture
131 Powerful Instructions

Most Single Clock Cycle Execution

32 x 8 General Purpose Working Registers

Fully Static Operation

Up to 20 MIPS Throughput at 20 MHz

On-chip 2-cycle Multiplier

High Endurance Non-volatile Memory Segments

4/8/16/32K Bytes of In-System Self-Programmable


Flash progam memory
(ATmega48PA/88PA/168PA/328P)

– 256/512/512/1K Bytes EEPROM (ATmega48PA/88PA/168PA/328P)

DEPT OF ECE, SIETK Page 11


ADVANCED HEALTH SENSING SMART PILLOW

512/1K/1K/2K Bytes Internal SRAM (ATmega48PA/88PA/168PA/328P)


– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

– Data retention: 20 years at 85°C/100 years at 25°C(1)

– Optional Boot Code Section with Independent Lock Bits In-


System Programming by On-chip Boot Program True Read-While-Write
Operation

– Programming Lock for Software Security

 Peripheral Features

– Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode

– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode,


and Capture
Mode

– Real Time Counter with Separate Oscillator

– Six PWM Channels – 8-channel 10-bit ADC in TQFP and


QFN/MLF package Temperature Measurement – 6-channel 10-bit
ADC in PDIP Package Temperature Measurement
– Programmable Serial USART

– Master/Slave SPI Serial Interface

– Byte-oriented 2-wire Serial Interface (Philips I2 C compatible)

– Programmable Watchdog Timer with Separate On-chip Oscillator

– On-chip Analog Comparator

– Interrupt and Wake-up on Pin Change

 Special Microcontroller Features

– Power-on Reset and Programmable Brown-out Detection

DEPT OF ECE, SIETK Page 12


ADVANCED HEALTH SENSING SMART PILLOW

– Internal Calibrated Oscillator

– External and Internal Interrupt Sources

Six Sleep Modes: Idle, ADC Noise Reduction, Power-save,


Power-down, Standby, and Extended Standby
 I/O and Packages

– 23 Programmable I/O Lines

– 28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF

 Operating Voltage:

– 1.8 - 5.5V for ATmega48PA/88PA/168PA/328P

 Temperature Range:

– -40°C to 85°C

 Speed Grade:

– 0 - 20 MHz @ 1.8 - 5.5V

 Low Power Consumption at 1 MHz, 1.8V, 25°C for


ATmega48PA/88PA/168PA/328P:
– Active Mode: 0.2 mA

– Power-down Mode: 0.1 µA

– Power-save Mode: 0.75 µA (Including 32 kHz RTC)


PIN CONFIGURATIONS

DEPT OF ECE, SIETK Page 13


ADVANCED HEALTH SENSING SMART PILLOW

Pin Descriptions VCC: Digital supply voltage. GND: Ground.


Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2: Port B is an 8-bit bi-directional I/O
port with internal pull-up resistors (selected for each bit). The Port B output buffers have
symmetrical drive characteristics with both high sink and source capability. As inputs, Port B
pins that are externally pulled low will source current if the pull-up resistors are activated. The
Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.
Depending on the clock selection fuse settings, PB6 can be used as input to the inverting
Oscillator amplifier and input to the internal clock operating circuit. Depending on the clock
selection fuse settings, PB7 can be used as output from the inverting Oscillator amplifier. If the
Internal Calibrated RC Oscillator is used as chip clock source, PB7..6 is used as TOSC2..1 input
for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set. The various special features
of Port B are elaborated in ”Alternate Functions of Port B” on page 76 and ”System Clock and
Clock Options” on page 26.
Port C (PC5:0): Port C is a 7-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The PC5..0 output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port C pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset
condition becomes active, even if the clock is not running.
PC6/RESET: If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note
that the electrical characteristics of PC6 differ from those of the other pins of Port C. If the
RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin for
longer than the minimum pulse length will generate a Reset, even if the clock is not running. The
minimum pulse length is given in Table 28-3 on page 308. Shorter pulses are not guaranteed to
generate a Reset. The various special features of Port C are elaborated in ”Alternate Functions of
Port C” on page 79.
Port D (PD7:0): Port D is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port D output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port D pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset
condition becomes active, even if the clock is not running. The various special features of Port D

DEPT OF ECE, SIETK Page 14


ADVANCED HEALTH SENSING SMART PILLOW

are elaborated in “Alternate Functions of Port D” on page 82.


AVCC: AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It
should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it
should be connected to VCC through a low-pass filter. Note that PC6..4 use digital supply
voltage, VCC.
AREF: AREF is the analog reference pin for the A/D Converter
ADC7:6 (TQFP and QFN/MLF Package Only): In the TQFP and QFN/MLF package,
ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from the analog
supply and serve as 10-bit ADC channels.

BLOCK DIAGRAM

Fig7: Block diagram

DEPT OF ECE, SIETK Page 15


ADVANCED HEALTH SENSING SMART PILLOW

The ATmega48PA/88PA/168PA/328P provides the following features: 4/8/16/32K bytes


of In System Programmable Flash with Read-While-Write capabilities, 256/512/512/1K bytes
EEPROM, 512/1K/1K/2K bytes SRAM, 23 general purpose I/O lines, 32 general purpose
working registers, three flexible Timer/Counters with compare modes, internal and external
interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial
port, a 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable
Watchdog Timer with internal Oscillator, and five software selectable power saving modes.
Memory:

The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Input and Output


Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or
receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of
20-50 kOhms. In addition, some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These
pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.

 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.

 LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value,
the LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible

DEPT OF ECE, SIETK Page 16


ADVANCED HEALTH SENSING SMART PILLOW

to change the upper end of their range using the AREF pin and the analogReference() function.
Additionally, some pins have specialized functionality:
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire
library.
There are a couple of other pins on the board:
 AREF. Reference voltage for the analog inputs. Used with analogReference().
 Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button
to shields which block the one on the board.See also the mapping between Arduino pins and
ATmega328 ports. The mapping for theAtmega8, 168, and 328 is identical.

PROGRAMMING
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your board).
For details, see the reference and tutorials. The ATmega328 on the Arduino Uno comes
preburned with a bootloader that allows you to upload new code to it without the use of an
external hardware programmer. It communicates using the original STK500 protocol (reference,
C header files). You can also bypass the bootloader and program the microcontroller through the
ICSP (In-Circuit Serial Programming) header; see these instructions for details. The
ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available . The
ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:

 On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy)
and then resetting the 8U2.

 On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.

You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X
and Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.

This means that the bootloader can have a shorter timeout, as the lowering of DTR can be
well-coordinated with the start of the upload. This setup has other implications. When the Uno is
connected to either a computer running Mac OS X or Linux, it resets each time a connection is

DEPT OF ECE, SIETK Page 17


ADVANCED HEALTH SENSING SMART PILLOW

made to it from software (via USB). For the following halfsecond or so, the bootloader is
running on the Uno. While it is programmed to ignore malformed data(i.e.anything besides an
upload of new code), it will intercept the first few bytes of data sent to the board after a
connection is opened.

DHT11 SENSOR (TEMPERATURE/HUMIDITY):


The DHT11 is a basic, low-cost digital temperature and humidity sensor. It uses a
capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a
digital signal on the data pin (no analog input pins needed). It’s fairly simple to use, but requires
careful timing to grab data. The only real downside of this sensor is you can only get new data
from it once every 2 seconds.

Fig 8:DHT11 Sensor

Table no 2: Technical Specifications:

Measurement Humidity Temperature


Item Resolution Package
Range Accuracy Accuracy
±20
DHT11 20- ±5%RH C 1 4 Pin
90%RH
Single
0-500C
Row

Power supply:
A power supply is a component that provides at least one electrical charge with power. It
typically converts one type of electrical power to another, but it can also convert a different
Energy form in electrical energy, such as solar, mechanical, or chemical.

DEPT OF ECE, SIETK Page 18


ADVANCED HEALTH SENSING SMART PILLOW

A power supply provides electrical power to components. Usually the term refers to
devices built into the powered component. Computer power supplies, for example, convert AC
current to DC current and are generally located along with at least one fan at the back of the
computer case.

Most computer power supplies also have an input voltage switch that, depending on the
geographic location, can be set to 110v/115v or 220v/240v. Due to the different power voltages
supplied by power outlets in different countries, this switch position is crucial.

Fig 9: Power supply

TEMPERATURE SENSOR
The DS18B20 is one type of temperature sensor and it supplies 9-bit to 12-bit readings of
temperature. These values show the temperature of a particular device. The communication of
this sensor can be done through a one-wire bus protocol which uses one data line to
communicate with an inner microprocessor. Additionally, this sensor gets the power supply
directly from the data line so that the need for an external power supply can be eliminated. The
applications of the DS18B20 temperature sensor include industrial systems, consumer products,
systems which are sensitive thermally, thermostatic controls, and thermometers.

DEPT OF ECE, SIETK Page 19


ADVANCED HEALTH SENSING SMART PILLOW

Fig 10: Temperature sensor


HEART BEAT SENSOR
 Monitoring heart rate is very important for athletes, patients as it determines the
condition of the heart (just heart rate). There are many ways to measure heart rate and the
most precise one is using an Electrocardiography.

 But the more easy way to monitor the heart rate is to use a Heartbeat Sensor. It comes in
different shapes and sizes and allows an instant way to measure the heartbeat.

Fig11: Heart beat Sensor


LDR Sensor:
A Light Dependent Resistor (also known as a photoresistor or LDR) is a device whose
resistivity is a function of the incident electromagnetic radiation. Hence, they are light-sensitive
devices. They are also called as photoconductors, photoconductive cells or simply photocells.
They are made up of semiconductor materials that have high resistance. There are many different
symbols used to indicate a photoresistor or LDR, one of the most commonly used symbol is

DEPT OF ECE, SIETK Page 20


ADVANCED HEALTH SENSING SMART PILLOW

shown in the figure below. The arrow indicates light falling on it.
Fig 12: LDR Sensor

Working Principle of Photoresistor (LDR)


When light falls i.e. when the photons fall on the device, the electrons in the valence band
of the semiconductor material are excited to the conduction band. These photons in the incident
light should have energy greater than the bandgap of the semiconductor material to make the
electrons jump from the valence band to the conduction band.
Hence when light having enough energy strikes on the device, more and more electrons
are excited to the conduction band which results in a large number of charge carriers. The result
of this process is more and more current starts flowing through the device when the circuit is
closed and hence it is said that the resistance of the device has been decreased. This is the most
common working principle of LDR.

3.1.8 COOLING FAN


A Central Processing Unit (CPU) is the main microchip in a computer, whilea CPU
fan is the dedicated fan that helps keep the processor cool. Processors generate heat from internal
electrical energy. The more demand placed on a CPU, the harder it works, and the warmer it
gets.
The sole function of computer fans is to cool the system by drawing colder air from the
outside into the computer chambers and components, mainly the CPU. In some computers, you
will find the fan as a component of its power supply where it is performing its cooling
conditions.

DEPT OF ECE, SIETK Page 21


ADVANCED HEALTH SENSING SMART PILLOW

Fig 13: CPU Fan

3.1.9. Battery:
A rechargeable battery is an energy storage device that can be charged again after being
discharged by applying DC current to its terminals.
Rechargeable batteries allow for multiple usages from a cell, reducing waste and
generally providing a better long-term investment in terms of dollars spent for usable device
time. This is true even factoring in the higher purchase price of rechargeable and the requirement
for a charger.
A rechargeable battery is generally a more sensible and sustainable replacement to one-
time use batteries, which generate current through a chemical reaction in which a reactive anode
is consumed. The anode in a rechargeable battery gets consumed as well but at a slower rate,
allowing for many charges and discharges.
In use, rechargeable batteries are the same as conventional ones. However, after
discharge the batteries are placed in a charger or, in the case of built-in batteries, an AC/DC
adapter is connected.
While rechargeable batteries offer better long term cost and reduce waste, they do have a
few cons. Many types of rechargeable cells created for consumer devices, including AA and

DEPT OF ECE, SIETK Page 22


ADVANCED HEALTH SENSING SMART PILLOW

AAA, C and D batteries, produce a lower voltage of 1.2v in contrast to the 1.5v of alkaline
batteries. Though this lower voltage doesn't prevent correct operation in properly-designed
electronics, it can mean a single charge does not last as long or offer the same power in a session.
This is not the case, however, with lithium polymer and lithium ion batteries. Some types of
batteries such as nickel cadmium and nickel-metal hydride can develop a battery memory effect
when only partially discharged, reducing performance of subsequent charges and thus battery life
in a given device. Rechargeable batteries are used in many applications such as cars, all manner
of consumer electronics and even off-grid and supplemental facility power storage.

Fig 14: Battery


DC Motor:

A machine that converts D.C power into mechanical power is known as a d.c. motor. Its
operation is based on the principle that when a current carrying conductor is placed in a magnetic
field, the conductor experiences a mechanical force. The direction of this force is given by
Fleming’s left hand rule and magnitude is given by;

F = BIl newton’s

Basically, there is no constructional difference between a D.C. motor and a D.C.

DEPT OF ECE, SIETK Page 23


ADVANCED HEALTH SENSING SMART PILLOW

generator. The same D.C. machine can be run as a generator or motor.

Fig 15: DC Motor


To vanquish these issues you'll use a H-Bridge using transistors. Freewheeling diodes or
Clamp diodes should be used to keep up a vital separation from issues in light of back
electromotive power. on these lines it needs transistors, diodes and resistors, which can fabricate
our circuit huge and depleting to social event. To overcome this issue the L293D driver IC is
utilized
Buzzer:
A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include alarm devices,
timers and confirmation of user input such as a mouse click or keystroke. Buzzer is an integrated
structure of electronic transducers, DC power supply, widely used in computers, printers,
copiers, alarms, electronic toys, automotive electronic equipment, telephones, timers and other
electronic products for sound devices. Active buzzer 5V Rated power can be directly connected
to a continuous sound, this section dedicated sensor expansion module and the board in
combination, can complete a simple circuit design, to "plug and play.

DEPT OF ECE, SIETK Page 24


ADVANCED HEALTH SENSING SMART PILLOW

Fig16: Buzzer
Table no 3: Buzzer Pin Configuration
Pin Pin Name Description
Number
1 Positive Identified by (+) symbol or longer terminal
lead. Can be powered by 5V DC
2 Negative Identified by short terminal lead. Typically
connected to the ground of the circuit

Buzzer Features and Specifications

 Rated Voltage: 6V DC
 Operating Voltage: 4-8V DC
 Rated current: <30mA
 Sound Type: Continuous Beep
 Resonant Frequency: ~2300 Hz
 Small and neat sealed package
 Breadboard and Perf board friendly

CHAPTER 4
SOFTWARE REQUIREMENTS
Arduino IDE:

Arduino IDE where IDE stands for Integrated Development Environment – An


official software introduced by Arduino.cc, that is mainly used for writing,
compiling and uploading the code in the Arduino Device. Almost all Arduino
modules are compatible with this software that is an open source and is readily

DEPT OF ECE, SIETK Page 25


ADVANCED HEALTH SENSING SMART PILLOW

available to install and start compiling the code on the go. Introduction to

Arduino IDE:
 Arduino IDE is an open source software that is mainly used for writing and compiling the
code into the Arduino Module.

 It is an official Arduino software, making code compilation too easy that even a common
person with no prior technical knowledge can get their feet wet with the learning process.

 It is easily available for operating systems like MAC, Windows, and Linux and runs on
the Java Platform that comes with inbuilt functions and commands that play a vital role
for debugging, editing and compiling the code in the environment.

 A range of Arduino modules available including Arduino Uno, Arduino Mega, Arduino
Leonardo, Arduino Micro and many more.

 Each of them contains a microcontroller on the board that is actually programmed and
accepts the information in the form of code.

 The main code, also known as a sketch, created on the IDE platform will ultimately
generate a Hex File which is then transferred and uploaded in the controller on the board.

 The IDE environment mainly contains two basic parts: Editor and Compiler where
former is used for writing the required code and later is used for compiling and uploading
the code into the given Arduino Module.

 This environment supports both C and C++ languages.

 How to install Arduino IDE:


 You can download the Software from Arduino main website. As I said earlier, the
software is available for common operating systems like Linux, Windows, and MAX, so
make sure you.

 If you aim to download Windows app version, make sure you have
Windows 8.1 or Windows 10, as app version is not compatible with
Windows 7 or older version of this operating system.

The IDE environment is mainly distributed into three sections

 Menu Bar

DEPT OF ECE, SIETK Page 26


ADVANCED HEALTH SENSING SMART PILLOW

 Text Editor
 Output Pane
As you download and open the IDE software, it will appear like an image below.

The bar appearing on the top is called Menu Bar that comes with five different options as follow
File – You can open a new window for writing the code or open an existing onetable

DEPT OF ECE, SIETK Page 27


ADVANCED HEALTH SENSING SMART PILLOW

Fig 18: File menu in Arduino IDE

Fig 19: Preferences window in Arduino IDE

DEPT OF ECE, SIETK Page 28


ADVANCED HEALTH SENSING SMART PILLOW

As you go to the preference section and check the compilation section, the Output Pane
will show the code compilation as you click the upload button.
And at the end of compilation, it will show you the hex file it has generated for the recent
sketch that will send to the Arduino Board for the specific task you aim to achieve.
 Edit – Used for copying and pasting the code with further modification for
font
 Sketch – For compiling and programming
 Tools – Mainly used for testing projects. The Programmer
section in this panel is used for burning a bootloader to the new
microcontroller.
 Help – In case you are feeling skeptical about software, complete
help is available from getting started to troubleshooting.
as you write the following code and click the Serial Monitor, the output will show as the
image below.

Fig 20: Output window after compilation

DEPT OF ECE, SIETK Page 29


ADVANCED HEALTH SENSING SMART PILLOW

The main screen below the Menu bard is known as a simple text editor used for writing the
required code.

Fig 21: Menu bar of Arduino


The bottom of the main screen is described as an Output Pane that mainly highlights the
compilation status of the running code: the memory used by the code, and errors occurred in the
program. You need to fix those errors before you intend to upload the hex file into your Arduino
Module.More or less, Arduino C language works similar to the regular C language used for any
embedded system microcontroller, however, there are some dedicated libraries used for
callingand executing specific functions on the board.
Libraries:
Libraries are very useful for adding the extra functionality into the Arduino Module. There is a
list of libraries you can add by clicking the Sketch button in the menu bar and going to Include
Library.

DEPT OF ECE, SIETK Page 30


ADVANCED HEALTH SENSING SMART PILLOW

Fig 22: Library files

As you click the Include Library and Add the respective library it will on the top of the
sketch with a #include sign. Suppose, I Include the EEPROM library, it will appear on the text
editor as#include <EEPROM.h>.Most of the libraries are preinstalled and come with the
Arduino software. However, you can also download them from the external sources.
Making pins Input and output:
The digital Read and digitalWrite commands are used for addressing and making the
Arduino pins as an input and output respectively.
These commands are text sensitive i.e. you need to write them down the exact way they
are given like digitalWrite starting with small “d” and write with capital “W”. Writing it down
with Digitalwrite or digitalwrite won’t be calling or addressing any function.
How to select the board:
In order to upload the sketch, you need to select the relevant board you are using and the
ports for that operating system. As you click the Tools on the Menu, it will open like the figure
below.

DEPT OF ECE, SIETK Page 31


ADVANCED HEALTH SENSING SMART PILLOW

Fig 23 : Microcontroller selection

 Just go to the “Board” section and select the board you aim to work on. Similarly,
COM1, COM2, COM4, COM5, COM7 or higher are reserved for the serial and USB
board. You can look for the USB serial device in the ports section of the Windows
Device Manager.

Following figure shows the COM4 that I have used for my project, indicating the Arduino
Uno with COM4 port at the right bottom corner of the screen.

DEPT OF ECE, SIETK Page 32


ADVANCED HEALTH SENSING SMART PILLOW

Fig 24:Serial port


 After correct selection of both Board and Serial Port, click the verify and then upload
button appearing in the upper left corner of the six button section or you can go to the
Sketch section and press verify/compile and then upload.
 The sketch is written in the text editor and is then saved with the file extension .ino.It is
important to note that the recent Arduino Modules will reset automatically as you
compile and press the upload button the IDE software, however, older version may
require the physical reset on the board.Once you upload the code, TX and RX LEDs will
blink on the board, indicating the desiredprogram is running successfully.
Note: The port selection criteria mentioned above is dedicated for Windows operating
system only, you can check this Guide if you are using MAC or Linux.
 The amazing thing about this software is that no prior arrangement or bulk of mess is
required to install this software, you will be writing your first program within 2 minutes
after the installation of the IDE environment.
BootLoader:

 As you go to the Tools section, you will find a bootloader at the end. It is very helpful to
burn the code directly into the controller, setting you free from buying the external burner
to burn the required code.

DEPT OF ECE, SIETK Page 33


ADVANCED HEALTH SENSING SMART PILLOW

Fig 25: Boot loader


When you buy the new Arduino Module, the bootloader is already installed inside the
controller. However, if you intend to buy a controller and put in the Arduino module, you need
to burn the bootloader again inside the controller by going to the Tools section and selecting the
burn bootloader.

DEPT OF ECE, SIETK Page 34


ADVANCED HEALTH SENSING SMART PILLOW

Internet of Things (IOT):


Introduction:

The Internet of Things (IoT) is the network of physical objects—devices, instruments,


vehicles, buildings and other items embedded with electronics, circuits, software, sensors and
network connectivity that enable these objects to collect and exchange data. The Internet of
Things allows objects to be sensed and controlled remotely across existing network
infrastructure,creating opportunities for more direct integration of the physical world into
computer-based systems, and resulting in improved efficiency and accuracy.
ARCHITECTURE OF IOT
A critical requirement of an IoT is that the things in the network must be connected to
each other. IoT system architecture must guarantee the operations of IoT, which connects the
physical and the virtual worlds. Design of IoT architecture involves many factors such as
networking, communication, processes etc. In designing the architecture of IoT, the extensibility,
scalability, and operability among devices should be taken into consideration. Due to the fact
that things may move and need to interact with others in real-time mode, IoT architecture should
be adaptive to make devices interact with other dynamically and support communication
amongst them. In addition, IoT should possess the decentralized and heterogeneous nature.

Fig 26: Architecture layer

DEPT OF ECE, SIETK Page 35


ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER 5
RESULTS

Fig 27: Connections to the pillow


Table no 4: Results Table

S.NO NAME OF THE INPUT OUTPUT


COMPONENT

1 DS18B20 Sensor Room 34.13


temperature
2 DS18B20 Sensor Body temperature 95
3 Heartbeat sensor Heart beat 70bpm
4 LDR Sensor Light 20°c

DEPT OF ECE, SIETK Page 36


ADVANCED HEALTH SENSING SMART PILLOW

Fig 28: Output of Proposed System


The results of the smart pillow are shown in the above figures and in the table. This smart
pillow collects the data of heart beat, body temperature of the person in the night time .So that
we can analyse the patient’s condition in the night time with the help of this pillow. It also gives
a buzzer sound to wake up in the morning ,when the light intensity falls on the pillow. CPU Fan
will operate based on the room temperature.

DEPT OF ECE, SIETK Page 37


ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER -6
APPLICATIONS
 PILLOWS
 RECLINERS

ADVANTAGES

 Sleeping disorders can be reduced


 Automatic alerts will happen
 These serve to keep the upper body in alignment during sleep, relieving pressure and
counter balancing the points in the body
 The pillow heals the back pain and gives relief.

DEPT OF ECE, SIETK Page 38


ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER-7
CONCLUSION
Integrating features of all the hardware components used have been developed in it.
Presence of every module has been reasoned out and placed carefully, thus contributing to the
best working of the unit. Secondly, using highly advanced IC with help of growing technology,
the project has been successfully implemented. The “Smart Pillow” was successfully
implemented with the resources available and the extent of our knowledge and further looking to
integrate some more advanced feature.

FUTURE SCOPE

In future it is convenient to link more devices equipped with various sensors to the
system by Bluetooth Technology. This would improve the overall usability of the platform and
make it more flexible such as automatic data synchronization to supported smart watches, along
with other navel biometric monitoring techniques.

DEPT OF ECE, SIETK Page 39


ADVANCED HEALTH SENSING SMART PILLOW

CHAPTER-8
BIBLIOGRAPHY
[1] Harada, Tatsuya & Sakata, Akiko & Mori, Taketoshi & Sato, Tomomasa. (2000). Sensor
pillow system: Monitoring respiration and body movement in sleep. IEEE International
Conference on Intelligent Robots and Systems. 1. 351 - 356 vol.1.
10.1109/IROS.2000.894630.

[2] Jin Zhang, Qian Zhang, Yuanpeng Wang, and Chen Qiu. 2013. A real-time auto-
adjustable smart pillow system for sleep apnea detection and treatment. In Proceedings of
the 12th international conference on Information processing in sensor networks (IPSN
’13). Association for Computing Machinery, New York, NY, USA, 179–190

[3] Devi.S.M., Archana & sekar.G, Chandra & M, Janarthanan. (2016). Smart Pillow—
Intelligent system to comfort newborn infants using vibration and monitoring movement
of the infants via wireless sensor system. International Journal of Advanced Research
Trends in Engineering and Technology (IJARTET). 3. 323-329.

[4] Lokavee, Shongpun & Puntheeranurak, Theeraporn & Kerdcharoen, Teerakiat &
Watthanwisuth, Natthapol & Tuantranont, Adisorn. (2012). Sensor pillow and bed sheet
system: Unconstrained monitoring of respiration rate and posture movements during
sleep. Conference Proceedings - IEEE International Conference on Systems, Man and
Cybernetics. 1564-1568. 10.1109/ICSMC.2012.6377959.

[5] Li, Songsheng; Chiu, Christopher. 2018. "A Smart Pillow for Health Sensing System
Based on Temperature and Humidity Sensors." Sensors 18, no. 11: 3664.

[6] Yang, Seung & Park, Sangwoo & Yang, Taemyung & Jin, Ilhyung & Kim, Wooil & Liu,
Chingwei & Kim, Seong-Woo & Eune, Juhyun. (2018). Introducing Smart Pillow Using
Actuator Mechanism, Pressure Sensors, and Deep Learning-Based ASR. AH '18:
Proceedings of the 9th Augmented Human International Conference. 1-2.
10.1145/3174910.3174954.

DEPT OF ECE, SIETK Page 40


ADVANCED HEALTH SENSING SMART PILLOW

APPENDIX-A
PROJECT CODE
#include <LiquidCrystal.h> #include <DHT.h> #include <SPI.h> #include<OneWire.h>
#include<DallasTemperature.h>
#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for
most accurate BPM math.
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlaygr
#include<stdio.h>
// Data wire is plugged into digital pin 2 on the Arduino #define ONE_WIRE_BUS 9
LiquidCrystal lcd(7,6,5,4,3,2); //RS, EN, D4 TO D7
const int PulseWire = 0; // PulseSensor PURPLE WIRE connected to
ANALOG PIN 0
//int data=A0;
int Threshold = 550; // Determine which Signal to "count as a beat" and
which to ignore.

default setting.

//void sendsms();
// Use the "Gettting Started Project" to fine-tune Threshold Value beyond

// Otherwise leave the default "550" value.


PulseSensorPlayground pulseSensor; // Creates an instance of the
PulseSensorPlayground object called "pulseSensor"
#define DHTTYPE DHT11 int DHTPIN=A1;
DHT dht(DHTPIN,DHTTYPE);
int motorPin1 = 10; int motorPin2 = 11;
//SoftwareSerial mySerial(50, 51); // RX, TX

int ldr_pin=A2; int ldr_adc;


int intensity;
//int start=8; int count=0; int buzzer=8; float t,f;
unsigned long temp=0; int val;
int c=2;
int myBPM; void gprs();
// Setup a oneWire instance to communicate with any
OneWire device OneWire oneWire(ONE_WIRE_BUS);
// Pass oneWire reference to DallasTemperature library DallasTemperature sensors(&oneWire);
void setup( )

DEPT OF ECE, SIETK Page 41


ADVANCED HEALTH SENSING SMART PILLOW

Serial.begin(9600); lcd.begin(16, 2);


dht.begin();
pinMode(motorPin1,
OUTPUT);
pinMode(motorPin2,
OUTPUT);
pinMode(buzzer,OUTP
UT);
digitalWrite(buzzer,LO
W);
//pinMode(gas,IN
PUT);
pinMode(ldr_pin,I
NPUT);
//pulseSensor.blinkOnPulse(LED13);//auto-magically blink Arduino's LED with heartbeat.
pulseSensor.setThreshold(Threshold);
// Double-check the "pulseSensor" object was created and "began" seeing a
signal. if (pulseSensor.begin())
{
Serial.println("We created a pulseSensor Object !"); //This prints one time at
Arduino power-up, or on Arduino reset.
}
}
void loop()
{

// Send the command to get


temperatures
sensors.requestTemperatures();
//print the temperature in Celsius
Serial.print("Temperature: ");
Serial.print(sensors.getTempCByIndex(0));
Serial.print((char)176);//shows degrees character
Serial.print("C | ");
//print the temperature in Fahrenheit
Serial.print((sensors.getTempCByIndex(0) * 9.0) / 5.0 + 32.0);
// lcd.setCursor(0,0);
Serial.print((char)176);//shows degrees
character Serial.println("F");
delay(500);
lcd.setCursor(0,0); lcd.print("Temp:"); lcd.setCursor(6,0);
lcd.print(sensors.getTempCByIndex(0));

DEPT OF ECE, SIETK Page 42


ADVANCED HEALTH SENSING SMART PILLOW

myBPM = pulseSensor.getBeatsPerMinute(); // Calls function


on our pulseSensor object that returns BPM as an "int".
// "myBPM"
hold this BPM value now. if
(pulseSensor.sawStartOfBeat())
{ // Constantly test to see if "a beat happened".
Serial.println("♥ A HeartBeat Happened ! "); // If test is "true",
print a message "a heartbeat happened".
lcd.clear(); lcd.setCursor(0,0) lcd.print("BPM:);delay(1000); lcd.setCursor(6,0);
lcd.print(myBPM)
;delay(2000);
lcd.clear();
Serial.print("BPM: "); // Print phrase "BPM: "
Serial.println(myBPM); // Print the value inside of myBPM. delay(1000);
}
lcd.clear(); lcd.setCursor(0,0); lcd.print("emp:"); lcd.setCursor(6,0);
lcd.print(sensor
s.getTempCBy
Index(0));
lcd.setCursor(
0,1);
lcd.print("BPM:"); lcd.setCursor(5,1); lcd.print(myBPM);
//lcd.setCursor(0,1);

// lcd.print("TEMP&HB NORMAL:");
/*Temperature Read*/
t = dht.readTemperature(); Serial.print("TEMP: "); Serial.println(t);
int PwmValue=map(t,31,40,100,255); if(t>=35)
{
lcd.clear();
lcd.setCursor(0,0); lcd.print("Over Temp fan ON:");
/fan should be ON delay(100);
//digitalWrite(motorPin1,LOW); digitalWrite(motorPin2,HIGH);
analogWrite(motorPin2,PwmValue);
}
else
{
delay(10); digitalWrite(motorPin1,LOW);
//digitalWrite(motorPin2,LOW); analogWrite(motorPin2,0);
}
/*LDR_Sensor*/
ldr_adc=analogRead(ldr_pin);
intensity=map(ldr_adc,1023,

DEPT OF ECE, SIETK Page 43


ADVANCED HEALTH SENSING SMART PILLOW

0,0,100);
Serial.println(intensity);
delay(500);
if(intensity<50) //Normal ldr Value AROUND 800, but when light detects it is
around 500 (in percentage is light detects it is aronud 85% otherwise normally
around 32% or 25)
{
}
else
{
delay(100); digitalWrite(buzzer,LOW);
//delay(100); digitalWrite(buzzer,HIGH); delay(100);
lcd.clear(); lcd.setCursor(0,0);
lcd.print("Inten:"); lcd.setCursor(7,0);
lcd.print(intensity);
//lcd.print("LDR... DETECTS");

// digitalWrite(buzzer,HIGH);
//delay(2000);
//digitalWrite(buzzer,LOW);
}

DEPT OF ECE, SIETK Page 44


ADVANCED HEALTH SENSING SMART PILLOW

APPENDIX-B

DEPT OF ECE, SIETK Page 45


ADVANCED HEALTH SENSING SMART PILLOW

DEPT OF ECE, SIETK Page 46

You might also like