Inspiration

In the past, I wanted to recycle more, but I'm very forgetful, so it would always slip my mind. I thought that a good way to address this problem would be to turn recycling into a game. This way, recycling stays at the back of your mind because you're trying to increase your stats.

Tracking Count

I thought tracking one stat well would be better than tracking many poorly, so I decided to just track the number of items recorded at first. It seemed like a good way to see your progress, as it kind of feels like you've "reset the game" every time you empty the recycling bin. Also, I thought that if people knew what items they recycled most often, they'd be more conscious of either find alternatives for that item or making sure that they always recycle that item when it crosses their path (e.g., I know that water jugs are my most recycled item, so I might think about switching to reusable jugs).

Energy Savings to Appliance Usage

The idea to add this component came from the sidebar widget "Save Energy by Recycling" on the EPA website. I thought it was as a good way to understand the effect of recycling, as hearing that your efforts generated 10-kilowatt hours of energy really doesn't mean much to most people.

What it does

Put simply, the skill records the number of items you've recycled and how many kilowatt hours of energy you've saved by doing so. It also calculates the length of time that you could power an appliance with your energy savings.

How I built it

I used VS Code and the ASK SDK to build the skill. I wanted to use the latest version of the SDK, so I used the Alexa Skills Kit documention to learn the general concepts and the SDK v2 documenation to learn how to perform the necessary actions.

In terms of the services that I used

  • CodeComit as my repo
  • Lambda to host
  • CloudWatch for logs
  • ASK Developer Console to test
  • Dynamo for storage

Challenges I ran into

My initial plan was to write a skill that could track a wide range of recyclables without having to hardcode each conversion.

I thought the best way to do this was to collect the item being recycled using two slots. The first would identify the material of the object (e.g., aluminum, paper, plastic, cardboard, etc.) and the second would identify the object itself. I would then multiply the amount of energy generated per ounce for the specified material by the average weight of the input item.

The number of possible recyclables was too large, so I decided to only support the most commonly recycled items. I flagged these "common recyclables" by doing google searches from the perspective of someone wanting to start recycling. Luckily, there were many blog posts on this topic (Example 1, Example 2, Example 3).

I did the same thing for the average weight of the items, no info on this or the common recyclables were in the open source data, but it was much harder to find good information (especially for items like a soda can where you need the "empty" weight). Still, I was able to find a few documents on specific subsets of items (Example 1).

Now that I had the average weight of commonly recycled items and the energy conversion of the different materials, all that I had left to find was the energy needed to power various appliances. Again, this data wasn't in the open source suggested resources, but I was able to find a site with all the information I needed.

After collecting all the data that I needed, I then started to write the code to perform the calculation. I used the EPA widget to check my conversion. I tested each item at a time and everything was looking good at first. I had to make small adjustments to my numbers, but it was within the expected error range given my crude methodology. However, when I went back to test all the items one final time, I found that my results no longer matched the EPA's. To make a long story short, it became clear that my formula and the EPA’s were different in some non-trivial way. I pulled the assets being used by the EPA site and went through them looking for the code for the widget. When I found it, I saw that they had an additional variable in their formula named “savings”. The EPA’s formula was clearly more valid than my own, and I wanted users to have an accurate account for their efforts, so I decided to scrap the weeks of work I’d done up to this point and use the EPA’s method instead.

I am still not entirely sure what the savings variable is meant to reflect, so my skill’s use became limited to only tracking the handful of items found in the EPA widget. This was a big disappointment, but I’m confident I can figure out what this variable represents and add more recyclables to my skill.

Utterances

Because I wanted to make up for having to restrict the kinds of items the skill could track, I wanted to make the utterances extremely flexible so that users could issue commands in the manner in which they naturally spoke; I wanted them to not have to say the word “magazine” for the skill to pick up on the fact that what they were recycling was a magazine. Continuing the example, I thought that having slot values for all the different top magazines would be enough to accomplish this, but I was wrong. In order for this method to work, I would have needed to add an utterance in the form “I am recycling a {magazine} magazine.” But then I realized that someone could have the same intent but instead say “I am recycling a copy of {magazine}.” Even if I were to account for all the ways to say you’re recycling a magazine, I realized that allowing this kind of leniency would make it hard to determine where someone who said “I am recycling a coke” meant a can or bottle. I could code a conditional to catch this and elicit an answer from the user, but this wouldn’t be scalable when new recyclables were added. So, I had to give up my plan and force the user to issue commands with a strict structure.

As a compromise for the strict structure, I thought it would be nice to allow users to be able to use brand names to identify items rather than being forced to use a general term (e.g., “coke can” instead of “drink can”). I thought this would make the interaction feel more natural. Since finding all the drinks that come in an aluminum can would be too difficult, I decided to look up the most popular canned drinks in the US. This was somewhat successful, but a lot of the top drinks are just alternative flavors of things like Coke or Pepsi. I wanted to get a wider range of items, so I resorted to using google image search to find images of convenient store fridges or super market fridges to get more options to include (Example 1).

Accomplishments that I'm proud of

Integrating the EPA’s Formula

Not only was the JavaScript minified, but their code was unorganized and separated across a couple of files. I had to resort to using CTRL+F and guessing potential keywords until I found the section that I needed. I then had to walk through the code and remove the parts I didn’t need (e.g., the code that updates the DOM or that shares the result on social media) and test that I had done everything correctly by comparing my results with the widget on the website.

My Formula

I am proud of the slot structure I’d originally come up with. I used this data to identify the common recycled material and the common item types. I found this info for the amount of energy saved by recycling the common materials and the result would have scaled easily.

What I learned

Spending Time to Plan Ahead Pays off Exponentially
Although I did take the time to plan ahead, I feel like if I’d planned better I could have saved myself a lot of wasted time. Before I started to collect all the data, I tested to see if my method resulted in the same answer as the EPA’s widget, but I only used one item for testing. If I’d tested with two, I would have realized sooner that I was doomed to fail and could have maybe used that time to add more features to the skill.

Build for the Simplest Case
A lot of times I found myself getting overwhelmed with the idea of having to account for all possible was to express an intent or the large number of items that can be recycled. But I slowly realized that I could (loosely) apply the pareto principle to this issue. Yes, there are may items you could recycle, but the majority of people will only recycle the most common household items. So, account for that first and then widen the scope over time. I think understanding this will help me with product development for years to come.

What's next for Daily Recycle

  • Add more recyclables
  • Add more appliances
  • Add milestones
  • Add streak counter
  • Add slot confirmation for recyclable
  • Add the ability to specify the appliance you'd like your energy savings report to use (e.g., how long could I power an AC with my energy savings?)
  • Add the ability to specify what info you want to hear after you’ve recycled an item
  • Add other conversions (e.g. landfill space saved, natural resources conserved, increase in economic security increase, reduction in pollution, jobs created) – Source that recycling does all this.
  • Add ability to check if an item is recyclable – there are apps for this already, but I think it would be nice to not have to launch another skill to do this
  • Add instruction for how recycle certain items

Built With

Share this project:

Updates

posted an update

I noticed some users were just playing around with the skill to see the conversion output. So, I added the ability to reset your recycling history so that these people can get more enjoyment out of the skill.

Log in or sign up for Devpost to join the conversation.