Interfacing 2 HC-SR04 to PIC Microcontroller

Home Forums Microcontrollers PIC Microcontroller Interfacing 2 HC-SR04 to PIC Microcontroller

Tagged: , , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13461
    charmi pabari
    Participant

    How can I interface two HC-SR04 ultrasonic distance sensor with PIC 16F877A using a single timer (timer 1) ?

    #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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
>