Workout Buddy A muscle fiber stimulation sensor and data logger Senior Design Group 8 Summer 2009
description
Transcript of Workout Buddy A muscle fiber stimulation sensor and data logger Senior Design Group 8 Summer 2009
Workout BuddyWorkout BuddyA muscle fiber stimulation sensorA muscle fiber stimulation sensor
and data loggerand data logger
Senior DesignSenior Design
Group 8Group 8
Summer 2009Summer 2009
Matt McNealy (EE)Matt McNealy (EE)
Scott Martin (EE)Scott Martin (EE)
Andrew Lee (CpE)Andrew Lee (CpE)
Josh Hamby (EE)Josh Hamby (EE)
Goals & ObjectivesGoals & Objectives To design and implement a device that will allow To design and implement a device that will allow
weight lifters to monitor and track their progress weight lifters to monitor and track their progress electronically.electronically.
To build a sensor system that:To build a sensor system that: Measures the electric potential generated by certain Measures the electric potential generated by certain
muscle groups.muscle groups. Detects the angle of body part being exercised.Detects the angle of body part being exercised.
To learn about wireless technology, medical To learn about wireless technology, medical devices and programming microcontrollers.devices and programming microcontrollers.
To find points of over exertion in any particular To find points of over exertion in any particular exercise and improve on underworked muscle exercise and improve on underworked muscle groups.groups.
Specifications and Specifications and RequirementsRequirements
Sensor circuit:Sensor circuit: Operating time: 3 hours.Operating time: 3 hours. Operating voltage: 2.8-3.7VOperating voltage: 2.8-3.7V Powered by polymer lithium Powered by polymer lithium
ion batteryion battery Dimensions: 2.1” x 2.3”Dimensions: 2.1” x 2.3” Measure S-EMG ranging Measure S-EMG ranging
from 0.02-5mV.from 0.02-5mV. Capability of measuring a Capability of measuring a
full 360 degree range of full 360 degree range of motion in three dimensions.motion in three dimensions.
Communicate with the Communicate with the control module up to 3 control module up to 3 meters.meters.
Must secure to the body via Must secure to the body via velcro strap.velcro strap.
Control module:Control module: Operating time: 3 hours.Operating time: 3 hours. Operating voltage: 3.3VOperating voltage: 3.3V Powered by a 9V lithium Powered by a 9V lithium
battery.battery. Dimensions: 3” x 2.6” Dimensions: 3” x 2.6” Wirelessly receive data Wirelessly receive data
from the sensor circuit.from the sensor circuit. Automatically count Automatically count
repetitions and sets.repetitions and sets. Display data on the LCD Display data on the LCD
screen.screen. Write data to a micro-SD Write data to a micro-SD
card.card.
Block DiagramBlock DiagramSensor UnitSensor Unit
Block DiagramBlock DiagramControl ModuleControl Module
EMG & EKG EMG & EKG RequirementsRequirements
Amplifier:Amplifier: Gain of 1000+Gain of 1000+ High CMRR >95 db for frequencies 10 – 500 High CMRR >95 db for frequencies 10 – 500
HzHz Input impedance = 10 x electrode impedanceInput impedance = 10 x electrode impedance
Skin Preparation:Skin Preparation: Cleaned and freed of dry skin cellsCleaned and freed of dry skin cells Centered on the belly of the muscleCentered on the belly of the muscle 2 Electrodes 2 cm center to center2 Electrodes 2 cm center to center
Sensor CircuitrySensor Circuitry
EMG & EKG Detection:EMG & EKG Detection: INA122P-ND Instrumentation AmplifierINA122P-ND Instrumentation Amplifier
Angle Detection:Angle Detection: MMA7260Q Triple Axis AccelerometerMMA7260Q Triple Axis Accelerometer
Instrumentation Instrumentation AmplifierAmplifier
INA122P-NDINA122P-ND Voltage supply: Voltage supply:
2.2 - 36 VDC2.2 - 36 VDC Supply current: Supply current:
60 - 85 60 - 85 μμAA CMRR: 83 - 96 dbCMRR: 83 - 96 db Gain: 1-10000Gain: 1-10000 Input impedance: Input impedance:
10^10 ohm10^10 ohm Digikey: $5.56Digikey: $5.56
AD626AN-NDAD626AN-ND Voltage supply: Voltage supply:
2.4 - 10 VDC2.4 - 10 VDC Supply current: Supply current:
230 - 290 230 - 290 μμAA CMRR: 66 - 90 dbCMRR: 66 - 90 db Gain: 1-100Gain: 1-100 Input impedance: Input impedance:
200 k ohm200 k ohm Digikey: $7.46Digikey: $7.46
Signal Acquisition & Signal Acquisition & ProcessingProcessing
Processing of the signal enables the user to Processing of the signal enables the user to maximize their workout experience.maximize their workout experience.
Triple Axis Triple Axis AccelerometerAccelerometer
MMA7260Q :MMA7260Q : Power supply: Power supply:
2.2 - 3.7 VDC2.2 - 3.7 VDC 500 - 800 500 - 800 μμAA
Selectable sensitivity: Selectable sensitivity: 1.5g = 800 mV/g1.5g = 800 mV/g 2g = 600 mV/g2g = 600 mV/g 4g = 300 mV/g4g = 300 mV/g 6g = 200 mV/g6g = 200 mV/g
Sleep mode optionSleep mode option Sparkfun: $19.95Sparkfun: $19.95
MMA7260Q OrientationMMA7260Q Orientation
Testing The MMA7260QTesting The MMA7260Q
X-axis = verticalZ-axis = horizontal
X-axis = horizontalZ-axis = vertical
Atmel Atmega 168Atmel Atmega 168
8 bit MCU running at 16 MHZ with 8 bit MCU running at 16 MHZ with XTALXTAL
Serial Communication via UART, I2C, Serial Communication via UART, I2C, SPISPI
6 channel 10 bit Analog to Digital 6 channel 10 bit Analog to Digital ConverterConverter
3 Timers, 6 PWM channels3 Timers, 6 PWM channels Free C Compiler and Development Free C Compiler and Development
ToolsTools
Analog to Digital Analog to Digital ConversionConversion
Using highest possible Sampling Using highest possible Sampling Frequency 125kHzFrequency 125kHz
Approximate resolution is 4.9 mVApproximate resolution is 4.9 mV
The free running mode allows the The free running mode allows the control unit to continuously update control unit to continuously update the voltage received off the sensor the voltage received off the sensor and provide the user with a and provide the user with a measurable output of intensity. measurable output of intensity.
Development Development EnvironmentsEnvironments
AVR Studio is an Integrated Development AVR Studio is an Integrated Development Environment for writing, compiling, Environment for writing, compiling, simulating, and debuggingsimulating, and debugging
AVRDUDE is an open source utility to AVRDUDE is an open source utility to download/upload/manipulate the ROM download/upload/manipulate the ROM and EEPROM and EEPROM
AVRlibc and AVRlibAVRlibc and AVRlib
AVRlibc is the Standard C Library AVRlibc is the Standard C Library for AVR microcontrollers and for AVR microcontrollers and provides basic functions like printf, provides basic functions like printf, stdio calls, math functions, plus stdio calls, math functions, plus some AVR-specific functionssome AVR-specific functions
AVRLib provides functions for AVRLib provides functions for conventional tasks such as writing to conventional tasks such as writing to LCD’s and SD cardsand reading LCD’s and SD cardsand reading from buttons and encoders from buttons and encoders
Getting User Input – Getting User Input – Rotary EncoderRotary Encoder
3 Terminal Device to get sequential input3 Terminal Device to get sequential input 2 bit grey code provides 4 states for MCU 2 bit grey code provides 4 states for MCU
to readto read MCU must keep track of previous state.MCU must keep track of previous state. Debouncing via software delays or Debouncing via software delays or
hardware LPF’shardware LPF’s Triggering via Interrupts or PollingTriggering via Interrupts or Polling
Color LCD 128x128 Color LCD 128x128 Nokia Clone Nokia Clone
LCD Logic - 3.3V @ 2-3mALCD Logic - 3.3V @ 2-3mA LED Backlight - 7V @ 40-50mA (very bright)LED Backlight - 7V @ 40-50mA (very bright) Full 4,096 Color DisplayFull 4,096 Color Display Uses the Epson S1D15G10 or Philips PCF8833 Uses the Epson S1D15G10 or Philips PCF8833
Controller Controller Active Display Dimensions: 1.2"x1.2”Active Display Dimensions: 1.2"x1.2” Two-wire serial SPI interface (clock and data) Two-wire serial SPI interface (clock and data)
Setting the Processor Setting the Processor SpeedSpeed
The clock must be at a specific The clock must be at a specific frequency in order to set the correct frequency in order to set the correct sampling rate to sample data from sampling rate to sample data from the EMG sensor. The clock value the EMG sensor. The clock value was chosen to ensure the highest was chosen to ensure the highest sampling resolution possible that the sampling resolution possible that the Atmega 168 can support. Atmega 168 can support.
User InterfaceUser Interface
Wireless Interface - TXM-Wireless Interface - TXM-900900
SpecificationsSpecifications Operating voltage: 2.8–13 VDCOperating voltage: 2.8–13 VDC Supply current: 14-17 mASupply current: 14-17 mA Transmit frequency range: Transmit frequency range:
902.62-927.62 MHZ902.62-927.62 MHZ Data rate: 100-56,000 bpsData rate: 100-56,000 bps Operating temperature range: Operating temperature range:
-30 to 85C -30 to 85C
SIP Style Price: $29.45 from DigikeySIP Style Price: $29.45 from Digikey Part #: TXM-900-HP3-PPO-NDPart #: TXM-900-HP3-PPO-ND
SMD Style Price: $29.45 from SMD Style Price: $29.45 from DigikeyDigikey
Part #: TXM-900-HP3SPO-NDPart #: TXM-900-HP3SPO-ND
Wireless Interface - RXM-900-Wireless Interface - RXM-900-HP3-xxxHP3-xxx
SpecificationsSpecifications Operating voltage: 2.8–13 Operating voltage: 2.8–13
VDCVDC Supply current: 16-21 mASupply current: 16-21 mA Receive frequency range: Receive frequency range:
902.62-927.62 MHZ902.62-927.62 MHZ Data rate: 100-56,000 bpsData rate: 100-56,000 bps Operating temperature range: Operating temperature range:
-30 to 85C -30 to 85C
SIP Style Price: $43.40 from DigikeySIP Style Price: $43.40 from Digikey Part #: RXM-900-HP3-PPO_-NDPart #: RXM-900-HP3-PPO_-ND
SMD Style Price: $39.22 from SMD Style Price: $39.22 from DigikeyDigikey
Part #: RXM-900-HP3-SPO-NDPart #: RXM-900-HP3-SPO-ND
AntennaAntenna
JJB Series JJB Series The Electrical The Electrical
Specifications:Specifications: Center Freq. 916MHzCenter Freq. 916MHz Bandwidth 30MHzBandwidth 30MHz Wavelength 1/4-waveWavelength 1/4-wave Impedance 50 ohmsImpedance 50 ohms Connection Direct solderConnection Direct solder
Model: ANT-916-JJB-xxModel: ANT-916-JJB-xx
Price: $1.96 from DigikeyPrice: $1.96 from Digikey
AntennaAntenna
SP Series “The SP Series “The Splatch”Splatch” The Electrical The Electrical
Specifications:Specifications: Center Freq. 916MHzCenter Freq. 916MHz Bandwidth 30MHzBandwidth 30MHz Wavelength 1/4-waveWavelength 1/4-wave Impedance 50 ohmsImpedance 50 ohms Connection Surface-mountConnection Surface-mount
Model: ANT-916-SP Model: ANT-916-SP Price: $2.08 from DigikeyPrice: $2.08 from Digikey
SD CARD MODULEFor our data logging we based our design off of CC Dharmani’s “SD Card Interfacing with ATmega 8/32 (FAT32 implementation)” project.
The circuit design and open source files were carefully adapted to work with our Atmega328p.
We used his method of creating FAT32 files.
More info at: http://www.dharmanitech.com/2009/01/sd-card-interfacing-with-atmega8-fat32.html
SD MODULE cont..
This schematic shows the integration of the SD card module into our design.
The SD card module requires 3.3-3.6v in order to write data to the micro SD card.
Layout of PartsLayout of Parts Sensor UnitSensor Unit
Data from the Data from the accelerometer accelerometer and sensor units and sensor units are fed into the are fed into the ATmega328p ATmega328p MCU.MCU.
This data is This data is streamed to the streamed to the control unit via control unit via transmitter at transmitter at 9600bps.9600bps.
DATA
Layout of Parts Layout of Parts Control UnitControl Unit
Data will be received by Data will be received by the receiver and fed the receiver and fed into the ATmega328p into the ATmega328p MCU.MCU.
Data is then saved to Data is then saved to the SD card in the the SD card in the FAT32 file system FAT32 file system architecture. It will architecture. It will become a CSV file. become a CSV file. (Comma-separated (Comma-separated values)values)
The SD card can now be The SD card can now be removed from the removed from the device and read on a device and read on a computer .computer .
9V
10nF
On/Off
HP3RXM900
192021222324252627
282930313233343536
Splatch
1 2 3 4 5 6
1uF
AtmelAtmega
328
2918
462078
5321
22pF
22pF
2324252627281922303132129
1011121314151617
uSDSocket
12345678
CD1CD2D1D2
330 330
RotEnc
330
330
330
330
ISPProg
Reset
330Reset
Nokia Display
LP8345
DATA
DATA
CSV fileCSV file The CSV file saved on the SD card can be The CSV file saved on the SD card can be
opened and read.opened and read. The SD card will contain from each The SD card will contain from each
workout:workout: X-axisX-axis # of repetitions# of repetitions Z-axisZ-axis EMG signalEMG signal
Format: 126,0,200,5,Format: 126,0,200,5, 125,0,201,5, 125,0,201,5, .................... ....................
Used to keep track of the effectiveness of the Used to keep track of the effectiveness of the user’s workouts. user’s workouts.
CSV file (Excel)CSV file (Excel)
Opening the CSV file in Excel Graphing the data in Excel
0
50
100
150
200
250
300
1 3 5 7 9 11 13 15 17 19 21
Series1
Series2
Series3
Series4
It is up to the user how he/she would like to use the data. For example, the CSV file can be easily opened using Excel and a graph can be made using the values stored.
The columns are the X-Axis, Repetitions, Z-Axis and EKG signals respectively.
Power SystemPower SystemSensor CircuitSensor Circuit
RequirementsRequirements Generate sufficient electricity to keep the Generate sufficient electricity to keep the
unit running for 3 hours.unit running for 3 hours. Environmentally friendlyEnvironmentally friendly Length of chargeLength of charge Motivating factors: Availability, capacityMotivating factors: Availability, capacity
Power SystemPower SystemSensor CircuitSensor Circuit
Operating VoltagesOperating Voltages (1) MMA7260Q – 3.6V(1) MMA7260Q – 3.6V (1) Atmel ATmega328 – 3.6V(1) Atmel ATmega328 – 3.6V (1) TXM-900-HP3 – 3.6V(1) TXM-900-HP3 – 3.6V (2) INA122 Instrumentation amplifier – 3.6V(2) INA122 Instrumentation amplifier – 3.6V Total Power Consumed: 360mWTotal Power Consumed: 360mW CR2032 3V lithium button cell battery was used CR2032 3V lithium button cell battery was used
initially, but the accelerometer did not function initially, but the accelerometer did not function properly due to a dropout voltage across the properly due to a dropout voltage across the battery of 500mV.Minimum voltage for the battery of 500mV.Minimum voltage for the accelerometer is 2.7Vaccelerometer is 2.7V
Capacity: 225mAh. Radius=20mm ,height=3mmCapacity: 225mAh. Radius=20mm ,height=3mm
Power SystemPower SystemSensor CircuitSensor Circuit
Powered by a rechargeable 3.7V polymer Powered by a rechargeable 3.7V polymer lithium-ion battery. lithium-ion battery. Has a capacity of 650mAh.Has a capacity of 650mAh.
Sensor system Sensor system
Power SupplyPower Supply
Display moduleDisplay module Demands 340mADemands 340mA Total power consumption of 1.112 WTotal power consumption of 1.112 W Powered by the Ultra life 9V batteryPowered by the Ultra life 9V battery
Chemistry: LithiumChemistry: Lithium Capacity: 1.2 A*hCapacity: 1.2 A*h Can run the module for 4 hours before Can run the module for 4 hours before
replacement is needed.replacement is needed.
Display ModuleDisplay Module
Project TimelineProject Timeline
BudgetingBudgeting
Fully Fully funded by funded by the V.A.the V.A.
Questions?Questions?