Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CHAPTER 1
INTRODUCTION
The conventional manner of introducing drug to patient is in efficient and often lead to toxic
side effect.The dramatic advance in controlled and targeted drug delivery system over past few
decays have lead to enormous expectation for treatment.one class of such system is intelligent
medicine delivery system.Intelligent medical system are capable ofremainding patient to take
correct medicines at correct time in responds to physiological need.
The aim of this project is to remaind people who forget to take medicine on time. The
proposed system is best suited for elderly people and people who are very busy,as this device
will not only remaind them of their medicine with a buzzer sound but also deliver the proper
medicine.
1.1 OBJECTIVES
Remainding patients to have medicine at correct time.
Doctor can evaluate the patient had medicine or not.
This system could effectively resolve the problem of negligence and mis operation when
medicine distribution, and as well avoid the accidental medicine taking for patient.
CHAPTER 2
LITERATURE SURVEY
In paper [1] It has been reported that wrong medicine box has been delivered to patient
accidentally at hospital's Inpatient Department, so the patient may take the wrong medicine
and the medical incident occurs consequently. In order to resolving this problem, it is
necessary to design intelligent medicine box monitoring and management system. This system
integrates technologies involving network, RFID, and touch screen. At the network, the
system monitors and controls the releasing process of medicine box through RFID label ring;
and displays the medicine's name, dosing time, notes and other relevant information for
patients on the touch screen. Therefore the patient would be reminded to take the medicine
clearly and regularly. The system could effectively resolve the problem of negligence and miss
operation when medicine distribution, and as well avoid the accidental medicine taking for
patient.
In paper [2]Nowadays usually the drug delivery during the surgeries is done manually by
giving injection to the patient. During this drug delivery process some can commit minute
mistakes in the quantity of drug release which leads to critical condition and can influence the
health of the patient, so to decide and deliver the quantity of drug, it requires significant effort
from the clinical standpoint not guaranteeing an optimal performance. The proposed system
involves automated drug delivery to the patient based on some health parameters, such as
fever, sugar, etc. This system involves a linear actuation mechanism to deliver exact amount
of drug delivery based on the sensor data. Delivering adequate drug requires precise
automation in drug delivery system which will improve the patient safety, reduce the cost due
to minimal consumption of drug and will help in early post-operative recover.
CHAPTER 3
PROPOSED WORK
The aim of this project is to remaind people who forget to take medicine on time.
Elderly people because of their age usually forget to take their medicine. This project will help
to remaind the patient to take medicine at prescribed time. The proposed system is best suited
for elderly people and people who are very busy, as this device will not only remained them of
their medicine with a buzzer sound but also deliver the proper medicine.
3.11.Power supply
230v
12V Bridge Filter Voltage
Adapter Rectifier Capacitor Regulator
Fig:3.1.powersupply
A power supply is a device that supplies electric powerto anelectricalload. The term is most
commonly applied toelectric power convertersthat convert one form of electrical energy to
another, though it may also refer to devices that convert another form of energy (mechanical,
chemical, solar) to electrical energy.
Aregulated power supplyis one that controls the output voltage or current to a specific value;
the controlled value is held nearly constant despite variations in either load current or the
voltage supplied by the power supply's energy source. The system requires a regulated +5v
supply for the Integrated circuits. These can be delivered from the 230V domestic supply.
Before applying this to the system we must step down this high voltage to an appropriate
value. After that it should be rectified. To achieve +5 V DC we should regulate this.All this
are run in the power supply circuitry.
Power supply is used to give sufficient power to the microcontroller. A step down
transformer and a bridge rectifier is used here to convert AC to DC. A regulator IC is also
used here to give constant supply.7805 IC is used for power supply and it is connected to the
bridge rectifier.
A 12-0-12V step down transformer is connected to provide the necessary low voltage. The
transformer also works as an Isolator between the hot and cold end. The hot end refers to the
230v supply, which is hazardous one, and the cold one refers to the low ,safe voltage .Now
the hot portion appears only at the primary of the transformer. The secondary of the
transformer deliver 12v ac pulses along with a ground.
This ac supply goes to a center tap rectifier, which converts the ac into a unidirectional
voltage. The ripples in the resulting supply is filtered and smoothed by a 2200micro FD/25V
capacitor. The 0.1 microfarad capacitor bypasses any high frequency noises. The resulting
supply has magnitude above 17V.This voltage is given to the regulated IC 7805.This IC
provides a regulated 5V positive supply at its 3rd pin. This required input for this is more
than 7.5V.
The capacitors must have enough high voltage rating to safely handle the input voltage feed
to circuit. The circuit is very easy to build for example into a piece of Vero board.
Rectifiers
Filters
Regulators
Pins are,
1. Unregulated voltage in
2. Regulated voltage out
3. Ground
If we need other voltages than +5V, we can modify the circuit by replacing the 7805 chips
with another regulator with different output voltage from regulator 78xx chip family. The last
numbers in the the chip code tells the output voltage. Remember that the input voltage must
be at least 3V greater than regulator output voltage, otherwise the regulator does not work
well.
Mobile with
CLOUD
SERVER Android
App
RS232
Interface
IR SENSOR
3.13.Microcontroller
PIC micro controllers are low-cost computers-in-a-chip; they allow electronics designers and
hobbyists add intelligence and functions that mimic big computers for almost any electronic
product or project. The programming of the system is done using a PIC micro controller
16F877. This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35
single word instructions) CMOS FLASH-based 8-bit micro controller packs Microchip's
powerful PIC architecture into a 40-pin package and is upwards compatible with the
PIC16C5X, PIC12CXXX and PIC16C7X devices. It is has five ports. I.e. port A, port B, port
C, port D, port E. The PIC 16F877 has flash memory of 8K and Data memory of 368 bytes
Data EEPROM of 256 bytes.
Speed
High Performance RISC CPU
Instruction Set Simplicity
Integration Of Operation Features
Programmable Timer Options
Interrupt Control
Inbuilt Modules
EPROM/OTP/ROM Options
Low Power Consumption
Wide Operation Voltage Range :2.5to 6.0 Volt
Programmable Code Protection Mode
Power Saving Sleep Mode
Interrupt compatibility
Power on reset
Watch dog timer with its own chip RC oscillator for reliable operation
program memory
The pic 16f87x devices have a 13-bit program counter, capable of addressing an 8k x
14 program memory space. the pic 16f877 has 8kx 14 words of flash program memory. the
reset vector is at 0000h and the interrupt vector is at 0004h
data memory
Data memory is partition in to multiple banks which contain the general purpose
registers and special function registers. Bits RP1(status <6>) and RP0(status<5>) are the banks
bits.Each bank extends up to 7Fh (128bits). The lower location of each banks are
0 0 0
0 1 1
1 0 2
1 1 3
Reserved for the special function registers. About the special function registers are general
purpose registers, implemented as the static RAM. All implemented banks contain special
function registers .Some frequently used special function register from 1 bank may be
mirrored in another bank for code reduction and quicker access.
General Purpose Register
The register file can be accessed either directly, or indirectly through the file select register
(FSR
Special purpose register
The Special purpose registers are registers used by the CPU and peripheral modules for
controlling the desired operation of the devices. These devices are implemented as static
RAM. Some examples of the SFRs are INDF, OPTION_REG, FSR, PCLATHe.t.c
Status register
The Status register contains the arithmetic status of the ALU, the RESET status and the bank
select bits for data memory. The STATUS register can be the destination for any instruction,
as with any other register.
________ ________
IRP RP1 RP0 TO PD Z DC C
BIT 7 BIT 0
TRISA register controls the direction of the RA pins, even when they are used as analog
inputs. The user must ensure the bits in the TRISA register are maintained set when using
them as analog inputs.
PORT B AND THE TRISB Register
PORTB is an 8-bit wide, bi-directional port. The corresponding data direction register is
TRISB. Setting a TRISB bit will make the corresponding PORTB pin an input. Clearing a
TRISB bit make the corresponding PORTB pin an output.
Three pins of PORTB are multiplexed with the Low Voltage Programming function:
RB3/PGN, RB6/PGC and RB7/PGD. The alternate functions of these pins are described in the
Special Features Section.
Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the
pull-ups. This is performed by cleaning bit RBPU (OPTION_REG<7>). The weak pull-up is
automatically turned off when the port pin is configured as an output. The pulls are disabled
on a Power-on Reset
Four of the PORTB pins, RB7:RB4 have interrupt on change feature. Only pins configured as
inputs can cause this interrupt to occur. The input pin (RB7:RB4) are compared with the old
value latched on the last read of PORTB. The Mismatch output of RB7:RB4 are ORed
together to generate the RBPORT change interrupt with flag bit RBIF (INTCON<0>).
This interrupt can wake the device from SLEEP. A mismatch condition will continue to set
flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be
cleared
PORTC AND THE TRISTC Register
PORTC is an 8 bit wide, bi-directional port. The corresponding data direction register is
TRISC. Setting TRISC bit (=1) will make the corresponding PORTC pin an input. Clearing
TRISC bit (=0) will make the corresponding PORTC pin an output. PORTC is multiplexed
with several peripheral functions. PORTC pin have SCHMITT Trigger input buffers. When
the I2C module is enabled the PORTC<4:3> pin can be configure with normal I2C levels.
PORT D AND THE TRIS D Register
PORT D is an 8-bit port with Schmitt trigger input buffers. Each pin is individually
configurable as an input or output.
PORT E AND THE TRIS E REGISTER
PORT E has three pins which are individually configurable as input or output .The PORT E
pins becomes I/O control inputs for the microprocessor port when bit PSPMODE(TRIS<4>) is
set .PORT E pins are multiplexed with analog input . TRISE controls the direction of the RE
pins.
3.14.LCD module
The LCD module, made by Crystallonics, is 16x2 line interactive displays. It needs a power
supply of +5v. The module has inbuilt controller chip, such as an HD44780, which acts as an
interface between CPU and the row and column drivers. The controller takes care of
generating characters, refreshing the display, and so on. The module has a back light driven by
a pair of pads separate from the interface pads .The LCD module works in two modes for
communicating with the micro controller - 8 bit (byte) mode & 4 bit (nibble) mode. In the
later case only the higher nibble i.e. pins DB4-DB7 is used for communication. For controlling
the LCD module we have used only the port D
Fig:3.6.LCD module
A variable voltage applied to this pin controls the contrast. Use a potentiometer and adjust
until you see the background.
Register Select:
This pin selects whether you are sending the module a command or data.
Read/Write:
This pin allows for bi-directional communications. For the discussions here, uni-directional
communications will be used. Ground this pin.
Enable:
This is the latch pin. A high-to-low transition causes the value on the data lines to be latched
by the module.
DB0-DB7:
Apply the data or commands to these pins.The SPI module and a 74595 can be used to make a
serial interface. The same latch pin can be used for both because the '595 latches on LH while
the LCD latches on HL. Transmit the value via SPI the set the latch then clear it.
Fig:3.8.WIFI module
This is ultra low cost module that is easy to use and reliable based on ESP8266 chipset to be
used along with a microcontroller that configures and communicates through AT
commands.Till now embedded WiFi solutions was a bit pricey to implement for hobbyist.
This module is changing the trend rapidly. It gives excellent working range and opening wide
array of applications.
Applications
The hardware connections required to connect to the ESP8266 module are fairly straight-
forward but there are a couple of important items to note related to power: The ESP8266
requires 3.3V powerdo not power it with 5 volts! The ESP8266 needs to communicate via
serial at 3.3V and does not have 5V tolerant inputs, so you need level conversion to
communicate with a 5V microcontroller.
Fig:3.9.WIFI pinout
Fig:3.11.PIR sensor
All objects emit what is known as black body radiation. It is usually infrared radiation that is
invisible to the human eye but can be detected by electronic devices designed for such a
purpose. The term passive in this instance means that the PIR device does not emit an infrared
beam but merely passively accepts incoming infrared radiation.
In a PIR-based motion detector (usually called a PID, for Passive Infrared Detector), the PIR
sensor is typically mounted on a printed circuit board containing the necessary electronics
required to interpret the signals from the pyroelectric sensor chip. The complete assembly is
contained within a housing mounted in a location where the sensor can view thearea to be
monitored. Infrared energy is able to reach the pyroelectric sensor through the window
because the plastic used is transparent to infrared radiation (but only translucent to visible
light). This plastic sheet also prevents the intrusion of dust and/or insects from obscuring the
sensor's field of view, and in the case of insects, from generating false alarms.
A few mechanisms have been used to focus the distant infrared energy onto the sensor surface.
The window may have multiple Fresnel lensesmolded into it.The PIR Sensor is a pyroelectric
device that detects motion by measuring changes in the infrared levels emitted by surrounding
objects. This motion can be detected by checking for a high signal on a single I/O pin.
The IR led keeps transmitting IR infrared rays up to some range (there is a potentiometer also
in the design with the help of which you can alter the range). When some object comes in the
(IR) infrared range, the IR waves hits the object and comes back at some angle, The Photo
diode next to IR led detects that IR infrared rays which got reflected from the object and hence
works as a proximity sensor.
Based on a simple basic Idea, this IR obstacle sensor, is easy to build, easy to calibrate and
still, it provides a detection range of 10- 30 cm. This sensor can be used for most indoor
applications where no important ambient light is present. It is the same principle in ALL Infra-
Red proximity sensors. The basic idea is to send infra red light through IR-LEDs, which is
then reflected by any object in front of the sensor.
Features
Applications
Working
It is the same principle in ALL Infra-Red proximity sensors. The basic idea is to send infra red
light through IR-LEDs, which is then reflected by any object in front of the sensor.Then all
you have to do is to pick-up the reflected IR light. For detecting the reflected IR light, we are
going to use a very original technique: we are going to use another IR-LED, to detect the IR
light that was emitted from another led of the exact same type! This is an electrical property of
Light Emitting Diodes (LEDs) which is the fact that a led Produce a voltage difference across
its leads when it is subjected to light. As if it was a photo-cell, but with much lower output
current. In other words, the voltage generated by the leds can't be - in any way - used to
generate electrical power from light, It can barely be detected. that's why as you will notice in
stheschematic, we are going to use a Op-Amp (operational Amplifier) to accurately detect
very small voltage changes.
Sample Application:
Features
A output current per channel.
Enable facility.
Department of ECE Page 19 MEA Engineering College
ProjectReport2016-17 Intelligent patient care system
Fig:3.13.pinout of L293D
3.19.GPRS modem
A GPRS modem is a specialized type of modem which accepts a simcard, and operats over
subscription to a mobile operator, just like a mobile phone. When a GSM modem is connected
to a computer, this allows the computer to use GSM modem to communicate over the mobile
network. While this GPRS modem are most frequently used to provide mobile internet
connectivity, many of them can also be used for sending and receiving SMS and MMS
messages.
3.20.GSM (Global System for Mobile communications) modem
Here a GSM mobile hand set is used. GSM networks are originally from the most popular
standard for mobile phones in the world.GSM differs from its predecessors in that both
signaling and speech channels are digital, and thus is considered a second generation (2G)
mobile phone system. This has also meant that data communication was easy to build into the
system. GSM is a cellular network, which means that mobile phones connect to it by searching
for cells in the immediate vicinity
Fig:3.13.GSM module
GSM networks operate in a number of different frequency ranges .Most 2G GSM networks
operate in the 900 MHz or 1800 MHz bands. The controller communicates with the mobile
phone by AT comments. The Main AT commands to communicate via a serial interface with
the GSM subsystem of the phone. The comments that used in the controller is sent and
received by SMS (short message system).
Details of AT comments used
AT+CMGD (Delete message)
Description: Deletes message from preferred message <mem1> storage
Location<index>.
3.21.Buzzer
A buzzer or beeper is signaling device, usually electronic, typically used in automobiles house
hold appliance. Initially the device was based on an elecro mechanical system which was
identical to electric bell without the metal gong(which make the ringing noise).
Fig:3.15.Buzzer
Department of ECE Page 22 MEA Engineering College
ProjectReport2016-17 Intelligent patient care system
3.21.RS232 interface
All IBM PC and compatible computers are typically equipped with two serial ports and one
parallel port. Although these two types of ports are used for communicating with external
devices, they work in different ways.A parallel port sends and receives data eight bits at a time
over 8 separate wires. This allows data to be transferred very quickly; however, the cable
required is more bulky because of the number of individual wires it must contain. Parallel
ports are typically used to connect a PC to a printer and are rarely used for much else. A serial
port sends and receives data one bit at a time over one wire. While it takes eight times as long
to transfer each byte of data this way, only a few wires are required. In fact, two-way (full
duplex) communications is possible with only three separate wires - one to send, one to
receive, and a common signal ground wire.
Bi-Directional Communications
The serial port on your PC is a full-duplex device meaning that it can send and receive data at
the same time. In order to be able to do this, it uses separate lines for transmitting and
receiving data. Some types of serial devices support only one-way communications and
therefore use only two wires in the cable - the transmit line and the signal ground.
Communicating by Bits
Once the start bit has been sent, the transmitter sends the actual data bits. There may either be
5, 6, 7, or 8 data bits, depending on the number you have selected. Both receiver and the
transmitter must agree on the number of data bits, as well as the baud rate. Almost all devices
transmit data using either 7 or 8 databits.Notice that when only 7 data bits are employed, we
cannot send ASCII values greater than 127. Likewise, using 5 bits limits the highest possible
value to 31. After the data has been transmitted, a stop bit is sent. A stop bit has a value of 1 -
or a mark state - and it can be detected correctly even if the previous data bit also had a value
of 1. This is accomplished by the stop bit's duration. Stop bits can be 1, 1.5, or 2 bit periods in
length.
RS-232C
RS-232 stands for Recommend Standard number 232 and C is the latest revision of the
standard. The serial ports on most computers use a subset of the RS-232C standard. The full
RS-232C standard specifies a 25-pin "D" connector of which 22 pins are used. Most of these
pins are not needed for normal PC communications, and indeed, most new PCs are equipped
with male D type connectors having only 9 pins.
Two terms you should be familiar with are DTE and DCE. DTE stands for Data Terminal
Equipment, and DCE stands for Data Communications Equipment. These terms are used to
indicate the pin-out for the connectors on a device and the direction of the signals on the pins.
Your computer is a DTE device, while most other devices are usually DCE devices.
RTS stands for Request To Send. This line and the CTS line are used when "hardware flow
control" is enabled in both the DTE and DCE devices. The DTE device puts this line in a mark
condition to tell the remote device that it is ready and able to receive data. If the DTE device is
not able to receive data (typically because its receive buffer is almost full), it will put this line
in the space condition as a signal to the DCE to stop sending data. When the DTE device is
ready to receive more data (i.e. after data has been removed from its receive buffer), it will
place this line back in the mark condition. The complement of the RTS wire is CTS, which
stands for Clear To Send. The DCE device puts this line in a mark condition to tell the DTE
device that it is ready to receive the data. Likewise, if the DCE device is unable to receive
data, it will place this line in the space condition. Together, these two lines make up what is
called RTS/CTS or "hardware" flow control. The Software Wedge supports this type of flow
control, as well as Xon/XOff or "software" flow control. Software flow control uses special
control characters transmitted from one device to another to tell the other device to stop or
start sending data. With software flow control the RTS and CTS lines are not used.
DTR standsfor Data Terminal Ready. Its intended function is very similar to the RTS line.
DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. Some
serial devices use DTR and DSR as signals to simply confirm that a device is connected and is
turned on. The Software Wedge sets DTR to the mark state when the serial port is opened and
leaves it in that state until the port is closed. The DTR and DSR lines were originally designed
to provide an alternate method of hardware handshaking. It would be pointless to use both
RTS/CTS and DTR/DSR for flow control signals at the same time. Because of this, DTR and
DSR are rarely used for flow control.
If we connect two DTE devices (or two DCE devices) using a straight RS232 cable, then the
transmit line on each device will be connected to the transmit line on the other device and the
receive lines will likewise be connected to each other. A Null Modem cable or Null Modem
adapter simply crosses the receive and transmit lines so that transmit on one end is connected
to receive on the other end and vice versa. In addition to transmit and receive, DTR & DSR, as
well as RTS & CTS are also crossed in a Null Modem connection.
There are two basic types of serial communications, synchronous and asynchronous. With
synchronous communications, the two devices initially synchronize themselves to each other,
and then continually send characters to stay in sync. Even when data is not really being sent, a
constant flow of bits allows each device to know where the other is at any given time. That is,
each character that is sent is either actual data or an idle character. Synchronous
communications allows faster data transfer rates than asynchronous methods, because
additional bits to mark the beginning and end of each data byte are not required. The serial
ports on IBM-style PCs are asynchronous devices and therefore only support asynchronous
serial communications.
Asynchronous means "no synchronization", and thus does not require sending and receiving
idle characters. However, the beginning and end of each byte of data must be identified by
start and stop bits. The start bit indicates when the data byte is about to begin and the stop bit
signals when it ends. The requirement to send these additional two bits causes asynchronous
communication to be slightly slower than synchronous however it has the advantage that the
processor does not have to deal with the additional idle characters.
An asynchronous line that is idle is identified with a value of 1 (also called a mark state). By
using this value to indicate that no data is currently being sent, the devices are able to
distinguish between an idle state and a disconnected line. When a character is about to be
transmitted, a start bit is sent. A start bit has a value of 0 (also called a space state). Thus,
when the line switches from a value of 1 to a value of 0, the receiver is alerted that a data
character is about to be sent.
Battery Operated DC Motors
segments (called bars), usually made of copper, which represent the termination of individual
coils of wire distributed around the armature. The second half of the mechanical switch is
completed by the brushes. These brushes typically remain stationary with the motor's housing
but ride (or brush) on the rotating commutator. As electrical energy is passed through the
brushes and consequently through the armature a torsional force is generated as a reaction
between the motor's field and the armature causing the motor's armature to turn. As the
armature turns, the brushes switch to adjacent bars on the commutator. This switching action
transfers the electrical energy to an adjacent winding on the armature which in turn
perpetuates the torsional motion of the armature.
Permanent magnet (PM) motors are probably the most commonly used DC motors, but there
are also some other type of DC motors (types which use coils to make the permanent magnetic
field also) .DC motors operate from a direct current power source. Movement of the magnetic
field is achieved by switching current between coils within the motor. This action is called
"commutation". Very many DC motors (brush-type) have built-in commutation, meaning that
as the motor rotates, mechanical brushes automatically commutate coils on the rotor. You can
use dc-brush motors in a variety of applications.
A simple, permanent-magnet dc motor is an essential element in a variety of products, such as
toys, servo mechanisms, valve actuators, robots, and automotive electronics. There are several
typical advantages of a PM motor.When compared to AC or wound field DC motors,PM
motors are usually physically smaller in overall size and lighter for a given power rating.
Furthermore, since the motor's field, created by the permanent magnet, is constant, the
relationship between torque and speed is very linear. A PM motor can provide relatively high
torque at low speeds and PM field provides some inherent self-braking when power to the
motor is shutoff. There are several disadvantages through, those being mostly being high
current during a stall condition and during instantaneous reversal. Those can damage some
motors or be problematic to control circuitry. Furthermore, some magnet materials can be
damaged when subjected to excessive heat and some loose field strength if the motor is
disassembled.
High-volume everyday items, such as hand drills and kitchen appliances, use a dc servomotor
known as a universal motor. Those universal motors are series-wound DC motors, where the
stationary and rotating coils are wires in series. Those motors can work well on both AC and
DC power. One of the drawbacks/precautions about series-wound DC motors is that if they are
unloaded, the only thing limiting their speed is the windage and friction losses. Some can
literally tear themselves apart if run unloaded.
A brushless motor operates much in the same way as a traditional brush motor. However, as
the name implies there are no brushes (and no commutator). The mechanical switching
function, implemented by the brush and commutator combination in a brush-type motor, is
replaced by electronic switching in a brushless motor. In a typical brushless motor the
electromagnetic field, created by permanent magnets, is the rotating member of the motor and
is called a rotor. The rotating magnetic field is generated with a number of electromagnets
commutatated with electronics switches (typically transistors or FETs) in a right order at right
speed. In a brushless motor, the trick becomes to know when to switch the electrical energy in
the windings to perpetuate the rotating motion.This is typically accomplished in a brushless-
type motor by some feedback means designed to provide an indication of the position of the
magnet poles on the rotor relative to the windings. A hall effect device (HED) is a commonly
used means for providing this positional feedback. In some applications brushless motors are
commutated without sensors or with the use of an encoder for positional feedback.A brushless
motor is often used when high reliability, long life and high speeds are required. The bearings
in a brushless motor usually become the only parts to wear out.
In applications where high speeds are required (usually above 30,000 RPM) a brushless motor
is considered a better choice (because as motor speed increases so does the wear of the
brushes on traditional motors). A brushless motor's commutation control can easily be
separated and integrated into other required electronics, thereby improving the effective
power-to-weight and/or power-to-volume ratio. A brushless motor package (motor and
commutation controller) will usually cost more than a brush-type, yet the cost can often be
made up in other advantages. For example, in applications where sophisticated control of the
motor's operation is required. Brushless motors are seen nowadays in very many computer
application, they for example rotate normal PC fans, hard disks and disk drives. Sometimes
the rotation direction needs to be changed. In normal permanent magnet motors, this rotation
is changed by changing the polarity of operating power (for example by switching from
negative power supply to positive or by inter-changing the power terminals going to power
supply). This direction changing is typically implemented using relay or a circuit called an H
bridge. There are some typical characteristics on "brush-type" DC motors.
When a DC motor is straight to a battery (with no controller), it draws a large surge current
when connected up. The surge is caused because the motor, when it is turning, acts as a
Department of ECE Page 28 MEA Engineering College
ProjectReport2016-17 Intelligent patient care system
generator. The generated voltage is directly proportional to the speed of the motor. The current
through the motor is controlled by the difference between the battery voltage and the motor's
generated voltage (otherwise called back EMF). When the motor is first connected up to the
battery (with no motor speed controller) there is no back EMF. So the current is controlled
only by the battery voltage, motor resistance (and inductance) and the battery leads. Without
any back emf the motor, before it starts to turn, therefore draws the large surge current. When
a motor speed controller is used, it varies the voltage fed to the motor. Initially, at zero speed,
the controller will feed no voltage to the motor, so no current flows. As the motor speed
controller's output voltage increases, the motor will start to turn. At first the voltage fed to the
motor is small, so the current is also small, and as the motor speed controller's voltage rises, so
too does the motor's back EMF. The result is that the initial current surge is removed,
acceleration is smooth and fully under control. Motor speed control of DC motor is nothing
new. A simplest method to control the rotation speed of a DC motor is to control it's driving
voltage. The higher the voltage is, the higher speed the motor tries to reach.
In many applications a simple voltage regulation would cause lots of power loss on control
circuit, so a pulse width modulation method (PWM)is used in many DC motor controlling
applications. In the basic Pulse Width Modulation (PWM) method, the operating power to the
motors is turned on and off to modulate the current to the motor. The ratio of "on" time to
"off" time is what determines the speed of the motor. When doing PWM controlling, keep in
mind that a motor is a low pass device. The reason is that a motor is mainly a large inductor. It
is not capable of passing high frequency energy, and hence will not perform well using high
frequencies. Reasonably low frequencies are required, and then PWM techniques will work.
Lower frequencies are generally better than higher frequencies, but PWM stops being
effective at too low a frequency. The idea that a lower frequency PWM works better simply
reflects that the "on" cycle needs to be pretty wide before the motor will draw any current
(because of motor inductance). A higher PWM frequency will work fine if you hang a large
capacitor across the motor or short the motor out on the "off" cycle (e.g. power/brake pwm)
The reason for this is that short pulses will not allow much current to flow before being cut
off. Then the current that did flow is dissipated as an inductive kick - probably as heat through
the fly-back diodes. The capacitor integrates the pulse and provides a longer, but lower,
current flow through the motor after the driver is cut off. There is not inductive kick either,
since the current flow isn't being cut off. Knowing the low pass roll-off frequency of the motor
helps to determine an optimum frequency for operating PWM. Try testing your motor with a
square duty cycle using a variable frequency, and then observe the drop in torque as the
frequency is increased. This technique can help determine the roll off point as far as power
efficiency is concerned.Besides "brush-type"DC motors, there is another DC motor
type:brushless DC motor. Brushless DC motors rely on the external power drive to perform
the commutation of stationary copper winding on the stator.
This changing stator field makes the permanent magner rotor to rotate.A brushless permanent
magnet motor is the highest performing motor in terms of torque / vs. weight or efficiency.
Brushless motors are usually the most expensive type of motor. Electronically commutated,
brush-less DC motor systems are widely used as drives for blowers and fans used in
electronics, telecommunications and industrial equipment applications.There is wide variety of
different brush-less motors for various applications. Some are designed to to rotate at constant
speed (those used in disk drives) and the speed of some can be controlled by varying the
voltage applied to them (usually the motors used in fans).
Some brushless DC motors have a built-in tachometer which gives out pulses as the motor
rotates (this applies to both disk drive motors and some computer fans). In general, users
select brush-type DC motors when low system cost is a priority, and brushless motors to fulfil
other requirements (such as maintenance-free operation, high speeds, and explosive
environments where sparking could be hazardous). Brush type DC motors are used in very
many battery powered appliances. Brushless DC motors are commonly used in applications
like DC powered fans and disk drive rotation motors.
CHAPTER 4
Doctor/Authorized person can configure timing of Medicines via Android app using Cloud
communication. By using GSM data communication was easy to build into the system. When
a GSM modem is connected to a computer, this allows the computer to use GSM modem to
communicate over the mobile network. While this modem are most frequently used to provide
mobile internet connectivity, many of them can also be used for sending and receiving SMS
and MMS messages.RS232 is connected to GPRS modem and it is bi directionally connected
to micro controller. RS232 used to transferring and receiving the serial data between
devices.Once the start bit has been sent, the transmitter sends the actual data bits. There may
either be receiver and the transmitter must agree on the number of data bits, as well as the
baud rate. Time seletion,number of tray controlled by android mobile app. LCD display will
give more 5, 6, 7, or 8 data bits, depending on the number you have selected. Both information
about amount and number of tray.Apply the data or commands to DB0 to DB7 pins of LCD.
Automatic alarm alert the message at time of taking medicine. PIR sensor measure infrared
light radiating from patient or caregiver in its field of view. DC motor rotate the medicine
container and proper medicine will come out as instruction given in mobile app.L293D
driverIC used to convert 5v dc supply to 12v needed for dc motor to run. IR sensor sense
weather the patient taking medicine or not. If one do not take medicine after10 minutes from
container it will close automatically. And send alert messages to doctor or authorized persons
and they can reset the setting if wanted any change.
CHAPTER 5
PROGRAM DESIGNING
5.1.mikroc
5.11.intodunction
MikroC is a powerful, feature rich development tool for PIC microcontrollers. It is designed
to provide the programmer with the easiest possible solution for developing applications for
embedded systems, without compromising performance or control.
Fig:5.1.mikroc
PIC and C fit together well: PIC is the most popular 8-bit chip in the world, used in a wide
variety of applications, and C, prized for its efficiency, is the natural choice for developing
embedded systems. MikroC provides a successful match featuring highly advanced IDE,
ANSI compliant compiler, broad set of hardware libraries, comprehensive documentation, and
plenty of ready-to-run examples.
Feature
Write our C source code using the built-in Code Editor (Code and Parameter Assistants,
Syntax Highlighting, Auto Correct, Code Templates, and more) Use the included
mikroC libraries to dramatically speed up the development: data acquisition, memory,
displays, conversions, communications Practically all P12, P16, and P18 chips are
supported.
Monitor program structure, variables, and functions in the Code Explorer.
Generate commented, human-readable assembly, and standard HEX compatible with all
programmers.
Inspect program flow and debug executable logic with the integrated Debugger.
Get detailed reports and graphs: RAM and ROM map, code statistics, assembly listing,
calling tree, and more
Provided plenty of examples for expand, develop, and use as building bricks in our
projects. Copy them entirely if we deem fit thats why we included them with the
compiler.
// ===================Variables:
char i;
int TimeOut=0;
char
TimeSet=0,UpdateCurrentTime=0,Count=0,MCnt=0,TimeOk=0,TimeUpdate=0,MedOk=
0,MedUpdate=0;
char MTray1Select,MTray2Select,MTray3Select;
char NTray1Select,NTray2Select,NTray3Select;
char ETray1Select,ETray2Select,ETray3Select;
char Tray1Select,Tray2Select,Tray3Select,WhichTime,WhichTray;
char Medicine1Count,Medicine2Count,Medicine3Count;
bank1 char
InputTime[6],LastMedicineTime[6],TempTime[6],CurrentTime[6],MorningTime[6],Noon
Time[6],EveTime[6];
// ==============================
// ===================Functions:
Buzzer=1;
Delay_Ms (100);
Buzzer=0;
Delay_Ms (100);
//------------------------------
int Sec=0;
// Tray1:====================================
while(IRTray==1) {
TrayMotor1=1;
TrayMotor2=0;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
while(IRTray==0){
TrayMotor1=1;
TrayMotor2=0;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
Beep ();
if (Tray1Select=='0') {
Lcd_Out(1,0," ");
Lcd_Out(1,0,Tray1Name);
while (IRTake==0);
Delay_Ms(50);
while (IRTake==1);
Sec=10;
while (Sec--) {
Lcd_Out_2Digit(1,14,Sec);
Delay_Ms(1000);
Medicine1Count--;
// Tray2:====================================
while(IRTray==1) {
TrayMotor1=1;
TrayMotor2=0;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
while(IRTray==0){
TrayMotor1=1;
TrayMotor2=0;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
Beep ();
if (Tray2Select=='0') {
Lcd_Out(1,0," ");
Lcd_Out(1,0,Tray2Name);
while (IRTake==0);
Delay_Ms(50);
while (IRTake==1);
Sec=10;
while (Sec--) {
Lcd_Out_2Digit(1,14,Sec);
Delay_Ms(1000);
Medicine2Count--;
// Tray3:====================================
while(IRTray==1) {
TrayMotor1=1;
TrayMotor2=0;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
while(IRTray==0){
TrayMotor1=1;
TrayMotor2=0;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
Beep ();
if (Tray3Select=='0') {
Lcd_Out(1,0," ");
Lcd_Out(1,0,Tray3Name);
while (IRTake==0);
Delay_Ms(50);
while (IRTake==1);
Sec=10;
while (Sec--) {
Lcd_Out_2Digit(1,14,Sec);
Delay_Ms(1000);
Medicine3Count--;
Beep ();
Beep ();
// Reach Reference:===========================
// Pass Tray 3:
while(IRTray==1) {
TrayMotor1=0;
TrayMotor2=1;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
while(IRTray==0) {
TrayMotor1=0;
TrayMotor2=1;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
Beep ();
// Pass Tray 2:
while(IRTray==1) {
TrayMotor1=0;
TrayMotor2=1;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
while(IRTray==0) {
TrayMotor1=0;
TrayMotor2=1;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
Beep ();
// Pass Tray 1:
while(IRTray==1) {
TrayMotor1=0;
TrayMotor2=1;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
while(IRTray==0) {
TrayMotor1=0;
TrayMotor2=1;
Delay_Ms(10);
TrayMotor1=0;
TrayMotor2=0;
Delay_Ms(50);
Beep ();
Beep ();
Delay_Ms(2000);
//-------------------------------------
TrayMotor1=0;
TrayMotor2=0;
//-------------------------------------
if (Type==1) {
else if (Type==2) {
Usart_Write_String ("*nothing*Normal");
else if (Type==3) {
else if (Type==4) {
else if (Type==5) {
Delay_Ms(2000);
Delay_Ms(1000);
//------------------------------
Lcd_Out (1,11,CurrentTime);
//-------------------------------------
TempTime[0]=InputTime[0];
TempTime[1]=InputTime[1];
TempTime[2]=':';
TempTime[3]=InputTime[2];
TempTime[4]=InputTime[3];
TempTime[5]='\0';
if (strcmp(TempTime,CurrentTime)!=0) {
CurrentTime[0]=TempTime[0];
CurrentTime[1]=TempTime[1];
CurrentTime[2]=':';
CurrentTime[3]=TempTime[3];
CurrentTime[4]=TempTime[4];
CurrentTime[5]='\0';
UpdateCurrentTime=0;
TimeSet=1;
//-------------------------------------
MorningTime[0]=InputTime[0];
MorningTime[1]=InputTime[1];
MorningTime[2]=':';
MorningTime[3]=InputTime[2];
MorningTime[4]=InputTime[3];
MorningTime[5]='\0';
AllOk[0]='1';
//-------------------------------------
NoonTime[0]=InputTime[0];
NoonTime[1]=InputTime[1];
NoonTime[2]=':';
NoonTime[3]=InputTime[2];
NoonTime[4]=InputTime[3];
NoonTime[5]='\0';
AllOk[1]='1';
//-------------------------------------
EveTime[0]=InputTime[0];
EveTime[1]=InputTime[1];
EveTime[2]=':';
EveTime[3]=InputTime[2];
EveTime[4]=InputTime[3];
EveTime[5]='\0';
AllOk[2]='1';
//-------------------------------------
int i=0;
while (i<MCnt){
Tray1Name[i]=MedicineName[i];
i++;
Tray1Name[i]='\0';
AllOk[3]='1';
//-------------------------------------
int i=0;
while (i<MCnt){
Tray2Name[i]=MedicineName[i];
i++;
Tray2Name[i]='\0';
AllOk[4]='1';
//-------------------------------------
int i=0;
while (i<MCnt){
Tray3Name[i]=MedicineName[i];
i++;
Tray3Name[i]='\0';
AllOk[5]='1';
// AllOk[6]='\0';
//-------------------------------------
if (WhichTime=='1') {
UpdateMTime ();
else if (WhichTime=='2') {
UpdateNTime ();
else if (WhichTime=='3') {
UpdateETime ();
// WhichTime='0';
//------------------------------------
if (WhichTray=='1') {
UpdateTray1Name ();
else if (WhichTray=='2') {
UpdateTray2Name ();
else if (WhichTray=='3') {
UpdateTray3Name ();
// WhichTray='0';
char i;
for (i=0;1<30;i++) {
DataBuff[i]=' ';
void CheckSerialComm(void){
char DataBuff[25],DataCnt=0;
if (Usart_Data_Ready ()==1) {
DataBuff[DataCnt++]=Usart_Read ();
if (DataCnt>=7) {
if(DataBuff[0]=='*') {
DataBuff[DataCnt]='\0';
DataBuff[14]='\0';
Lcd_Out(2,0," ");
Lcd_Out(2,0,&DataBuff[1]);
DataCnt=0;
else if (DataBuff[0]=='&') {
Lcd_Out (1,15,"T");
InputTime[0]= DataBuff[1];
InputTime[1]= DataBuff[2];
InputTime[2]= DataBuff[4];
InputTime[3]= DataBuff[5];
// Usart_Write_String(InputTime);
UpdateCurrentTime=1;
DataCnt=0;
else if (DataBuff[0]=='#') {
Count=1;
if (DataBuff[Count]!='%') {
WhichTime=DataBuff[Count];
TimeOk=1;
Count++;
Count++;
else {
Count++;
InputTime[0]=DataBuff[Count];
Count++;
else {
Count++;
InputTime[1]=DataBuff[Count];
Count++;
Count++;
else {
Count++;
InputTime[2]=DataBuff[Count];
Count++;
else {
Count++;
InputTime[3]=DataBuff[Count];
TimeUpdate=1;
Count++;
Count++;
else {
Count++;
if (DataBuff[Count]!='%') {
if (TimeOk==1) {
if (WhichTime=='1') {
MTray1Select=DataBuff[Count];
else if (WhichTime=='2') {
NTray1Select=DataBuff[Count];
else if (WhichTime=='3') {
ETray1Select=DataBuff[Count];
// Tray1Select=InputString[Count];
Count++;
Count++;
else {
Count++;
if (DataBuff[Count]!='%') {
if (TimeOk==1) {
if (WhichTime=='1') {
MTray2Select=DataBuff[Count];
else if (WhichTime=='2') {
NTray2Select=DataBuff[Count];
else if (WhichTime=='3') {
ETray2Select=DataBuff[Count];
// Tray1Select=InputString[Count];
Count++;
Count++;
else {
Count++;
if (DataBuff[Count]!='%') {
if (TimeOk==1) {
if (WhichTime=='1') {
MTray3Select=DataBuff[Count];
else if (WhichTime=='2') {
NTray3Select=DataBuff[Count];
else if (WhichTime=='3') {
ETray3Select=DataBuff[Count];
// Tray1Select=InputString[Count];
Count++;
Count++;
else {
Count++;
if (DataBuff[Count]!='%') {
WhichTray=DataBuff[Count];
MedOk=1;
Count++;
Count++;
else {
Count++;
MCnt=0;
while (Count<DataCnt) {
MedicineName[MCnt++]=DataBuff[Count];
Count++;
MedUpdate=1;
Count=0;
DataCnt=0;
void main(void) {
TRISA = 0b11111111;
TRISB = 0b00000001;
TRISC = 0b10010100;
TRISD = 0b11000111;
Buzzer=0;
TrayStop ();
Lcd_Init(&PORTB);
Usart_Init(9600);
Delay_Sec(2);
Lcd_Out(2,0," ");
Delay_Ms (1000);
Lcd_Out(1,0," ");
Lcd_Out(2,0," ");
CurrentTime[0]='H';
CurrentTime[1]='H';
CurrentTime[2]=':';
CurrentTime[3]='M';
CurrentTime[4]='M';
CurrentTime[5]='\0';
LastMedicineTime[0]='H';
LastMedicineTime[1]='H';
LastMedicineTime[2]=':';
LastMedicineTime[3]='M';
LastMedicineTime[4]='M';
LastMedicineTime[5]='\0';
TimeSet=0;
while (TimeSet==0) {
CheckSerialComm ();
if (UpdateCurrentTime==1) {
UpdateTime ();
// UpdateCurrentTime=0;
while(1) {
CheckSerialComm ();
if (UpdateCurrentTime==1) {
UpdateTime ();
UpdateCurrentTime=0;
} if (TimeSet==1) {
DisplayTime ();
ChangeTime ();
TimeOk=0;
TimeUpdate=0;
ChangeMedicine ();
MedOk=0;
MedUpdate=0;
Lcd_Out (1,0,AllOk);
if (Medicine1Count<2) {
SendDataToIOT (3);
if (Medicine2Count<2) {
SendDataToIOT (4);
if (Medicine3Count<2) {
SendDataToIOT (5);
if ((strcmp (CurrentTime,MorningTime)==0)) {
Tray1Select=MTray1Select;
Tray2Select=MTray2Select;
Tray3Select=MTray3Select;
Tray1Select=NTray1Select;
Tray2Select=NTray2Select;
Tray3Select=NTray3Select;
Tray1Select=ETray1Select;
Tray2Select=ETray2Select;
Tray3Select=ETray3Select;
}
Department of ECE Page 63 MEA Engineering College
ProjectReport2016-17 Intelligent patient care system
TimeOut=20;
Beep ();
Delay_Ms(300);
// Lcd_Out_2Digit (1,0,TimeOut);
if (TimeOut==-1) {
SendDataToIOT (1);
else {
LastMedicineTime[0]=CurrentTime[0];
LastMedicineTime[1]=CurrentTime[1];
LastMedicineTime[2]=CurrentTime[2];
LastMedicineTime[3]=CurrentTime[3];
LastMedicineTime[4]=CurrentTime[4];
LastMedicineTime[5]=CurrentTime[5];
TrayRotate ();
SendDataToIOT (2);
}
Department of ECE Page 64 MEA Engineering College
ProjectReport2016-17 Intelligent patient care system
CHAPTER 6
ADVANTAGES &DISADVANTAGES
6.1ADVANTAGES
Doctor/Authorized person can configure timing of Medicines via Android app using
cloud communication.
Automatic alarm and alert message at time of taking medicine.
If one miss to take medicine ,it send alert messages to doctor and authorized persons
6.2 DISADVANTAGES
CHAPTER 7
PLAN OF ACTION
Identification of scope
Literature survey
Finalization of block diagram
Component identification
Simulation
Assembling
Final report
CHAPTER 8
It has been reported that wrong medicine box has been delivered to patient accidentally at
hospital's Inpatient Department, so the patient may take the wrong medicine and the medical
incident occurs consequently. In order to resolving this problem, it is necessary to design
intelligent medicine box monitoring and management system. This system integrates
technologies involving network, RFID, and touch screen. At the network, the system
monitors and controls the releasing process of medicine box through RFID label ring; dosing
time, notes and other relevant information for patients. Therefore the patient would be
reminded to take the medicine clearly and regularly.
8.2.Literature review
At present, medicine distribution and medication errors occur every year in the field of
medical, which not only caused serious consequences to the patient, also led to the increased
cost of medical treatment. At hospital's inpatient department, nurse distributed the medicine
to patients every day. The nurse usually put the patient's medicine indifferent medicine
boxes, and then put the medicine boxes distribute to each patient, at the same time, described
method of taking the medicine, but each time distributed many medicine boxes, it is hard to
avoid mistakes. The medicine instructions are showed not enough detail, patients take the
wrong medicine, or can't remember dosing time and method, that might lead to serious
medical accidents. Therefore, with the use of the Internet of things technology, the present
paper designs a set of intelligent medicine box monitoring and management system to solve
the above problems
The RTC will maintained the correct time of the microcontroller and the buzzer will ring at
scheduled time. The medicine container will come out and wait for some times. The PIR
sensor sense the patient presents, if the patient take medicine it automatically close or the
device will send the message to the doctor or authorized person if the patient fail to take
medicines. So,they can reprogrammed the device
CHAPTER 9
CONCLUSION
From this project INTELLIGENT PAITENT CARE SYSTEM we can conclude that this
system will act as second hand to the patient . Therefore the patient would be reminded to take
the medicine timely. The system could effectively resolve the problem of negligence and mis
operation when medicine distribution, and as well avoid the accidental medicine taking for
patient.
9.1.RESULT
REFERENCES