Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

EGN 4033 ENGINEERING PROJECT FINAL

REPORT 1

Bio Analyzer

Team Leader
Saud Alali H00228805

Team Member

Mohammed Jassim H00206162

Sharjah Higher Colleges

Project Supervisor: Dr.Haitham Tayyar EGN 4033

Submission Date: 10/12/2015

Word count: 2702 words


EGN 4033 – ENGINEERING PROJECT FINAL REPORT 2

Abstract

BMI stands for Body Mass Index. It is uses your height and weight to give you an
idea of whether you are underweight, overweight or have an ideal weight. Also, the pulse
sensor will shows your heart beat wither it’s high low or medium. Then math calculations
will be applied to display your result. This Health Monitor will be controlled by a
AruidnoUNO microcontroller using load cells, ultrasonic sensors and heart pulse sensor.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 3

Table of Contents

1.0 Introduction....................................................................................................................4

2.0 Theoretical Concepts.....................................................................................................4

3.0 System Block and Circuit Diagrams..............................................................................5

3.1 Block 1 Description...................................................................................................6


3.2 Block 2 Description...................................................................................................6
4.0 Software Flow Diagram.................................................................................................7

5.0 Testing Results...............................................................................................................7

6.0 Conclusion.....................................................................................................................9

References..........................................................................................................................10

Appendix............................................................................................................................10
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 4

1.0 Introduction

Nowadays, a lots of health problem are associated by obecity. Hight blood


prussre, diabetes and stroke all of these are health risks related to overweight.
The project will analyze the physical characteristics of the “Body Mass Index”
uses weight and height controlled by Arduino. Where this calculator will do the
calculating from the ultrasonic sensor and the load cell scale readings. Then it will take
the reading to a mathematical equation as showing on Figure 1, either on (kilogram &
meter square ) or (pound & inches square *703).

Figure 1

A future plan was to add a database and keypad for the design, unfortunately we
ran out of time and didn’t find someone to create a database. Also, to add a function that
measure a blood pressure using a pressure sensor.

2.0 Theoretical Concepts

Firstly we will turn on the microcontroller. When the Arduino is on, the LCD also
will turn on and it will display a message to with four lines for height, weight, heart beat
pulse and the BMI result. Now stand on the load cell platform and press the reset bottom.
It might takes some time to show stable result and calculating for your weight by load
cell and height by the ultrasonic sensor. After while the result of the BMI will be reveal
on the LCD. There is an LED that will synchronize the light with your heartbeat as a
flash.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 5

3.0 System Block and Circuit Diagrams

The figure below illustrate the design and schematic for printed circuit board that
we used for the project:
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 6

3.1 Block 1 Description

Input
Process Output
Load cell LED light
Ultrasonic sensor Microcontroller
LCD display
Pulse sensor Arduino uno
Ultrasonic
Push bottom

3.2 Block 2 Description

LED
Load cell
Light

Pulse
LCD Microcontroller sensor
Display Arduino UNO

Ultrasonic
sensor

Ultrasonic

Push
bottom
PC
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 7

4.0 Software Flow Diagram


Start

Initialization

Push
bottom

Pulse
sensor

Load cell

Ultrasonic
Sensor

Calculate
Height ,
Weight ,
No
BMI , Yes
HB.

LED
Light

Ultrasonic

LCD
Display
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 8

we made a block diagrams to explain how the system will operate in the
project. It will show the general idea of the project by knowing the input, the
output devices and the controlled device. Each block above is define below:

 ( Start ) Block:

This block mean to start the program.

 (Push bottom ) Block :

This is an example of input device that we used to clear the LCD display result.

 ( Pulse sensor ) Block :

This is an example of input device that we used to measure the heart beats .

 ( Load cell ) Block :

This is an example of the input ( load cell )which measure the weight in the program.

 ( Ultrasonic sensor ) Block :


