Difference between revisions of "BOARDLOCK project"

From ESE205 Wiki
Jump to navigation Jump to search
Line 46: Line 46:
 
*This required us to learn a bit of HTML and how the static maps part of google maps API worked. One way to use google maps API is by creating a webpage and calling the google maps API in the HTML script. So we began writing this file strictly in HTML/Javascript, but we soon came to find out that it would be really difficult to pull data from my local drive (the flash drive on the mac which has data written from pi) using strictly HTML. HTML/Javascript doesn’t allow you to simply call a path to a file on your computer to a local drive. So we decided to use python, although we were not really sure how we were going to do this. We stumbled upon a video on youtube of a man writing to an html file from python. This gave us the idea to create a string in python, which would be all the code included the HTML file. In the python script we would append to the end of the string all the parts of the HTML file which needed to call to a CSV file stored in the usb flash drive. This included the information which would be used to create the lines (of different sizes and colors) which displays a heat map of the trip traveled on the raspberry pi.
 
*This required us to learn a bit of HTML and how the static maps part of google maps API worked. One way to use google maps API is by creating a webpage and calling the google maps API in the HTML script. So we began writing this file strictly in HTML/Javascript, but we soon came to find out that it would be really difficult to pull data from my local drive (the flash drive on the mac which has data written from pi) using strictly HTML. HTML/Javascript doesn’t allow you to simply call a path to a file on your computer to a local drive. So we decided to use python, although we were not really sure how we were going to do this. We stumbled upon a video on youtube of a man writing to an html file from python. This gave us the idea to create a string in python, which would be all the code included the HTML file. In the python script we would append to the end of the string all the parts of the HTML file which needed to call to a CSV file stored in the usb flash drive. This included the information which would be used to create the lines (of different sizes and colors) which displays a heat map of the trip traveled on the raspberry pi.
  
===Pivot in our project:===
+
===Pivot in our project===
 
We lost access to our electric longboard, which was also going to use an ESC to lock the board's wheels along with powering the raspberry pi. This meant that we needed to figure out a way to carry out this project in a different direction. We decided to stop trying to lock board's wheels and using an electric longboard. Instead we used a regular, unmotorized skateboard which would be used to mount the pi and in addition, an accelerometer. We would instead power the pi using a portable battery.
 
We lost access to our electric longboard, which was also going to use an ESC to lock the board's wheels along with powering the raspberry pi. This meant that we needed to figure out a way to carry out this project in a different direction. We decided to stop trying to lock board's wheels and using an electric longboard. Instead we used a regular, unmotorized skateboard which would be used to mount the pi and in addition, an accelerometer. We would instead power the pi using a portable battery.
 +
 +
===Other Challenges===
 +
Some other challenges we faced include initially testing our GPS:
 +
*We tested the GPS a lot and didn’t get many results until Jim suggested we solder the connections of my GPS. After this we started getting some sort of data, but nothing useful in the basement. We went to a place in Jolley which had windows. The GPS finally worked when we put it up against a window. After this we started testing some code that we found from a pi-GPS tutorial on youtube. This code would use the information sent by the GPS and decode it in an orderly fashion, listing coordinates, speed and other useful data that the GPS collected
 +
*We got our GPS program work, but it was still hard to program other things when our GPS had to be actively collecting data in order for us to know if our program was working. It became easier to test our project once we installed our LED pushbutton which would let you know if the program was running and would only start collecting data once pushed.
 +
and accessing the USB flash drive when program is started through cron tab:
 +
*When we first started testing the program on boot of the pi, the pi was booting and starting our program before it realized that there was a mounted USB flashdrive. This caused our program to not work at all, since we needed to access the data stored in the USB flash drive. In order to solve this problem we placed a 15 second sleep() call before the program called the USB flash drive.
  
 
==Gantt Chart==
 
==Gantt Chart==

Revision as of 02:58, 11 December 2018


Project Overview

Tired of your run-of-the-mill skateboard? Looking to upgrade it to the next level? We present to you BOARDTRACK: a slick skateboard equipped with a battery-powered Raspberry Pi, GPS chip, and accelerometer attached to its underside. Why? We're glad you asked... these small gadgets provide BOARDTRACK with the the capacity for user-friendly tracking of its location, acceleration, and average speed. Once collected, this data is displayed onto a monitor. But wait, there's more -- each display is unique to every trip, enabling you to access how far you have traveled, your speed at any location, and the highest overall acceleration reached. In this project, our team aims to manufacture a unique transportation method of utmost quality, aesthetics, and convenience.

Weekly Log

https://classes.engineering.wustl.edu/ese205/core/index.php?title=BOARDLOCK

Team Members

  • Amin Bdeir
  • Isabella Zisman
  • TA: Sam Hoff

Objectives

Old Objectives:

  1. Attach ESC to Raspberry pi
  2. Be able to lock board's wheels
  3. Use raspberry pi bluetooth capabilities to lock board wheel from cellphone

New Objectives:

  1. Attach a 3D-printed box to the underside of our Skateboard's deck, containing a portable battery-powered Raspberry Pi, GPS Chip, Accelerometer, and a LED pushbutton
  2. Set up Raspberry Pi
  3. Learning how the Raspberry pi and Python works
  4. Understand how GPS technology works
  5. Get GPS and Accelerometer to send data to Raspberry pi
  6. Program button so that we can begin and end pi program
  7. Program a Python Script which writes an HTML file which displays a heat map of route traveled

