Free virtual lab

Parking sensor

An HC-SR04 measures the gap to the wall behind a car and the buzzer beeps faster the closer it gets.

  1. Wire TRIG and ECHO to two digital pins
  2. Turn the echo time into centimetres
  3. Map the distance to the beep rate

Loading the lab…

Try free. Guest progress lasts while this page is open. Register to save on this device.