STM32 Tutorial - Use Multiple Ultrasonic Sensors HC-SR04

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025

ความคิดเห็น • 30

  • @eduardodelarosaferrer2205
    @eduardodelarosaferrer2205 4 ปีที่แล้ว

    A very useful tutorial. Thanks a lot !!

    • @ViktorVano
      @ViktorVano  4 ปีที่แล้ว

      You are welcome.

    • @ViktorVano
      @ViktorVano  4 ปีที่แล้ว

      Maybe leaving a like or sharing it will help. These videos are not getting many views.

  • @davebenemerito310
    @davebenemerito310 4 ปีที่แล้ว

    subbed! thank you for these videos

    • @ViktorVano
      @ViktorVano  4 ปีที่แล้ว

      You are welcome.

  • @marwasulaiman1406
    @marwasulaiman1406 3 ปีที่แล้ว

    great explanation! .. but what's the importance of the TXS0108E module ? can't we connect the sensors directly ? ... Also, do we have to reserve a pin for every echo and triggger for all the sensors, or is there a way to connect multiple ultrasonic sensors like i2c or something?

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      Thank you.
      HC-SR04 modules use 5V logic and do not accept 3.3V logic from the STM32 and also the STM32 does not always accept 5V logic (some IOs are 5V tolerant).
      And yes, I have to use separate set of pins for every HC-SR04 module. I want to trigger those modules one by one and also I cannot short outputs of those modules neither.

    • @marwasulaiman1406
      @marwasulaiman1406 3 ปีที่แล้ว

      @@ViktorVano Thank you very much!

  • @jay16myv.
    @jay16myv. 3 ปีที่แล้ว

    Great video. I have a question. Can I replace the TXS0108E module with some resistors? If yes, do I have to change anything from the code? Thank you

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      You can use resistors only as a voltage divider from 5V to 3.3V. But you cannot use resistors to turn 3.3V to 5V. And I am not sure if those ultrasonic modules accept also 3.3V, it may be to low voltage for a logic level.

    • @jay16myv.
      @jay16myv. 3 ปีที่แล้ว

      @@ViktorVano thank you. Then I guess I will stick with the TXS0108E module like yours :) thanks again for the video man you really do help me a lot on my thesis

    • @jay16myv.
      @jay16myv. 3 ปีที่แล้ว

      And one more question. Can I use a STlink v2 debugger instead of solder the resistor at PB3 like you? Thank you.

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      @@jay16myv. yes, you can use a ST Link V2. But you may need to do some mod on your ST Link if you have a clone.
      There are some options how to do it and a few tutorials.
      th-cam.com/video/JqrUAzjJ0tw/w-d-xo.html

    • @jay16myv.
      @jay16myv. 3 ปีที่แล้ว

      @@ViktorVano thank you you're the savior. Please keep up the work

  • @Steven-jf4cs
    @Steven-jf4cs 4 ปีที่แล้ว

    Can you also run multiple devices under one-wire?

    • @ViktorVano
      @ViktorVano  4 ปีที่แล้ว

      What do you mean by that? Each sensor needs to be triggered and listened to it's echo pin individually. You cannot trigger multiple sensors at the same time, because they would interact with each other because of the ultrasound.

    • @Steven-jf4cs
      @Steven-jf4cs 4 ปีที่แล้ว

      There is an arduino library that you can run and specifically I was thinking 1-Wire or OneWire. I was just hoping that you might know if this supported in Arduino IDE for STM32. Thanks!

  • @achalasamapriya2701
    @achalasamapriya2701 4 ปีที่แล้ว

    long time no see .what happen ?? awesome tutorial by the way

    • @ViktorVano
      @ViktorVano  4 ปีที่แล้ว +1

      Well there were Christmas holidays, new year and after that I was ill. Thank you.

    • @achalasamapriya2701
      @achalasamapriya2701 4 ปีที่แล้ว

      @@ViktorVano oh...hope you are well now. keep up the good work

  • @nour99594
    @nour99594 3 ปีที่แล้ว

    can you please sow how to connect 4 HC-sr04

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      Exactly the same way as 3 sensors. It is a repeating pattern. I have successfully connected 5 sensors like that.

    • @nour99594
      @nour99594 3 ปีที่แล้ว

      @@ViktorVano how about the pins? Where are the 4th Hc-sr04 pins connected?

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      @@nour99594 it in on my GitHub. The link is in the description. Those can be any GPIO pins.

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      @@nour99594 you just need to configure them.

    • @nour99594
      @nour99594 3 ปีที่แล้ว

      @@ViktorVano alright i will try

  • @vinodkinoni4863
    @vinodkinoni4863 3 ปีที่แล้ว

    Thanks plz share code

    • @ViktorVano
      @ViktorVano  3 ปีที่แล้ว +1

      it is always in the description:
      github.com/viktorvano/STM32F103C8T6_HC-SR04