We were inspired by the ongoing debate about climate change and how we should approach it. According to the Union of Concerned Scientists, around 30% of global warming emissions in the US come from transportation alone. CO2 emissions from automobiles have increased, which worsens atmospheric conditions in our planet today.
What it does
Envroom enables users to enter in their car data based on the automobile’s make, model, and year. Upon determining these three pieces of data, Envroom utilizes the Fuel Economy API to get the fuel economy of the automobile. Then, the user can go back to the “Track” screen and start tracking when he/she is ready to go on a trip on that automobile. As the user travels, the total distance travelled is calculated in real time using CoreLocation. The total distance is converted to the amount of fuel spent using the fuel economy gained by the Fuel Economy API from the US Department of Energy. Afterward, the amount of fuel spent is presented in the home screen in real time and is converted to the number of lbs of CO2 emitted by the automobile during the trip, which is presented below the amount of fuel spent. A push notification will be sent to the user if the user exceeds the average automobile emission value in a day (approx. 27.78 lbs), cautioning the user to restrict his/her usage of the automobile. The data stops updating when the user presses “Stop Tracking” because not all movement takes place in a car (e.g. walking, biking, etc.). All data is reset once the day ends (at 12 AM).
How I built it
The National Highway Traffic Safety Administration API was used to extract an array of model names given the automobile’s make. We used the Fuel Economy API to extract the fuel economy of the automobile given the user’s make, model, and year. We then used SwiftyXMLParser to parse the output data written in XML. The total distance was calculated using an algorithm with CoreLocation. MapKit was used to allow the user to detect his/her movement during a trip.
Challenges I ran into
- Finding a valid data source to get the fuel economy of an automobile
- Parsing XML
- Getting the Push Notification to Work
Accomplishments that I'm proud of
For both of us, Los Altos Hacks III was our very first hackathon. We came into the hackathon knowing absolutely no one and we even had to go to the team mixer. However, we were able to overcome that obstacle and develop a meaningful sense of friendship that we never thought would ever exist before. Although the both of us had very different skill sets, we were able to create a very simple but decent app that has great potential to improve our environment.
What I learned
- National Highway Traffic Safety Administration API
- Fuel Economy API
- App Development Under Time Pressure
- XML Parsing
What's next for Envroom
- More accurate and comprehensive algorithm to calculate CO2 emissions per series of trips per day
- For more convenient user experience, have user take picture of automobile and create machine learning model to identify the make and model of the automobile
- SMS Support Using the Twilio API