This is an example of ( Ultrasonic sensor )which measure the distance in the program.

 ( calculation # ? ) Block :

This is an example of the process that that make the calculation of inputs reading in the
program.

 ( Display ) Block :

This is an example of output display that will show the result after processing in the
software.

 ( LED ) Block :

This is an example of LED that will blink synchronize with pulse sensor showing
heartbeat.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 9

5.0 Testing Results

 Load cell (stain gauge) : Firstly, we purchased a load cell with 3 wires only from
a local supplier. We tried to detect the change in voltage to determine the weight,
but the voltage change in Adruino is very small and can’t be recognize without
amplifying the voltage. We weren’t able to buy this amplifier  8-pin LM741CN
Op-Amp online due to long shipping time. So Mr.Cezar brought a load cell
CZL601 strain gauge that was previously used by others. We started to look for
the 4 colors wires and how we can connect it to the Arduino. Later, we tested it by
applying and external outsource 5 volt and see the changes on voltage, it was very
tiny but we add 8 pins LM741 Op-Amp. the we started to write the code and
then calibrate the weighting scale, its originally 0 at almost 416.

 Ultrasonic sensor and LCD 20x4 : Arduino software has ping code and liquid
Crystal for LCD code ready, so used and modified it for to meet the project needs.

 Pulse sensor : the code was ready to use on the Arduino website so we modified
it to meet the project needs.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 10

6.0 Conclusion

Working on this project was an immense step in our path to be engineers. They faced
some of issues and we tried to solve them as which show it’s a normal issues that can
happen in the coursework of any project. Finishing this project as a team helped us to
understand the importance of teamwork and coming up with ways to be able to work
effectively with my colleague. We tried our best to include details of the project in the
document correctly although there is a probability of errors in sensor readings. During the
design some codes didn’t work on the ArduinoYun, so we had to get a new ArduinoUno
in the last 3 weeks. We also faced problem with load cell found the amplifier so we had
to call the technical to find alternative amplifier. We took of some of the components
during the design because of the time and the coding. However after finishing the project
we found that we can add some improvement to the project in the future to enhance the
project such as adding pressure sensor to measure the B.P, in addition a database to save
the data of the user. Finlay data should transmit to an app that connected with the
network to share the data.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 11

7.0 References

841-MP3V5050DP . (n.d.). Retrieved Apr 22, 2015, from MOUSER ELECTRONICS:


http://www.mouser.com/ProductDetail/Freescale-Semiconductor/MP3V5050DP/?
qs=3b6%2Fl7XffK%2F6d%252bBbew3lOg%3D%3D
Centers for Disease Control and Prevention. (2015, Apr 17). About BMI for Adults.
Retrieved Apr 22, 2015, from Healthy Weight - it's not a diet, it's a lifestyle!:
http://www.cdc.gov/healthyweight/assessing/bmi/adult_bmi/
Coombe , I. (n.d.). Body Mass Index (BMI) is Bad. Retrieved May 17, 2015, from Heart
News Links: http://www.heartnewslinks.com/editors-blog/body-mass-index-bmi-
bad
Zero Ohm Electronics . (2012). Zero Ohm Electronics. Retrieved Apr 12, 2014, from
Zero Ohm: http://www.zeroohm.ae/
Irobotec.com/arduino. (2015, Oct 8).
http://www.sah.rs/senzori/CZL601_eng.html (2015, Oct 25).
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 12

8.0 Appendix

8.1 Project Cost

Name Quant Price Picture Link


ity
Arduino Yun 1 100.00AED Arduino-
UNO

Ultrasonic 2 140.00AED Ultrasonic-


Range Range-
Finder Finder

Pulse 1 100.00AED Pulse-


Sensor Sensor
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 13

Basic 20x4 1 85.00AED LCD-


Character Basic
LCD - Black
on Green 5V

Push bottom 1 n/a

Active 4 Available Capacitor


electronics on college Resistor
LED
Totla 425 AED
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 14

8.2 Data sheets

1) ArduinoUNO

2) Ultrasonic

Pin Out Description

Pin 1- Temperature Sensor Connection: Leave this pin unconnected if an external


temperature sensor is not used. For best accuracy, this pin is optionally connected to the
HR-MaxTemp temperature sensor. Look up the HR-MaxTemp temperature sensor for
additional information.
Pin 2- Pulse Width Output: This pin outputs a pulse width representation of the
distance
with a scale factor of 1uS per mm. Output range is 300uS for 300-mm to 5000uS for
5000-mm. Pulse width output is +/- 1% of the serial data sent.
Pin 3- Analog Voltage Output: On power-up, the voltage on this pin is set to 0V, after
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 15

