Building Arduino Projects for the Internet of Things

(Steven Felgate) #1
CHAPTER 10 ■ IOT PATTERNS: MACHINE TO HUMAN

Software Required


In order to develop this waste management system, you need the following software :



  • Arduino IDE 1.6.4 or later

  • Effektif (hosted)

  • Node-RED 0.13.2 or later


Circuit


In this section, you are going to build the circuit required for the waste management
system. This circuit uses an ultrasonic proximity sensor to detect objects, as illustrated
in Chapter 7. The sensor is attached to the top of a garbage can and sends an ultrasonic
burst that reflects off of the garbage in the can. The circuit reads the echo, which is used to
calculate the level of garbage.




  1. Make sure Arduino is not connected to a power source, such
    as to a computer via a USB or a battery.




  2. Attach a WiFi shield to the top of the Arduino. All the pins
    should align.




  3. Use jumper cables to connect the power (5V) and ground
    (GND) ports on Arduino to the power (+) and ground (-) ports
    on the breadboard.




  4. Now that your breadboard has a power source, use jumper
    cables to connect the power (+) and ground (-) ports of your
    breadboard to the power and ground ports of the proximity
    sensor.




  5. To trigger an ultrasonic burst, connect a jumper cable from
    the TRIG pin of the sensor to Digital Port 2 of Arduino. Your
    code will set the value of this port to LOW, HIGH, and then
    LOW in order to trigger the burst.




  6. To read the echo, connect a jumper cable from the ECHO pin
    of the sensor to Digital Port 3 of Arduino. Your code will read
    the values from this port to calculate the level of garbage in
    the can.




Your circuit is now complete and should look similar to Figures  10-3 and 10-4.
Free download pdf