Next project
Outreach Initiatives and Community Awareness


See Your Workout: Design a Pedometer for Measuring Distance, Velocity and Acceleration of a Person in Motion.

Objective

The objective of this hands-on lab is to teach a beginner Engineering student the applications of fundamental physical science and engineering theory through the design and development of a simple pedometer. This is achieved through a step-by-step instructions on how to design a pressure sensor from basic materials, and use an Arduino board for logging motion data that will be analyzed and plotted using a Python program.

Usage of Arduino is beneficial to the student due to it having an open sourced hardware architecture that has more inexpensive versions from quality manufacturers available at vendors with websites:

Arduino eases the creation of lab exercises for design engineering education or engineering outreach activities. Thus, large groups of students can make feature saturated and detailed projects at levels of sophistication at beginner levels unparallelled before.

In addition, having memorable moments of "eureka" during such lab exercises will spark interest in the student for personal exploration of more advanced engineering topics. Freshmen year, being the transition year for many students makes it ideal for them to spend more time on hands-on learning that inculcates in them a curious and enduring personality capable of networking with friends and charting out goals for self-directed learning.

Most freshmen engineering students will benefit from the hands-on DIY or Make It Yourself labs to learn about:

  • engineering design principles
  • project management experience
  • problem-based learning of theory
  • practice with technical solution tools, i.e. programming, hardware platforms
  • report writing and engineering communications
  • business decision before product commercialization
  • case studies of existing engineered artifacts

These labs consist of exercises to understand and recreate mainstream patented or commercialized technology at market through the process of their reverse engineering for academic purposes.

Description

This project explored to use an arduino ($8.5 from fasttech.com), elementary circuit components ($1 or less worth of all components), basic soldering ($20 soldering iron) to make a shoe "add on" product. It is comprised entirely of DIY modules - pressure sensor, speaker, step logger. These modules enable the user to do data acquisition on their motion of walk, run, or jumps. DIY software on pc/mac/linux collects the data from arduino via usb and yields a sensor data file. Analysis like visualization, determination of physical quantities like total elapsed time, distance travelled, speed and acceleration, comparisons against existing motion patterns of athletes are conducted through the software UI (provided by creators of the lab, Michael and Ami).

After the shoe "add-on" is completed, and data collection files are transferred from the shoe to be stored on students' computer/laptop, the software will help educate students practically learn about what type of problems rely on physics of 2 D Kinematics and Vectors. Students will discover answers to specific questions, for instance:

"Eg.1: Why is school team losing at sprint race?"

"Eg.2: What exercise training best fits defender from striker in soccer?"

"Eg.3: How can a diabetes patient maintain a constant pace of walk?"

And, they will understand how engineering work flow occurs in the industry as they brainstorm and write proposals on ways to contribute to existing engineered solution:

"Eg.1: Why make alternatives to marketed pedometers, i.e. Nike+ ?"

"Eg.2: How to make them better?"

Resources

The student must check through all of the following materials. Missing components can be ordered from the aforementioned websites, i.e. dx.com or fasttech.com or other website that gives you an inexpensive deal on your component/parts list. The students needs;

  1. Laptop or any computer
  2. Computer with free operating system of Linux Ubuntu or Linux Mint
  3. 1 arduino uno & usb cable
  4. 1 pair of running shoes
  5. 5 AA new or charged batteries
  6. breadboard (not bread! It has many perforations)
  7. 1 speaker
  8. 1 PNP transistor
  9. 2 capacitors
  10. 3 resistors
  11. 1 transformer
  12. anti-static, non-conductive foam
  13. solder station with solder iron, solder, flux in your lab's station"1"
  14. tape, multimeter, measuring tape, cutting tools in lab's station "2"
  15. packet of connecting wires - has different sizes, colours

Method

Before beginning read all the steps hereforth. Take some time to visualize the path the workflow below takes toward making the final Pedometer, start each step until the end. Pay close attention to the figures and diagrams.

Step 1: Making the speaker beep!

Build an DC to AC pulse generator for operating the speaker on the shoe. Wire together the components as shown in Figure 1.

Figure 1: DC to AC module using components of the checklist

Make the DC to AC module for the speaker, with the labelled components. It does look intimidating, but remember that it use knowledge of grade 12 Physics Electricity. You should feel comfortable!

Quick review of concepts:

Flow of electrons is current. Current by convention in math and physics analysis flows from positive end to negative. It is like a vector pointing positive end to negative end. However, in reality current flows from negative end to positive end - the reason this discrepancy exists [and still persists] is because of a mistake my group of physicists in the 17th century, for real!