Challenges

We anticipated our challenges to mainly be using unfamiliar technology to all group members, including programming in python, the raspberry pi, accelerometer and GPS. In addition to these being new to us, we knew that we also were going to have trouble testing the GPS, especially if we were inside. The GPS specifically caused the most trouble, and was hardest thing to deal with in our project.

New Skills

Programming in python:

We learned how to program a python script to read data from a GPS chip and an accelerometer and write it to a USB flash drive.

  • This required us to research online and find resources which would help us read this data. We were able to find tutorials which taught us how to call our accelerometer. Originally we were not able to set it up, but the drivers we were directed to made it easy to collect the data it was sending. We also found a youtube video which taught us how to set up our GPS, and linked us to a github which had code to a program which decoded the GPS data into coordinates, speed and other useful information. Using these resources we were easily able to write useful information sent from the Accelerometer and GPS to pi onto our USB flash drive.

We struggled for a bit trying to figure out the best way to display all of this data that we were able to collect. It seemed pretty complicated, especially since we wanted to incorporate the accelerometer into it as well. The only way to display data from an accelerometer/ speed from the GPS with specific coordinate points is if we could color each point, or edit it in some way to differentiate each coordinate point so you could tell how fast you were going at that point in time. We researched about this and decided to program a script which would call google maps API in an HTML webpage. Google maps API is the simplest way to plot data with different shapes of different sizes and colors.

  • This required us to learn a bit of HTML and how the static maps part of google maps API worked. One way to use google maps API is by creating a webpage and calling the google maps API in the HTML script. So we began writing this file strictly in HTML/Javascript, but we soon came to find out that it would be really difficult to pull data from my local drive (the flash drive on the mac which has data written from pi) using strictly HTML. HTML/Javascript doesn’t allow you to simply call a path to a file on your computer to a local drive. So we decided to use python, although we were not really sure how we were going to do this. We stumbled upon a video on youtube of a man writing to an html file from python. This gave us the idea to create a string in python, which would be all the code included the HTML file. In the python script we would append to the end of the string all the parts of the HTML file which needed to call to a CSV file stored in the usb flash drive. This included the information which would be used to create the lines (of different sizes and colors) which displays a heat map of the trip traveled on the raspberry pi.

Pivot in our project

We lost access to our electric longboard, which was also going to use an ESC to lock the board's wheels along with powering the raspberry pi. This meant that we needed to figure out a way to carry out this project in a different direction. We decided to stop trying to lock board's wheels and using an electric longboard. Instead we used a regular, unmotorized skateboard which would be used to mount the pi and in addition, an accelerometer. We would instead power the pi using a portable battery.

Other Challenges

Some other challenges we faced include initially testing our GPS:

  • We tested the GPS a lot and didn’t get many results until Jim suggested we solder the connections of my GPS. After this we started getting some sort of data, but nothing useful in the basement. We went to a place in Jolley which had windows. The GPS finally worked when we put it up against a window. After this we started testing some code that we found from a pi-GPS tutorial on youtube. This code would use the information sent by the GPS and decode it in an orderly fashion, listing coordinates, speed and other useful data that the GPS collected
  • We got our GPS program work, but it was still hard to program other things when our GPS had to be actively collecting data in order for us to know if our program was working. It became easier to test our project once we installed our LED pushbutton which would let you know if the program was running and would only start collecting data once pushed.

and accessing the USB flash drive when program is started through cron tab:

  • When we first started testing the program on boot of the pi, the pi was booting and starting our program before it realized that there was a mounted USB flashdrive. This caused our program to not work at all, since we needed to access the data stored in the USB flash drive. In order to solve this problem we placed a 15 second sleep() call before the program called the USB flash drive.

Gantt Chart

https://classes.engineering.wustl.edu/ese205/core/images/7/7d/Ganttchartt.pdf

Presentation Slides

https://docs.google.com/presentation/d/1R9UPc2ogxPKON9jxLcB9qWECYStB06nGXCuJ_GoqvfU/edit?usp=sharing

Night Light design

https://drive.google.com/open?id=14BxDPPlyi2YZkdFCk_n2jNiYaWCCQbUU

Budget

Anker PowerCore 10000 $25.49

Adafruit 16mm Illuminated Pushbutton - Blue Momentary [ADA1477] $6.09

SunFounder MPU6050 Module for Arduino and Raspberry Pi, 3-axis Gyroscope and 3-axis Accelerator $11.99

Adafruit Ultimate GPS Breakout - 66 channel w/10 Hz updates - Version 3 $39.99

Raspberry pi 3B

Total: $83.56

Final Report

Designs and Solutions

Programming:

How to project GPS data onto Google Maps API? Hyperlink created

How to project Accelerometer data onto graph? X, Y, Z coordinates

How to program button to start/stop collecting data? LED light

How to extract data? Stored on USB flash drive


Wiring Connections:

F-F Configuration / Pins

Battery → Pi → button → GPS chip → Accelerometer → USB → monitor


Virtually every aspect of this project was learned from scratch...

How to:

  • Parse/interpret/project data from GPS chip and Accelerometer
  • Based on data collection, program button to respond accordingly


Results

On Demo Day, our team successfully met our goals, though not to the extent we originally envisioned.


Source Code and CAD files

3-D printed box:

Repository: