Bicycle with Health Monitoring System
The Following Project was submitted to Parallax by Justin John:
Health Monitoring System
A key part of our design is the health monitoring system. The purpose of the system is to provide the user with as much information about their workout as possible. Through the health monitoring system, the user will be able to have a more effective, informational, and healthier workout. The health monitoring system includes the following features:
- BMI (Body Mass Index)
- Miles Per Hour
- Calories burned per a minute
- Heart Rate (BPM)
All of the information is displayed on an LCD, which is directly in front of the user. The BASIC Stamp® module is the microcontroller used to run the programs. The user enters their information in only four steps.
After all the information has been entered, the user’s BMI will be displayed along with a comment about it. If the enter button is pressed, the speed at which the user is riding and the amount of calories burned per a minute will be displayed. The user can then hit the enter button to restart the program if they want to enter in any new information. If the user wants to see his/her heart rate then they must switch the display using the black switch in the middle. Once the switch is pressed, the user can place the heart rate monitoring clip on her/her finger or ear. If the clip is on correctly it will give the user’s heart rate in beats per minute. If the user does not have the clip in the proper position the display will say “Invalid Signal” and the user will have five seconds to reposition the hear rate monitoring clip. The user has the ability to switch between the heart rate monitor and the other features at any time using the switch located in the middle of the display. The following sections describe in detail all the hardware and software used for the health monitoring system.
BASIC Stamp 2 module
Our project required an inexpensive embedded system with some intelligence. The BASIC Stamp 2 microcontroller, which is a microcontroller that is designed for use in a wide variety of applications, was a good solution. The BASIC Stamp 2 module consists of PBASIC Interpreter chip, internal memory (EEPROM and RAM), a 5-volt regulator, 16 I/O pins, and a set of built-in commands for math and I/O operations. The language used to control the BASIC Stamp microcontroller is called PBASIC. It is similar to other forms of BASIC and contains special instructions just for the BASIC Stamp microcontroller. All of the pins are described in appendix D3. In order to download a program to the BASIC Stamp module, a serial connection is needed. The serial connection is basically a six-wire set up. Pins 1 through 4 of the BS2 are connected to pins 2-5 of the serial port. Pins 6 and 7 of the serial port are connected to each other to enable automatic port detection. Appendix D3 has a detailed picture of this connection.
The BS2-IC has two types of power connections. Pin 24(VIN) takes in unregulated power between 5.5-15 volts DC. This is internally regulated to 5 volts and can be left unconnected if 5 volts is applied to pin 21. Pin 21(VDD) is a 5-vold DC input/output pin. If an unregulated voltage is applied to the VIN pin, then his pin will output 5 volts. If no voltage is applied to the VIN pin then, then a regulated voltage between 4.5V and 5.5V should be applied to this pin. For our set up we used a battery pack that held 4AA batteries and outputted 6V. The battery pack was connected to the VIN pin and used pin 21, which outputted 5V, to power the rest of the circuitry.
In order to download code to the serial port, the BASIC Stamp Editor program is needed. This program is available for either DOS or Windows and is easy to use and setup. All the code written for the Health Monitoring System was done through this program. A list of commands used for the program is provided in Appendix D3
Liquid Crystal Display (LCD)
In order to display all of the information needed, a Scott Edward's 4 x 20 serial LCD was used, which came with a serial backpack that reduced the amount of connections from 16 to 3. Figure 1 and Figure 2 in Appendix D3 show how to connect serial I/O and power to the BPP-420. There are three basic connections that need to be made. There is one I/O pin, a +5V power and a ground. The wires had to be soldered to the pins to ensure a secure connection. Parallax provided sample code in BS2 format, which made it easy to follow.
Body Mass Index (BMI)
The easiest way to determine whether you're "overweight" or "underweight" is to figure out your body mass index (BMI). A BMI between 20-25 means your in good condition. The lower you go the more mass you should put on. The higher your BMI, the more obese you are and you should try to lose weight. The higher your BMI, the greater your risk of certain conditions, such as coronary heart disease, type 2 diabetes and high blood pressure. To determine BMI, weight in kilograms is divided by height in meters, squared. In other words the algebraic expression for BMI is: BMI = Kg / (m)2
Miles Per Hour (MPH) Display
One feature of the Health Monitoring System is the MPH display. The speed of the user is calculated through LabView and transferred to the BS2 through 5 I/O pins. 5 pins will allow a range from 0-31. Through the use of the .bit instruction, each bit of the 8-bit MPH variable was set according to the LabView output.
Calories
Another key feature of the Health Monitoring System is the Calorie display. The amount of calories burned per a minute is displayed according the speed you are currently going. I needed to pick the most accurate formula with the least amount of variables because the BS2 had virtually no memory left. After carefully examining the formulas at hand, the most accurate result with the least amount of variables came from the formula:
Weight (lbs) * Time (min) * Activity Factor * .000119
The variable for weight was already stored in the program, and time would be a constant 1 because the amount of calories burned per a minute is being displayed. The activity factor is broken down into 7 different categories depending on the current MPH: (1) 0 – 5 MPH, Activity Factor of 155, (2) 5 – 8 MPH, Activity Factor of 189 (3) 9 – 10 MPH, Activity Factor of 253, (4) 11 – 12 MPH, Activity Factor of 381 (5) 13 – 14 MPH Activity Factor of 508 (6) 15 – 16 MPH, Activity Factor of 636 (7) 17 MPH and higher, Activity Factor of 710
The only problem with this formula is the use of the constant .000119. Since the BS2 does not support floating point numbers a special method would have to be used to go around this obstacle.
Heart Rate Monitor
An essential part to the Health Monitoring System is the Heart Rate Monitor. After doing research into the field of opto-electric isolation, I realized that making the heart rate monitor, obtaining and putting together the parts for the opto-electric isolation would not be a feasible solution for the problem. However, when the heart beats, the amount of blood in the ear or finger changes, which would change the amount of light passing through with every beat of the heart. I also realized than an infrared LED could be used to pass light through a user’s finger or ear with out any safety concern.
The combination of the health rate monitoring system and the heart monitoring provides the user with a tremendous amount of information. The user will have the ability to view their BMI, speed, heart rate and the amount of calories burned per a minute. The user can tailor a workout to burn a certain amount of calories, ride a certain speed, or work for an optimal heart rate. These options will help the user be more aware of his/her workout and lead a healthier lifestyle. By having a customized workout, the user has a more enjoyable experience and is further motivated to continue to stay physically active.
You can email Justin at: MWarez@aol.com |