Speaker included gives you sound corresponding to a certain pitch, or frequency. f = 1 / T. The smaller the wave period, the smaller the period, T. This gives a higher frequency. This speaker can give sounds of many different frequencies. The schematic given to you gives a sound frequency between 200 Hz and 300 Hz. Too low would be inaudible, and too high will be annoying. Because it is not a piezo speaker (those that just buzz a sound as long it receives a current), but a real multi-freq speaker, it needs to receive a waveform that has oscillations or that alternates. Figure 2 shows you the difference between DC and AC waveforms.

Figure 2: (a) AC Signals are continuous values, (b) Digital Signals are "on" or "off"

Step 2: Circuitry in between pressure sensor and speaker

Complete this "DC to AC module now" under 20 minutes using the breadboard. The speaker will emit sound only when it is "on". Use "Pressure Sensor module" to switch the circuit on - complete the circuit so that current flows through it.

Step 3: Build the pressure sensor

"Pressure Sensor module" is a piece of anti-static foam (these are like bubble wrap for Integrated Circuit components, used in shipping static sensitive components) that serves as a reliable, fairly long term usable re-compressible and "bouncy even after many presses-type" material. Your anti-static foam is fairly thick. Because every time you walk, your sole and toes exert maximum pressure on the shoe, you want to place this material below your sole. End goal you are aiming for: every step you take, turns the "DC to AC" module on. Arduino will record how many times it "felt" on against time (more on this below).

At the moment, the foam is too thick. Even if you put it below your feet and step, you will not be able to compress the the foam enough to have the two opposing, criss crossed wires touch and complete the switch. Please use the knife at station "2" and Figure 3 to split the foam in thinner slices.

Figure 3: (a) Use scissors to cut the foam into half (b) repeat process to thin it

Follow Figure 4 to tape wires, opposite to each other. Test whether sensor completes the circuit once you sole steps on it. The multimeter will register a signal (voltage reading). Ensure the multimeter is set to "DC Volt Reading". If no reading is registered, the wires are not touching. Make your foam a twine thinner, or place the criss crossed wires near anywhere on your foam with thinner and more "porous" areas. Try again until you reach success.

Figure 4: Tape the two opposing wires above and below the anti-static foam

Step 4: Step and get a beep!

Follow Figure 1 and connect "Pressure Sensor" module to "DC to AC" module. Now connect the speakers. Use the breadboard for rapidness.

Figure 5: The shoe with the DC to AC components soldered after testing on breadboard

In the last 1:30 hours of the lab, you begin to solder the connections as Figure 5 shows.

Step on the Pressure Sensor. If you hear a beep perfect! If not, go to your TA.

Step 5: Solder what you have

All is working. This is good news - congratulation! Follow the connections you have made via the breadboard. Take out each wire and solder them. Notice how ugly they look like when the all the wirings are soldered - this is why A. Circuit schematics and B. PCB (printed circuit board) was invented to minimize wiring overhead and confusion in drafting and manufacturing.

Step 6: Put it on your shoe

Figure 6 shows you how to integrate all your work with your team of two's running shoes. You brought 2 shoes, select the left or the right pair. Once you selected, tape the sensor to the sole. Tape the battery pack to the side, tape the DC to AC module on the other side - put it in a ziplock bag to prevent short circuiting!


Figure 6: All the modules are tapes to the shoe - power pack on left, arduino above my hand (not shown), speaker behind, AC to DC on right.

Carefully wear both the shoes. Now go on a fun stroll outside the lab, walk naturally, then run. Every time your feet in shoe with sensor steps, you should hear a beep!

If you face problems, go to your TA ASAP.

Arduino, being a microcontroller, will easily record your steps after you upload the program module to it. Go to bit.ly/uoitpedometer then, download pedometer-programs folder.

Enter the folder. Right click "pedometer.ino". Select open with Arduino IDE. Click the check button to compile. If there are errors in the program, the IDE (integrated development environment) of Arduino will show you error messages. There are supposed to be none because the lab creators are infallible (just kidding!). Next, press the right arrow button - this uploads the compiled executable code to the atmel microprocessor in the arduino. The program in human language says, "Every Time you step on the sensor, current feed to me [Arduino] is interrupted, and I record that as a step at the time stamp since the clock first began with your first step on the sensor."

Step 8: Collect Test Data

Now put the shoe on the table. Unsolder the plus and minus ends of DC to AC module. Put the negative end to any GND (ground pin), and the positive end to the GPIO (general purpose input/output) pin 13 of the Arduino. Solder new set of wires to the positive and negative ends of the battery pack. Connect the positive end of battery to GPIO 13 and the negative end to GND (ground pin).