which, the voltage on this pin has the voltage corresponding to the latest measured
distance.
This pin outputs an analog voltage scaled representation of the distance with a scale
factor of (Vcc/1024) per 5-mm. (This
output voltage is referenced to GND, Pin 7.) The analog voltage output is typically within
±10-mm of the serial output.
Using a 10bit analog to digital convertor, one can read the analog voltage bits (i.e. 0 to
1023) directly and just multiply the
number of bits in the value by 5 to yield the range in mm. For example, 60 bits
corresponds to 300-mm (where 60 * 5 =
300), and 1000 bits corresponds to 5000-mm (where 1000 * 5 = 5000-mm).
For users of this output that desire to work in voltage, a 5V power supply yields~4.88mV
per 5 mm. Output voltage range
when powered with 5V is 293mV for 300-mm, and 4.885V for 5000-mm.
Pin 4- Ranging Start/Stop: This pin is internally pulled high. If this pin is left
unconnected or held high, the sensor will
continually measure and output the range data. If held low, the HRLV-MaxSonar-EZ will
stop ranging. Bring high for
20uS or longer to command a range reading.
Real-time Range Data: When pin 4 is low and then brought high, the sensor will operate
in real time and the first reading
output will be the range measured from this first commanded range reading. When the
sensor tracks that the RX pin is low
after each range reading, and then the RX pin is brought high, unfiltered real time range
information can be obtained as
quickly as every 100mS.
Filtered Range Data: When pin 4 is left high, the sensor will continue to range every
100mS, but the output will pass
through a 2Hz filter, where the sensor will output the range based on recent range
information.
Pin 5-Serial Output: By default, the serial output is RS232 format (0 to Vcc) with a 1-
mm resolution. If TTL
output is desired, solder the TTL jumper pads on the back side of the PCB as shown in
the photo to the right.
For volume orders, the TTL option is available as no-cost factory installed jumper. The
output is an ASCII
capital “R”, followed by four ASCII character digits representing the range in
millimeters, followed by a
carriage return (ASCII 13). The maximum distance reported is 5000. The serial output is
the most accurate of the range
outputs. Serial data sent is 9600 baud, with 8 data bits, no parity, and one stop bit.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 16

V+ Pin 6 - Positive Power, Vcc: The sensor operates on voltages from 2.5V - 5.5V DC.
For best operation, the sensor
requires that the DC power be free from electrical noise. (For installations with known
dirty electrical power, a 100uF
capacitor placed at the sensor pins between V+ and GND will typically correct the
electrical noise.)
GND Pin 7 – Sensor ground pin: DC return, and circuit common ground.

3) Pulse sensor
Stats:    Diameter = 0.625" (~16mm)
              Overall thickness = 0.125" (~3mm)
              Cable length = 24" (~609mm)
              Voltage = 3V to 5V
              Current consumption = ~4mA at 5V

4) Load cell

Stainless steel. Easy installation. It is used for weighing, measuring tension, pressure
measurement, vibration measurement:
Comprehensive error 0,03% F.S.
Rated output 2±0.02mV/V
Nonlinearity 0,03% F.S.
Repeatability 0,02% F.S.
Zero Balance 1% F.S.
Input Resistance 405±5Ω
Output Resistance 350±5Ω
Insulation Resistance >=5000MΩ(100VDC)
Excitation Voltage 9~12V 
Protection class IP66

5) LCD

Interface pin description


Pin no. Symbol External connection Function 1 VSS Signal ground for LCM (GND)
2 VDD Power supply for logic (+5V) for LCM 3 V0 Power supply Contrast adjust 4
RS MPU Register select signal 5 R/W MPU Read/write select signal 6 E MPU
Operation (data read/write) enable signal 7~10 DB0~DB3 MPU Four low order bi-
directional three-state data bus lines. Used for data transfer between the MPU and the
LCM. These four are not used during 4-bit operation. 11~14 DB4~DB7 MPU Four
high order bi-directional three-state data bus lines. Used for data transfer between the
MPU 15 LED+ Power supply for BKL (Anode) 16 LEDLED BKL power Supply
Power supply for BKL (GND).
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 17

Optical characteristics
STN type display module (Ta=25℃, VDD=5.0V) Item Symbol Condition Min. Typ.
Max. Unit Viewing angle θ -60 - 35 Φ Cr≥2 -40 - 40 deg Contrast ratio Cr - 15 - -
Response time (rise) Tr - - 150 250 Response time (fall) Tr - - 150 250 ms Electrical
characteristics LED ratings Item Symbol Min Typ. Max Unit Forward Voltage VF
3.8 4.0 4.4 V Forward current IF 240 mA Power P 1.01 W Peak wave length λp 568
nm Luminance Lv 185 Cd/m2 Operating temperature range VOP -20 - +70 Storage
temperature range VST -25 - +80 ℃
DC characteristics
Parameter Symbol Conditions Min. Typ. Max. Unit Supply voltage for LCD VDD-
V0 Ta =25℃ - 4.6 - Input voltage VDD 4.7 - 5.5 Backlight supply voltage VF - 4.1
4.3 V Supply current IDD Ta=25℃, VDD=5.0V - 1.5 3 Backlight supply current IF
VDD=5.0V R=6.8 150 mA Input leakage current ILKG - - 1.0 uA “H” level input
voltage VIH 2.2 - VDD “L” level input voltage VIL Twice initial value or less 0 - 0.6
“H” level output voltage VOH LOH=-0.25mA 2.4 - - “L” level output voltage VOL
LOH=1.6mA - - 0.4 V.
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 18

