Car Counter Exercise

In this exercise, you will use the pressure sensor to make a car counter that will control traffic flow. When a certain number of cars has passed, the stoplight (RGB LED) will turn red. After a few seconds, the stoplight will turn green and continue counting. The number of cars will be set by the Central Yún .

Materials:

  • Arduino Yún
  • Jumper wires
  • 10k resistors  (The colors on it are brown , black, orange and gold)
  • Pressure sensor
  • Breadboard

 

  1. Construct the MDF parts to hold the pressure sensor.
  2. Open “e5_carcounter” from the examples.
  3. Upload the sketch to the Yún.
  4. When the onboard LED L13 is on, the Yún is ready.
  5. Open the Serial Monitor and test the sensor by rolling something over it (remember that 1 car hits the sensor twice with its front and back wheels). Check the Central Yún ’s serial monitor to see all the saved values.
  6. Go to this URL: http://verkstad.cc/iot/mmx/2/index.php to see current state of the car counter signal.