8.1 General Codes
MediaTek labs states that an Arduino sketch “is a source code file representing the core controlling logic for the LinkIt ONE development board. It consists of two main structures: setup and loop” (MediaTek Labs, n.d.).
In this section I will discuss what the above code do. First, LinkIt ONE initializes the Ubidots account, then the sensors, Wi-Fi or GPRS, the location and finally the serial port. To minimize battery consumption, I did not use the GPS antenna to detect and acquire automatically the location. I manually added the location of the device in the codes using latitude and longitude coordinates. The Eco-Smart Can device will try to update the collected data to Internet on the Ubidots …show more content…
Cytron Technologies explain in their user’s manual of the HC-SR04 sensors that the ultrasonic sensor uses sonar to determine distance to an object like bats or dolphins do. To start the measurement, the code triggers the digital Trig pin (Pin D12) of the sensor with a high (5V) level signal of 10μs (micro second), this initiate the sensor to transmit out eight cycle of ultrasonic burst at 40kHz (kilohertz) and wait for the reflected ultrasonic burst. When the signal comes back and is detected by the sensor; the sensor will set the Echo pin (pin D11) to high (5V) and delay for a period (time) which proportion to distance taken by sonar waves to travel from the sensor to the object and back to sensor. To obtain the distance, we need to first divide time by 2. We know that, Distance = Speed × Time; in this case, Trash distance = (Echo pin high time/2) × velocity of sound (340m/s). The range of the HC-SR04 sensor is from 2 cm - 400 cm with an accuracy of 3 mm and the Velocity of sound in dry air at 20 °C (68 °F) is 340 m/s. Since the duration for which the trig pin and echo pin stays high is in microseconds (μs). Therefore, Velocity of sound in cm/μs = (340m/s × 100)/1000000 = 1/29.1 cm/μs. Finally, Trash distance (cm) = (Echo pin high time in µs/2) x (1/29.1 cm/μs) = Echo pin high time/58.2 cm. (Cytron Technologies, 2013). See data sheet in Appendix …show more content…
This project can be taken further. In the future, I will like to improve this device by adding a solar panel to charge the battery to make it autonomous, with minimum human intervention. In addition, create a real-time monitoring of the civic body’s garbage vehicles using Radio Frequency Identification (RFID). Each maintenance staff has to scan his/her RFID card so that who and when and at what time trash cans were emptied is recorded. It will help ensure that everyone is doing their job. The velocity of the sound that I am using in my code, is when the sound travels in a dry air at 20 °C (68 °F), but since the trash will be exposed to different weather sometimes our readings will be affected. Therefore, I think to fix this issues we can use the data of the temperature & humidity sensor to compensate the changes in order to keep our reading accurate. This project has countless way to improve