8.3 Codes

#define LOAD_CELL_SCALE 8.8//Load Cell scaling


#define HR_LOW 50 //
#define HR_HIGH 100 //
#define UNDER_WEIGHT 18 //
#define OVER_WEIGHT 25 //

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins


LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

const int sonarPin = 8;


const int loadcellPin = A1;
const int loadcellResetpin = 10;

// VARIABLES
int pulsePin = 0; // Pulse Sensor purple wire connected to analog pin 0
int blinkPin = 13; // pin to blink led at each beat

// these variables are volatile because they are used during the interrupt service
routine!
volatile int BPM; // used to hold the pulse rate
volatile int Signal; // holds the incoming raw data
volatile int IBI = 600; // holds the time between beats, the Inter-Beat
Interval
volatile boolean Pulse = false; // true when pulse wave is high, false when it's
low
volatile boolean QS = false; // becomes true when Arduoino finds a beat.

long pulse, cm;


long sonar_update;
int load_cell_value, zero_value;
float kg;
float bmi;
void setup()
{
pinMode(blinkPin,OUTPUT); // pin that will blink to your heartbeat!
pinMode(loadcellResetpin,INPUT);
digitalWrite(loadcellResetpin, HIGH);
lcd.begin(20, 4);
lcd.clear();

Serial.begin(9600); // we agree to talk fast!


EGN 4033 – ENGINEERING PROJECT FINAL REPORT 19

interruptSetup(); // sets up to read Pulse Sensor signal every 2mS


sonar_update = millis();
}

void loop()
{

if(millis() - sonar_update >= 1000)


{
sonar_update = millis();
read_sonar();
read_load_cell();
calculate_bmi();
sendDataToCompter();
sendDataToLCD();
}
delay(20); // take a break
}

void calculate_bmi(void)
{
bmi = kg/(pow(cm/100.0, 2));
}

void read_sonar(void)
{
pulse = pulseIn(sonarPin, HIGH);
cm = pulse/29/2;
//cm = 200-cm; // the differance between the object and sensor
}

void read_load_cell(void)
{
load_cell_value = analogRead(loadcellPin);
if(digitalRead(loadcellResetpin) == LOW) zero_value = load_cell_value;
kg = (load_cell_value - zero_value)/ LOAD_CELL_SCALE;
if(kg<0) kg = 0;
}

void sendDataToLCD(void)
{
lcd.setCursor(0, 0);
lcd.print("Height = ");
lcd.print(" ");
lcd.setCursor(13, 0);
lcd.print(cm);
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 20

lcd.print("cm");

lcd.setCursor(0, 1);
lcd.print("Weight = ");
lcd.print(" ");
lcd.setCursor(13, 1);
lcd.print(kg,1);
lcd.print("kg");

lcd.setCursor(0, 2);
lcd.print("HR =");
lcd.print(" ");
lcd.setCursor(4, 2);
lcd.print(BPM);
lcd.print("ppm");
lcd.setCursor(11, 2);
if(BPM < HR_LOW) lcd.print("Low HR");
else if(BPM > HR_HIGH) lcd.print("High HR");
else lcd.print("Normal HR");

lcd.setCursor(0, 3);
lcd.print("BMI=");
lcd.print(" ");
lcd.setCursor(4, 3);
lcd.print(bmi,2);
lcd.setCursor(10, 3);
if(bmi < UNDER_WEIGHT) lcd.print("Under Wgt");
else if(bmi > OVER_WEIGHT) lcd.print(" Over Wgt");
else lcd.print("Normal Wgt");
//lcd.print("kg");
}

void sendDataToCompter(void)
{
Serial.print("BPS = ");
Serial.print(BPM);
Serial.print("\tHeight = ");
Serial.print(cm);
Serial.print("\tWeight = ");
Serial.print(kg,1);
Serial.print("\tBMI = ");
Serial.print(bmi,2);
Serial.print("\tLoad Cell = ");
Serial.println(load_cell_value);}
EGN 4033 – ENGINEERING PROJECT FINAL REPORT 21

9 Acknowledgement

We had to use the help and guideline of some respected persons while working on our
project. These people deserve our greatest gratitude. We would like to show our gratitude
to Dr. Haitham Tayyar for giving us a good guideline throughout numerous consultations.
We would also like to expand our deepest gratitude to all those who have directly and
indirectly guided us in completing this project.

In addition, We would like to thank the teachnical Mr. Cezar for making time in their
busy schedules to help us in the workshop and during the testing of our device.

Many people, especially our classmates and my colleagues Mohammed Jassim and
Khalid have made valuable suggestions which gave us an inspiration to improve our
project. We thank all the people for their help directly and indirectly to complete our
project.

You might also like