Home › Forums › Microcontrollers › PIC Microcontroller › Interfacing 2 HC-SR04 to PIC Microcontroller › Reply To: Interfacing 2 HC-SR04 to PIC Microcontroller
February 3, 2017 at 1:06 pm
#13467
Ligo George
Keymaster
You can do that. Just need to read one by one. See below.
- Send trigger to first HC-SR04
- Start timer
- Listen for echo.
- Stop timer once you got the echo
- Convert timer value to distance (first distance)
- Send trigger to second HC-SR04
- Start timer
- Listen for echo
- Stop timer once you got the echo
- 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.