Introduction: How to Make a Body Motion Detector for Healthcare Pupose
The body motion of a person can tell alot about him. In sleep, it can tell whether a person is in light sleep or deep sleep (Usually when you are in deep sleep you don't move at all and whereas in light sleep you move alot making you partner awake). In diseases such as parkinson and epilepsy, depending on the body movement, doctors can judge how effective is the medicinal dosage and continuous jerking of the legs helps in detecting symptoms of paralytic stroke.
I attended two workshops by Massachusetts Institute of Technology (MIT) and Indian Institute of Technology (IITB) at IITB. In both these workshops, I made a system which detected body motion using accelerometer and Arduino Uno for healthcare applications.
In my first workshop, I made a wearable glove for detecting parkinson tremors. The glove can be worn by the patient the whole day and the tremor data can be recorded by the glove on the cellphone. The data can further be sent to doctors for analysing and improving the dosage of the patients.
In my second workshop, I made a wearable button which can detect body motions so as to quantify whether a person is sleeping light or deep. This is my instructable on how I made a small button for detecting body motion. It has lot of benefits. So am sure anyone making this will definitely find it useful.
Step 1: Parts Required for the Project
Now this is just the first prototype I am going to make. So all these components are either brought online or from the electronics market.
First one is the TinyLilyPad Mini processor and TinyLilyPad Mini USB Adapter which I purchased it online (http://tiny-circuits.com/products/tinylily/) at this website for 20 dollars. Its one of the smallest available lilypads with the processing capability of Arduino Uno (ATMEGA328). The accelerometer ADXL335 I brought it from the market. Its a really good accelerometer because it was very sensitively able to measure the motion on 3-axis which was good enough for me.
The only components left were the single strand wires and the soldering iron from connecting the components together. At this point I didn't include any bluetooth device because I first wanted to test the concept and the science behind it.
Step 2: Connecting the Arduino Processor Board to the Accelerometer
The first step and I guess the most important step was to connect the processor board to the accelerometer. The pin connections were very easy to do. They can be given as follows :
XOUT, YOUT and ZOUT signify the acceleration in the x, y and z direction respectively.
Couple of things to keep in mind. Since you want to make the board as compact as possible, you want to cut the wires so that the board and the accelerometer are on top of each other as shown in the figure. Also while soldering, make sure that you use a small tip for the soldering iron since you want to avoid spreading of the solder to other pins since they are very close and it will difficult to remove them. Only use single strand wires since any other either might break easily such as multistrand or may be difficult to remove incase of errors.
Once soldering is done and the system works, just to make double sure that the wires don't come out, apply some good glue to keep the wires in place.
Step 3: Connecting the USB Interface Board to the Processor
Once the accelerometer and processor are connected, the next step is to connect the USB interface board. The processor board already has pins to connect to the USB board directly. However, depending on the form factor, you can remove the pins and connect using wires. For the current prototype wires were used for connecting the USB interface. Since there is no pin configuration given on the USB interface, it has to be carefully attached to the processor board.
Step 4: Uploading the Arduino Code
This is the first step on the software side of this instructable. The Arduino code is uploaded using the USB interface. The code is given as follows. The Arduino code takes the values of the acceleration in the x, y and z direction and displays on the screen.
Step 5: Matlab Code for Realtime Display of Data and Saving to .csv File
Once the system starts working and shows correct values in the serial monitor of Arduino, it is necessary to plot the data in realtime and save it to the file which can be later viewed by people for medical analysis. For the current instructable csv format will be used to save the data . The code is attached below. The image also shows the differentiation between motion and no motion.
Step 6: First Prototype
Once the hardware and the software pat is done, this is how the first prototype looks like. Though you still see the wires, hopefully in further iterations the prototype will become more compact and small. But the whole idea is still the same, TO MAKE SOMETHING WEARABLE TO DETECT BODY MOTION