Smart Trashcan Module

Written by: admin@makezilla

Picture of Smart Trashcan Module

The idea of the project is to allow city planners to better track trashcans around their city without replacing existing ones/install extra infrastructure using the Intel Edison board. You can also hook it up to your home trashcan too!

Using the sensors and the front end web application, you will be able to track the trash level, if the trash can is tilted, the temperature, and its geolocation.

Follow the steps to create your own smart trashcan!

Step 1: Gather the components

Picture of Gather the components

Here are the the hardware components used in the system:

1 x Intel IoT Edition board with Grove Starter kit and shield

1 x HC-SR04 ultrasonic sensor

1 x SIM28 GPS sensor

1 x Grove kit temperature sensor

1 x ADXL335 Tilt Angle Module

1 x Grove kit Speaker

1 x Red LED

1 x Green LED

1 x Blue LED

A breadboard/voltmeter would help with debugging/troubleshooting

Step 2: Gather the Software

Picture of Gather the Software

This tutorial will use javascript/Node.js to develop Intel IoT app on Edison.

Follow the detailed setup instructions for your OS here:

Here are the major steps:

  1. Install Intel XDT
  2. Flash the newest image using the Intel flash utility
  3. Connect to the Edison board from serial using screen/PUTTY to configure the network
  4. Try out one of the example projects, such as LED blink, to make everything working

Step 3: Connect the Hardware

Picture of Connect the Hardware

Hook up the sensors and actuators to the Intel Edison Board

HC-SR04 ultrasonic sensor

  • Connect the ECHO pin to GPIO pin 3 and TRIG pin to GPIO pin 4
  • Connect VCC to 5V and GND to GND

SIM28 GPS sensor

  • Connect the GPS to UART

Grove kit temperature sensor

  • Connect the temperature sensor to analog pin 0

ADXL335 Tilt Angle Module

  • Connect the Y pin to analog pin 3
  • Connect the X pin to analog pin 4
  • Connect the Z pin to analog pin 5
  • Connect VCC to 3.3V and GND to GND

Grove kit Speaker

  • Connect the speaker to digital pin 8


  • Connect the red LED to digital pin 5

Green LED

  • Connect the green LED to digital pin 6

Blue LED

  • Connect the blue LED to digital pin 7

Step 4: Hook Up the Software

Picture of Hook Up the Software

Download the code from github here:

The "webpanel" directory contains a webapp that shows the status of the trashcan,

The "Intel Edison Javascript Code" contains the Intel XDT code to be run on the Intel Edison Board.

Create a blank project and import the code. Click "Build" and "Upload", your smart trashcan should be good to go!

A little more info on the software:

With board connected to sensors, we can now go ahead and proxy data from sensor all the way up to internet with WebSocket via ( In other word, the board will be communicating with its companion app with WebSocket protocol. Please take a look of the website to see how you can emit data out with

With the in place, we now can create our companion app with anything. In our case, we are building a web app to visualize sensor data by using client. With these data, you can use any JavaScript libraries to plot data into graph. We are using Google Charts and Map API component from Google Polymer but again you can use any library to do so.

Step 5: Further Enhancements

Picture of Further Enhancements20150712_133712[1].jpg

Connect the device to the cloud

The code contains post request to the AT&T M2X API, which allows you to archive data on the cloud and do data analysis. Add a config.js in the project directory and export the device id and api key to use it in the code.

Mounting the device

You can hook it up to a physical trashcan by using Velcro and tape. Just make sure the tilt sensor and ultrasonic sensor is correctly positioned for accurate reading.