Ensure that you have uploaded the arduino "processing or like-c" programming language code to your arduino. There will be an LED on the arduino that will blink. This means that it has received your program. Now press CTRL ALT T together. This will open the terminal emulator on your window. cd to the directory containing your programs. run command ls -lah . See the python script desktop_client_3.py ? You have to open it using python ... before you disconnect the arduino from the computer for logging your motion data on to the Arduino. Run command python desktop_client_3.py . On your Linux system, you will see a window open. It looks like Figure 8. Type the character r and pass it to the program. It will stop the blink of the arduino. Now wear the shoe carefully - be careful not to press the sensor! Once you wear it, go to ther start line.

Join the relay race downstairs if you checked "competing" check box at the beginning of the lab. It involves walking and then running. Once you complete your competition, it is time to find the team with the "most steady", "fastest". If you didn't partake in the "competing", then go to DRY-LAB EXAMPLE, and do the hw exercises.

Programming Tasks

Get all pre-written programs for you in the source-codefolder

To accelerate a beginner to programming, the choice of language to do all controls and data logging on the arduino is processing - a language similar in syntax to C, used for the default Arduino compiler in Arduino IDE. Furthermore, data processing is made visually appealing with a GUI for the beginner student using Tk interface library of Python. All data processing i/o is conducted on the students computer via pre-written python modules, provided to the student by the creators of the lab exercise.

To install these tools on the computer, follow the through the following steps:

FIRST

Open terminal and type

sudo apt-get install arduino

This downloads the package from the Ubuntu/Linux mint software repository Arduino's official IDE. Arduino IDE, as shown in Figure 6 comes with the programming language "C-like Processing" and its "Compiler".

SECOND

Connect the arduino to the laptop. Upload pedometer-logger.ino to the Arduino using Arduino's IDE. Open the desktop client through Terminal

python desktop_client_3.py

Type

r

then Press "Fix Arduino" button.

Passing any random character makes the Arduino stop beeping interminttently. Now the first pressure on the sensor will start it's clock. After shoe is put on, every time you step, a voltage signal reaches Digital Pin 13. It is sampled many times a second, and when it does encounter a voltage signal above 0.4 Volts or 400 mV (milli Volts) it will register it as a step. Hence, the state of Pin 13 is just on or off - hence is is called Digital.

Figure 7: Arudino IDE new sketch (a code document)

The Arduino IDE has other tools to upload the code, to type highlighting, import code from existing "sketches".

Python is a scripting language , most noted for it's ease of use. It is used by Intel, Google, Apple, Android, Siemens and other big mechatronics, software and hardware developers. No install needed.

Open Terminal or use the existing terminal window. Type

python

You will see python loaded.

Since you are not programming within the lab [by expectation], you have to use python to open the GUI window for collecting the data from your Shoe strapped with the Pedometer modules.

Example Data

After you have completed your motion through the relay race or as attempts to answers to questions above in heading EXERCISE QUESTIONS, you will re-connect Arduino to computer. Once you connect, you might see an older graph from past runs - ignore it. Click "Download", as shown in Figure 8. It will transfer all the "ons" and "offs" against time to the python file behind the scenes. Once download completes (takes few seconds) it will show you the graph of your distance vs. time. Click Save Data Log, to save a .txt (text) or .csv (comma separated value) file for personal reference of your motion data - try to use them in excel spreadsheet or the like on your own time!

Figure 8: The python GUI allowing you to initialize and collect end data from shoe's arduino

In-Lab Exercises

The lab comprises of, first and foremost, building all the modules for the DIY Pedometer, second, collecting motion data, and lastly, analyzing these data for solving problems. Example problems with a hypothetical workflow for the student to solve them are listed below:

"Eg.1: Why is a school team losing at sprint race?"

From the folder you downloaded before, open through the terminal using python trackteam-losers.py

This gives you the graph and tables for 3 school teams. One team has been consistently losing the race. Your task is to suggest how can your data (on your 1 min walk / run around the floor of your lab) or your shoe product can be utilized to help the loosing team diagnose.

"Eg.2: What exercise training best fits defender from striker in soccer?"

From the folder downloaded before, open through the terminal using python lionel-messi-and-all.py

This gives you the graph and tables for soccer world's top-rated two strikers - Lionel Messi, Wayne Rooney - and two defenders - Gerard Pique, Phillip Lahm - acceleration and speed when they are on the hunt for getting a goal or preventing a goal in soccer. How could you train soccer defenders and strikers for Team UOIT by giving them analytics on their data?

"Eg.3: How can diabetes patient maintain constant walk pace?"

