Reply To: Interfacing 2 HC-SR04 to PIC Microcontroller

Home Forums Microcontrollers PIC Microcontroller Interfacing 2 HC-SR04 to PIC Microcontroller Reply To: Interfacing 2 HC-SR04 to PIC Microcontroller

#13467
Ligo George
Keymaster

You can do that. Just need to read one by one. See below.

  1. Send trigger to first HC-SR04
  2. Start timer
  3. Listen for echo.
  4. Stop timer once you got the echo
  5. Convert timer value to distance (first distance)
  6. Send trigger to second HC-SR04
  7. Start timer
  8. Listen for echo
  9. Stop timer once you got the echo
  10. Convert timer value to distance (second distance)

So it is easy. A microcontroller can do above steps very fastly, so it will appear to you that both sensors are reading simultaneously.

>