Final Implementation Software

 

Since the system has a set number of functions that must occur in a synchronous order every time, the master program for the Household waste tracking system was constructed using a simple looping algorithm.

softwareloop

Overall procedural flow diagram

             After initializing and setting up all of the devices and constants in for the program the system starts polling for a waste bin and indicates to the user via LED that the system is ready to measure a new bin. The system then waits for either a significant amount of weight to be placed on the load cell or an RFID tag to be detected. In the event that significant weight has been placed on the load cell but and ID was not detected the system will note that an ID was not found, record the weight of the bin for later use in determining the net weight of the waste, and proceed to the dumping phase. An addition ID check was implemented in the code after the weighing proceedures to check if a previously unavailable ID becomes available after a dumping procedure. In the event that an ID is detected before weight is placed on the load cell, as often is the case with the system, the ID is recorded and then the system waits for a bin to be placed on the load cell. Once a bin is detected, the system records the full weight of the bin, and then proceeds to prompt the operator to dump the waste out of the bin. This procedure is summarized by the figure below.

binpolling

Bin polling method flow diagram

 

After the user dumps the bin, the system measures the empty weight of the bin and subtracts that value from the previously established full weight, then prompts the operator to remove the bin via LED. Next, the system prompts the GSM/GPS module to start the GPS connection, and records the location coordinates. If a connection to the GPS cannot be established the GSM/GPS module is prompted to begin a GPRS location search. If neither GPS nor GPRS locations can be established, the system notes that location could not be found and notifies the operator via LED. After location, weight, and ID information have been established all of the data is stored to a micro SD card in a .csv file. If, for some reason, the SD card cannot be accessed, the system notifies the operator through another LED. Finally, the system prompts the GSM/GPS module to begin a GSM connection. All of the data is then formatted into a string to be sent to Dweet.io [19]. The string is then attached to a URL and sent to Dweet via an Http “post” protocol. If the system is unable to complete the Http post the user is notified with an LED. A post from the device is accomplished simply by requesting the URL. There is no formal information that is actually pushed after the URL connection is established. As shown below in the figure, all of the data sent that correlates with a specific bin is embedded in the URL that is called by the http.

Dweet

Dweet.io information post through URL

The household waste tracking system, largely due to the Arduino micro controller, was coded primarily in the Arduino coding language. The Arduino coding language is an abstracted form of C++, so all header files were also completed in C++ (see appendices for full program). One of the largest advantages to using the Arduino platform is the modularity of the devices it interfaces with. Almost every device that was used in this project came with some amount of prewritten code. With the use of preexisting libraries a master program was stitched together to accomplish all of the functions of the system. The RFID reader, load cell amplifier, and GSM/GPS board all came not only with header files that greatly simplified the implementation of these devices, but all also contained example sketches that highlighted many of the key features of these devices. From the basic sketch examples and the predetermined functions in the header files, a master program was stitched together to accomplish all of the tasks of the Household Waste Tracking System.

Web Display

After the GSM board makes a post to dweet.io, the information embedded in that post is retrieved by the service Freeboard.io [20]. Using the ID information from the embedded RFID tag as a unique identifier, Freeboard is able to establish who the bin belongs to and the type of waste the bin is. The data from that bin is then displayed in a historical context and in a numerical value that tells the customer how much waste was retrieved on the last collection. Additionally, the location information of the last retrieval is displayed on a google map.

freeboard

Freeboard.io web display showing waste information for two customers as well as unidentified customers

Skip to toolbar