Professional Documents
Culture Documents
1.1embedded System Implementation: Advanced Health Sensing Smart Pillow
1.1embedded System Implementation: 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.
User interface
Embedded system
Software Hardware
Inputs
Output
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
Embedded systems use different processors for its desired operation. Some of the processors
used are
1. Microprocessor
2. Microcontroller
3. Digital signal processor
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
1. Microcontroller
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.
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.
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.
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.
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.
Atmega328p features:
Peripheral Features
Operating Voltage:
Temperature Range:
– -40°C to 85°C
Speed Grade:
BLOCK DIAGRAM
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).
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
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
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.
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.
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.
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.
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.
shown in the figure below. The arrow indicates light falling on it.
Fig 12: LDR Sensor
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
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.
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
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
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:
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.
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.
Menu Bar
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
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.
The main screen below the Menu bard is known as a simple text editor used for writing the
required code.
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.
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.
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.
CHAPTER 5
RESULTS
CHAPTER -6
APPLICATIONS
PILLOWS
RECLINERS
ADVANTAGES
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.
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.
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
// 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,
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);
}
APPENDIX-B