This pedometer was created for a course for my engineering design minor. I made a pedometer because I myself was inspired by running in the morning and had a goal to maintain a specific speed. with this device, I hope to have a way to do this myself and explore what design works best for this. I run in the morning and work to maintain a speed of 7.5 miles per hour. For this project, I would like to have the device work for walking speeds in steps per minute. It can calculate an average and instantaneous rate of steps taken. The concrete goal was to display average steps per minute speed and to have the user be able to set a goal speed to which the pedometer compares to see if the speed goal is met.
Video LinkLink here
DeviceThe finished device has four buttons for the user interface. A buzzer is used to alert the user when they are deviating from the speed desired. A 3.2" Addifruit SPI LCD screen to display the device. A Pedometer 3 click sensor which takes all the data for the device. The Device itself relies on the 1 GHz pocket beagle board which is responsible for all of the processing power.
The four buttons are as follows:
- Green button, pin "P2_4" - This button resets the Goal walking speed in steps per minute to 60 steps per minute,
- Yellow button, pin "P2_6" This button resets the time on the pedemeter, resets the average speed on the pedometer as well as the steps used for the average speed which are the cycle steps
- Blue button, pin "P2_2" - This button increases the step goal rate by 20 steps
- Red button, pin "P2_3" - This button decreases the step goal rate by 10 steps
The buttons have a pull up resistor valued at 1k ohms. This means a low value is when the button is pressed and therefore on. The opposite is true. In the python code I use the AdafruitBBIO.GPIO Library and use input() to get value of the button.
Screen configurationThe SPI screen is connected to pins from P_25, P_26, P_27, P_28, P_29, P_30, P_31. Then after plunging into the device. Connect the pocket beagle to the internet and install the following:
▪ sudo apt-get update▪ sudo pip3 install --upgrade Pillow▪ sudo pip3 install adafruit-circuitpython-busdevice▪ sudo pip3 install adafruit-circuitpython-rgb-display▪ sudo apt-get install ttf-dejavu -y
This will allow the screen to run with the python code. The code used in pedometer.py was made from the same template from the addifruit website (linked in the code).
The pocket beagle installation is the same that comes from https://www.hackster.io/170850/standalone-pedometer-pocketbeagle-mikro-click-boards-d14d93
The difference being that there is no need to install anything that deals with the O Click display. This mainly has to do with their steps 5 and 6, do not uncomment the lines that deal with click display. This will make your pins in position 2 unuseable.
Connect the Pocket beagle to the internet and install the following
- sudo apt-get update
- sudo apt-get install fbi
- sudo apt-get install python3.5-dev
- sudo apt-get install python3-pip
- sudo pip3 install Adafruit-GPIO
- sudo pip3 install --upgrade setuptools
- sudo apt-get install libfreetype6-dev
- sudo pip3 --no-cache-dir install pillow
Once all is installed, including all the needed libraries, and code is installed in the pocket beagle. cd into the pedometer file which holds all the code files and run
sudo crontab -e
Then
@reboot sleep 15 && sh /var/lib/cloud9/pedometer/run.sh >/var/lib/cloud9/pedometer/logs/cronlog 2>&1
and then reboot
This makes the pedometer autorun and the pocket beagle is good to go!
The biggest challenges to this project were in getting the data from the pedometer to work properly. For future iterations, I would say the pedometer code dealing with reading data from the sensor could be altered. The pedometer sensor lags and it takes 10 steps before it updates.
For future plans, the project needs to be streamlined and become wearable for use. This includes making sure the pedometer doesn't get damaged while in use in running. The overall project is a success and can accurately measure an average step count rate.
Comments
Please log in or sign up to comment.