Diabetes patients have insulin deficiency - they have difficulty in catabolizing (breaking down) sugar (glucose) in blood stream. If body naturally can't consume glucose, other alternatives must be pursued. These include, eating fibrous food that gives "hunger satiation" with less sugar, taking insulin injections every day, exercising at fixed exertions. There is no tool at the market that will help (A.) reward diabetes patients on the distance, constant speeds they have walked at on previous days (B.) track their speed in real time and give them feedback in realtime while walking.

Imperative Areas in Need of Improvement

The lab is highly hands-on and discounts education for student in fundamental theory of microcontrollers, embedded systems, and programming. Perhaps, the lab exercises can be seen as inspirational activities for beginners - aimed to open the beginner for further education in Software, Communications, Electronics, Controls.

The targeted audience is predominantly grade 10 to 12 students. A technical pocketbook or theory guide should be published that will bridge the student from this lab to the consecutive one that will require the student to write the data processing python modules, GUI interfaces, code to control the arduino, design an alternate circuit that indicates pressure instead of a beeping speaker.

This consecutive lab could have an advanced-track option for participants. This option would require the student to learn from the published manual about GPS locating, communication protocols. These theory would be implemented using communications hardware kits for the arduino. Extension of the current project in the consecutive lab would give additional data on the moving persons' or athletes' direction of motion in 3D space at a physical location, i.e. a soccer field, and display it using a GUI on a television or any other imaged based display system.

Further Readings

To have a deepened knowledge in Athletic Metrics Instrumentationyou should first gain a "knowledge scaffold and learning directions" of powerful math, science, computer technologies and engineering. Learn more as a student or teacher from free schools:

Once you are confident, please Search with keywords "Athletics Uses of Electronics", "Sports Electronics", "Sports Computer Aided Performance Analysis" at UOIT Library or Open Textbooks and Open Encyclopediae:

download course code  Download Source Code (477.76 KB)
Other Projects
Professional Circuit Drafting
Professional Circuit Drafting CAD drawing gives you professional grade circuit schematics and prototype models. Learn to communicate design of electronics and hardware innovation like the professional engineer. Continue >>
Knock to Ring Bell
Knock to Ring Bell Make a complete musical bell system that rings with your knock. Possibly, this may reduce door banging or frustration at dormitory doors that aren't allowed to have buttoned door bells, yikes! Continue >>
Raspberry Pi Tweet to my Door Raspberry Pi Tweet to my Door Raspberry Pi connected to colour display wirelessly. Show your twitter updates on a screen attached to your door at school's club office, classroom, treehouse room. Display to your audience your... Continue >>
Self-Driving Car
Self-Driving Car Robots are smart. Here you transform your old toy car or another vehicle into a bot that follows a wavy line. Use it for shipping goods between unmanned travel ports. Real world uses are endless. Continue >>
Optical Network Made Easy
Optical Network Made Easy Optical communication is fast, cheap, and reliable. Build your own prototype of a peer-to-peer network using laser. Understand how big Rogers, Bell and use Fibre to connect you in lightning speed to... Continue >>
Broadcast Your Radio
Broadcast Your Radio Broadcast your music and voice wirelessly. Spread your news with your friends over short distance using radio. It is easy to make, free, and won't get CRT angry at you. Radio podcasts, chatroom uses... Continue >>
Networked Thermometer
Networked Thermometer Thermometers are old. They are useful: superb tool to control experiments in science labs, monitor body heat, get weather data, save devices from overheating as your flat screen tv, and car engines. Continue >>
Internet Controlled Lights
Internet Controlled Lights Use internet to make lighting during Christmas or other occasions dance! Surprise your buddies with LED sequence control. Make decoration energetic during your sweet holidays. Continue >>
Arduino Tweets to my Door Arduino Tweets to my Door Arduino connected through wire to display. Show your twitter updates on a screen attached to your door at school's club office, classroom, treehouse room. Display to your audience your location at the... Continue >>
Arduino Lilypad Remote Mouse
Arduino Lilypad Remote Mouse Control your computer's mouse with this homemade remote-control. Build touch switches completely in software and then link the remote to the computer via infrared. Continue >>
Gesture Pong Game
Gesture Pong Game Build your own motion tracked game and console similar to Kinect or Wii. Inside is code and design helping you make the classic Pong Game. Play the game as you move on your tv or monitor. See step by... Continue >>
Paper Music Player Tutorial
Paper Music Player Tutorial Play music from paper as if the paper was an "ipod". You build a system that senses capacitive touch on pencil shaded shapes on paper. With these touches music is controlled. Continue >>

Maintained by Qusay H. Mahmoud
Content Contributors: Rudy Lang, Michael Lescisin, Rahma Mahmood, Ahmad Shamshiri, Ahmad Touseef, Mirna Zohiry