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?
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.
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.
@@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. 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
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.
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!
A very useful tutorial. Thanks a lot !!
You are welcome.
Maybe leaving a like or sharing it will help. These videos are not getting many views.
subbed! thank you for these videos
You are welcome.
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?
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.
@@ViktorVano Thank you very much!
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
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.
@@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
And one more question. Can I use a STlink v2 debugger instead of solder the resistor at PB3 like you? Thank you.
@@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
@@ViktorVano thank you you're the savior. Please keep up the work
Can you also run multiple devices under one-wire?
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.
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!
long time no see .what happen ?? awesome tutorial by the way
Well there were Christmas holidays, new year and after that I was ill. Thank you.
@@ViktorVano oh...hope you are well now. keep up the good work
can you please sow how to connect 4 HC-sr04
Exactly the same way as 3 sensors. It is a repeating pattern. I have successfully connected 5 sensors like that.
@@ViktorVano how about the pins? Where are the 4th Hc-sr04 pins connected?
@@nour99594 it in on my GitHub. The link is in the description. Those can be any GPIO pins.
@@nour99594 you just need to configure them.
@@ViktorVano alright i will try
Thanks plz share code
it is always in the description:
github.com/viktorvano/STM32F103C8T6_HC-SR04