Introduction: Fitness Motivator Device
We are engineering students who seek to be physically fit.
We know what it's like to have seemingly too much school work to get out and exercise. To take out two birds with one stone, we decided to use a final project in one of our engineering classes to take basic biosensor readings while exercising. More specifically, this project allows the user to take readings from an accelerometer (ACC) and electromyogram (EMG) while conveying output information to two LED's and a small digital display.
If you enjoy circuitry, Arduino, woodworking, coding, biomedical engineering, or soldering, this project may be for you!
See What You're Making
Before you get started on this project, please take a minute to see what you're making in the video above.
In essence, this project allows you to combine multiple facets of what you know. If you happen to be new to biomedical engineering (BME) or biosensors, no problem. There are two primary sensors that are used in this project. These sensors are an accelerometer and an electromyogram (EMG). As the name might suggest, an accelerometer is simply a sensor that measures acceleration. Less intuitively, an electromyogram measures electrical activity in the muscle to which its corresponding electrodes are attached. In this project, three surface gel bioelectrodes were used to from an electric lead that measured signals coming from the calf of the attached subject.
Materials and Tools
To construct this project, you're going to need the following:
- an Arduino Uno board (which can be purchased at https://www.arduino.cc/)
- a 9V battery power supply (which can be purchased at https://www.radioshack.com)
- a Bitalino plugged kit (which can be purchased at www.bitalino.com)
- an Adafruit 1.8" TFT display breakout and shield in addition to a half sized perma-protoboard (which can be purchased at www.adafruit.com)
- assorted jumper wires, LEDs, 220 Ohm resistors, solder, and flux (can be purchased at www.radioshack.com)
- 1/2" wood screws, 5/8" finishing nails, a 4"x4" piece of 28 gauge sheet steel, two small hinges, and a simple latch mechanism (can be purchased at www.lowes.com)
- five board feet of wood
- Note: Hardwood can be purchased at www.lowes.com, but we'd recommend finding a local sawyer and using wood from that person. The dimensions of wood used in this project are not amazingly common, so the odds of finding wood pre-cut to the necessary thickness dimensions are pretty slim.
- a soldering iron (which can be purchased from www.radioshack.com)
many woodworking tools, which are included in the photos above and listed here
- a miter saw (which can be purchased from www.lowes.com)
- a Shopsmith or equivalent table saw (which can be purchased at www.shopsmith.com)
- a thickness planer (which can be purchased at www.sears.com)
- a hammer, drill bits, a measuring tape, and a pencil (can be purchased at www.lowes.com)
- a cordless drill and battery (can be purchased at www.sears.com)
- a band saw (can be purchased from www.grizzly.com)
- a de-soldering iron (can be purchased from www.radioshack.com)
- a jointer planer (can be purchased from www.sears.com)
While this is not the most challenging instructable to undertake, it is not the simplest either. Prerequisite knowledge in coding, wiring circuits, soldering, and woodworking are necessary. Additionally, previous work with Arduino or Adafruit will be helpful.
A simple programming course or practical experience in the subject should suffice for the scope of this instructable.
Soldering and wiring circuits are best learned about by performing these actions. While a theoretical circuits course may be useful in technical understanding of circuits, it is of little use unless you built some circuits in it! While wiring, try to make the wiring as straightforward as possible. Avoid crossing wires or using longer wires than necessary, whenever possible. This will help you troubleshoot the circuit when it appears to be completed and does not work properly. When soldering, make sure you use enough flux to keep solder flowing where you want it to. Using too little flux will simply make the soldering process more frustrating than it needs to be. Nonetheless, do not use too much solder. When it comes to soldering, adding too much solder material generally does not help to make the soldered connection better. Rather, too much solder can make your connection look reasonable, even if it was made improperly.
Woodworking is a hands-on trade. It definitely takes some practice. Background in the material properties of wood helps, such as that provided in Wood by Eric Meier, especially if you're going to be doing more woodworking projects in the future. However, this is not required. Having watched a craftsman work wood or done some woodworking yourself should be ample background for this project. Knowing your way around a wood shop is essential too. Understanding what tools perform given functions will help you get the project done more quickly and safely than could be done otherwise.
- www.github.com; this site helps manipulate code
- www.adafruit.com; this site tells you how to wire the TFT screen
- www.fritzing.com; this site helps you draw and conceptualize circuits
Before proceeding, we need to talk about safety. Safety needs to remain first and foremost in doing instructables or nearly anything else in life, because if someone gets hurt, it isn't fun for anyone.
Even though this instructable incorporates biosensors, neither the parts or the assembled device are a medical device. They should not be used for medical purposes or handled as such.
This instructable involves the use of electricity, a soldering iron, and power tools. With negligence or lack of understanding, these things can become dangerous.
Electricity is required to power the Arduino, Adafruit display, and LEDs. It is supplied by a 9V battery. Generally speaking, when interacting with electricity, it is hard to be too safe.
Nonetheless, some useful electrical safety tips follow:
- Keep your hands dry and make sure the skin on them is unbroken.
- If a current must be passed through you, try to keep the points of entry and exit on the same extremity.
- Provide grounding means, circuit breakers, and fault interrupters for all circuits. These help to prevent overload of circuits or current leakage, if something goes wrong with the device or path of the electric.
- Do not use electrical devices during thunderstorms or in other cases where power surges have a higher incidence rate than normal.
- Do not submerge electrical devices or try to use them when in an aqueous environment.
- Modify circuits only when power is disconnected.
A soldering iron is an electrical device. Herein, all the safety precautions for electrical devices apply. However, the tip of the iron also becomes very hot. To avoid being burned, avoid contact with the tip of the iron. Hold the iron and solder in such ways that if one of the items slips from your grip, your hands will not contact the iron's tip.
Power tools also require electricity. Herein, abide by the electrical safety precautions shown above. Additionally, know that power tools have many moving parts. As such, keep your body and anything else you care about away from these parts when the tools are in use. Remember that the tool does not know what it is cutting or machining. As the operator, you are responsible for safe operation of power tools. Keep safety guards and shields in place while running power tools.
Hints and Tips
The following information could be useful throughout this instructable. Not every hint or tip applies to every step, but common sense should be a guide as to which hints and tips apply in each case.
- When wiring, wire color does not matter. However, it can be helpful to establish a color scheme and be consistent with it throughout your project. For example, using red wire for a positive supplied voltage in the circuit may be helpful.
- Bioelectrodes must be placed on a clean-shaven part of the body. Hair leads to excess noise and motion artifact in collected signals.
- Wires attached to the bioelectrodes must be prevented from moving more than necessary to avoid motion artifact. A compression sock or tape works well in securing these wires.
- Solder appropriately. Make sure each soldered connection is sufficient and check these connections if the circuit appears to be complete but is not functioning properly.
- When planing, plane pieces of material no less than six inches in length. Planing pieces less than this length can cause snipe, or excessive kickback of work pieces.
- Similarly, do not stand directly in front of the planer. Rather, stand next to it as work pieces are fed into and received from the planer.
- When using saws, make sure work pieces remain against the appropriate guards or fences. This helps to insure safe, accurate cutting.
- Provide pilot holes when fastening with screws or nails. The pilot bit should be a smaller diameter than the intended fastener, but no less than half of the fastener's diameter. This helps to avoid splitting and splintering of the wood being fastened by relieving excessive stress due to the presence of the fastener.
- If drilling pilot holes for nails, try to keep the pilot hole an eighth of an inch more shallow than the intended nail length. This helps to give the nail something to sink into and provides ample friction to help hold the nail in place when it is sunk.
- When hammering, drive straight onto the nail's head with the center of the head of the hammer. Take moderate swings as opposed to solely conservative swings, as conservative swings generally don't provide enough energy to drive the nail, but rather only supply enough energy to cause the nail to keel over and bend in unwanted ways.
- Use the claw of the hammer to remove nails that do not drive as intended.
- .Keep your hands clear of the line of cutting of saw blades. If something goes wrong, you don't want your hand to get cut.
- To save time, measure twice and cut once. Failing to do so will cause you to have to make some pieces more than once.
- Use sharp blades on the thickness planer and saws. On the saws, blades with higher tooth counts are good for providing a smooth cut near finish quality. In making this project, we used a 96 tooth 12" precision cut blade on the Dewalt double bevel miter saw and a blade with at least 6 teeth per linear inch on the band saw.
- Keep the Shopsmith's motor in the recommended speed range for table saw configuration. Make sure the table is adjusted to an appropriate height, exposing no more of the blade than necessary to make each cut.
Step 1: Let's Get Started!
Build the circuit component first. Begin by wiring power and ground to the perma-protoboard.
Step 2: Adding the Biosensors
Wire the biosensors onto the perma-protoboard and note which sensor is which. We used the signal on the left in the diagram as the accelerometer.
Step 3: Including LEDs
Next, add the LEDs. Keep in mind that direction of the LED does matter.
Step 4: Adding the Display
Add the digital display. Use the wiring given at this website to help: https://www.adafruit.com/product/358 .
Step 5: Coding Time
Since the circuit is now complete, upload code to it. The attached code is the code we used in completing this project. The picture is a sample of what the code should look like when opened properly. This is where troubleshooting can fully begin. If things are working properly, signals from the accelerometer are first read. If the signal is below threshold, the red LED turns on, the green LED remains unlit, and the display reads "Get up!". Meanwhile, if the accelerometer signal is above threshold, the red LED is turned off, the green LED is turned on, and the screen reads "Come on!". Additionally, an EMG signal is then read. If the EMG signal is above a set threshold, the digital display reads "Great job!" However, if the EMG signal is below threshold, the screen reads "Get going!". This is repeated over time, and the state of the LEDs and screen change as the inputs from the accelerometer and EMG so demand.The thresholds set for the accelerometer and EMG should be set based upon calibration with the particular subject at hand during states of resting and exercise.
To access this code in GitHub, please click HERE!
Step 6: Planing
Begin making the boxes to contain the circuit and battery.
Note that all of the drawings shown hereafter have dimensions specified in inches, unless marked otherwise.
Begin by planing the wood needed for the project down to proper thickness with the thickness planer. About three and a half board feet should be planed to 1/2" thickness. Half a board foot should be planed to 3/8" thickness. Another half a board foot should be planed to 1/4" thickness. The last half a board foot should be such that a u-channel forming the body of the battery box can be made as described in a later step.
Step 7: Bottom of Primary Box
Make the bottom of the primary box to the dimensions shown and fasten the circuit board and Arduino to it. Click on the image to reveal these dimensions.
Step 8: Ends of the Primary Box
Make the ends of the primary box to the dimensions shown and fasten them to the bottom of the primary box.
Step 9: Sides of the Primary Box- Sensor Side
Continue by making the sensor side of the primary box to the dimensions shown and attach it to the rest of the box with finishing nails.
Step 10: Sides of the Primary Box- Screen Side
Make the screen side of the primary box to the specified dimensions and attach it to the rest of the box.
Step 11: Check What You've Got
At this point, check to make sure the overall shape of the primary box is like that shown here, even if some of the dimensions must differ due to your choice of hardware or hardware placement.
Step 12: Top of the Primary Box
Make the top of the primary box as shown. Click the image shown to expand it to full size and see the associated dimensions.
Step 13: It All Hinges on This
Fasten the top of the primary box to the rest of the primary box using the hinge at the end with the LEDs. Make sure the top of the box is square with the rest of the box before attaching one of the small hinges.
Step 14: Latch It
Install a small latch on the front end of the box, at the end opposite the hinge. This prevents the primary box from opening except when needed.
Step 15: Buckle Up
To help make this device portable, bend the thin piece of sheet steel along one of its dimensions so that a belt can fit between it and the bottom of the primary box. After bending, attach it to the bottom of the primary box with wood screws.
Step 16: Base of the Battery Box
Now its time to make the battery box. Make the base of this box to the dimensions shown.
Step 17: Ends of the Battery Box
As we made the ends of the battery box, we used 3/8" material. Use the specified dimensions to make the ends and fasten them to the base of the battery box.
Step 18: Top of the Battery Box
We made the top of the battery box by cutting some 1/4" material to length with the miter saw and to the proper width using a band saw. To see the dimensions click on the image to expand it.
Step 19: Put the Lid on the Battery Box
Using the same procedure used to put the lid on the primary box, attach the lid of the battery box to the body of the battery box.
Step 20: Check the Battery Box
At this point, look over the battery box to make sure it looks somewhat like the image shown here. If it doesn't, now would be a great time to revisit some of the prior steps!
Step 21: Fasten the Battery Box to the Primary Box
Place the battery box on top of the primary box. Use wood screws or finishing nails to finish securing the battery box to the primary box.
Step 22: Further Ideas
If you've followed these steps, you did it! After implementing the hardware and software, we were able to use the device. In its current form, the device has limited application, but is still an interesting combination of different aspects of design. The outputs do everything we intended after receiving signals from the biosensor inputs. In all, the device weighs a few pounds.
In future renditions, it would be interesting to make the device weigh less and take up less space. If this were possible, the device would become more useful and could be worn more easily during exercise. To make this achievable, we recommend experimenting with using an Arduino micro and 3-D printing the boxes. To help save space, it would be good to experiment with using a rechargeable battery that takes up less space than a simple 9V battery. The size of the battery box could be decreased accordingly.