background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки"

input logo icon
Video tags
|

Video tags

электроника
радиоэлектроника
радиолюбитель
своими руками
схема
DIY
как сделать
how-to
HC-SR04
Микроконтроллер
STM8
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:09
hello to you today soldering iron tv
00:00:12
and we continue the lessons dedicated to
00:00:16
the microcontroller does not cost eight
00:00:18
today we will have a practical lesson
00:00:20
we will try to use the x cs4 sensor
00:00:26
which is an ultrasonic sensor
00:00:29
for measuring distance we will try to
00:00:33
connect it to our microcontroller
00:00:36
also with it we will connect an active
00:00:43
piezoceramic sound due to the series of
00:00:45
star legs, the emitting element of the sensor y
00:00:48
0 12 that's all together, you
00:00:51
get a device designed to
00:00:54
measure distance with simultaneous
00:00:57
output of information to see sand,
00:01:01
yes, that is, the closer to the distance the topic is more often
00:01:03
food, this is actually a parking sensor for
00:01:07
cars, let's say also small
00:01:11
reworking the program of the one that will
00:01:12
fall when presented, it
00:01:14
is possible to use it, for example, a
00:01:16
level sensor in
00:01:20
some container into which you
00:01:23
fill, let’s say at home you fill
00:01:24
the container and as you fill it, you
00:01:27
measure the distance from the sensor and
00:01:30
thereby control how much you have
00:01:33
there water or a car is parked there
00:01:36
backwards and you hand it over and
00:01:38
it starts faster and slower to promise what the
00:01:44
sensors really are, Russia, the tweeter is
00:01:46
active, that’s why it’s active, it promised
00:01:50
nothing, it doesn’t do anything tricky, we do
00:01:53
n’t hang one leg on the ground, we
00:01:56
give it to the other the output of the sport is visible in the diagram,
00:01:59
that is, it is shifted to gamma on the
00:02:01
ground 2, the sport is simply fed and when
00:02:06
we hit one, it starts to squeak the
00:02:09
ultrasonic distance sensor itself, it
00:02:12
works a little more cunningly, it has
00:02:15
4 inputs,
00:02:18
two of which are the supply voltage on the
00:02:20
sword and supply voltage is required
00:02:22
5 volts, that is, on
00:02:24
stm and modellers 8 discovery yes on our
00:02:27
debugger it
00:02:28
will be necessary to switch the upbringing
00:02:30
3 3 volts there by default usually 33
00:02:32
is set to 5 volts how this is done there
00:02:35
we have a gp1 connector named
00:02:40
on the board there it can be seen strict and there is a
00:02:42
jumper left on it, this jumper
00:02:44
must be switched from 1 to 2 pins if
00:02:46
it is there in the second third then the power supply for the
00:02:48
entire processor and all the singer test on
00:02:50
the portal for a long time we will have water from five
00:02:52
volts what else does it have in the country what codes on it
00:02:56
there is a cat trigger and start echo output how
00:03:00
they work in order for it to start
00:03:05
giving us a signal that tells us the
00:03:08
distance to the target, we need to apply
00:03:12
a trigger to the input that triggers a pulse
00:03:14
lasting 10 microseconds
00:03:17
or more after that, that is, one, yes, that
00:03:20
is, we set the port to which
00:03:22
we have our sensor connected to one
00:03:26
we keep it in this state for a time of
00:03:29
more than ten than 10 microseconds,
00:03:31
we lower it, and then mine starts to
00:03:33
work, how it works, it
00:03:35
forms a packet of pulses, as you
00:03:37
can see here,
00:03:39
high-frequency 40 kilohertz of new beeps
00:03:42
with them in some direction and begins to
00:03:45
measure the time for which the sound
00:03:48
passes back and forth at the output at this
00:03:52
moment, an echo is formed at the output, a
00:03:54
pulse is formed with a logical level of
00:03:59
one active, that is, when we
00:04:01
have a unit, we begin to measure the
00:04:03
time that our
00:04:07
sound signal moved to the target to the target and
00:04:11
back, that is, in order for us to measure the
00:04:15
distance we need to measure the time
00:04:17
which is at the output of the nizhnikov
00:04:20
during which
00:04:23
a unit appears at the output of the echo after we have
00:04:25
given the trigger the trigger pulse then according to the
00:04:28
formula
00:04:29
some from us that is the time that
00:04:32
we measured is microseconds green 58
00:04:35
it turns out we have one centimeter yes
00:04:38
that is we measured the time, let's say we
00:04:40
got 58,580 microseconds, then this
00:04:45
distance to the target is 10 centimeters; the sensor
00:04:48
allows you to measure distances from two
00:04:52
centimeters to 4 meters with the greatest
00:04:53
accuracy and on the board it reads in the range of 30
00:04:57
to 60 centimeters; it is quite suitable for,
00:05:01
say, a parking sensor which is
00:05:03
like ours now this is also suitable
00:05:05
for sensors, let’s say filling
00:05:08
something, let’s say you have a barrel and
00:05:10
you draw water, there is
00:05:12
a sensor at the top and it measures the distance to this
00:05:14
water when it’s all at the threshold
00:05:16
level, turn off the water intake the
00:05:19
maximum distance that can be
00:05:21
measured using this sensor is 4 meters,
00:05:23
that is, for a parking sensor it is
00:05:26
perfect for, as already
00:05:29
said, a level measurement sensor, it is
00:05:31
also suitable great and it is
00:05:33
also possible to implement other applications on it,
00:05:35
say a sensor that will
00:05:39
respond, say, the passage of objects
00:05:43
of any kind past it, that is, you
00:05:45
direct it at some obstacle
00:05:47
and when any object passes between the sensor and the
00:05:49
obstacles, the
00:05:52
measured distance
00:05:54
will change again and you will notice that
00:05:56
your object has crossed this zone; we’ll
00:06:00
see how this is implemented in
00:06:01
our program. What are we up to? we do it in order to
00:06:04
service the sensor and the program is more precise,
00:06:07
first let’s look at the diagram, I’ll explain what is
00:06:09
shown in the diagram, how we connect it,
00:06:12
so in the diagram, here we have diagrams for
00:06:15
connecting it, this is our modules costing
00:06:17
eight discovery debugging yes we
00:06:19
use the jumper itself, we need to
00:06:21
install it, that is, this is the jumper that
00:06:24
switches the power supply of fear 1 loop to
00:06:26
5 ult for this you need to straighten
00:06:28
close the second third leg
00:06:31
Jane peas rearrange and two connectors
00:06:34
cent 4
00:06:36
cn22 take the supply voltage 8 leg is
00:06:40
our 5 volt 7 leg is our ground on the
00:06:43
connector and we connect to our sensor
00:06:46
with 44 ground and to ours to the limitless
00:06:51
active emitter we must connect
00:06:55
the ground as ports, we use the
00:06:59
microcontroller ports on port d 7 pairs
00:07:02
d6 and under up to 4 they brought us to the
00:07:07
Sep 4 connector and here the service can be seen how we are
00:07:09
connected, that is, we are under d6 this is 11 this is
00:07:13
us launching
00:07:15
ultrasonic sensors to measure pores up to 7 12
00:07:20
pin n4 this is our sensor output, that is,
00:07:24
here we measure the time which
00:07:26
I will be present here signal
00:07:28
port up to 4 9 pin connector cn 4 this is
00:07:33
our tweeter here we will be squeak that
00:07:36
is, here we give one and then we
00:07:37
have a sound go to the program in the
00:07:41
program in the program what we do in the
00:07:43
program first of all, we of course
00:07:45
set up our ports that we will
00:07:46
use this time up to 7 sales from type
00:07:48
up to 40 to 7 as it was said the output of
00:07:51
our sensor, that is, the output of the glasses from
00:07:53
it, we will measure not pores up to 6, to
00:07:56
launch the sensor from it, we will launch the
00:07:59
sensor from it, pores up to 4, this is a tweeter, including it,
00:08:01
we will beep here until 7, we
00:08:06
configure the output to be a clean output, let's go
00:08:09
to a clean output here, without any
00:08:11
pull-up resistors, without anything, we
00:08:13
just have a floating code, we all
00:08:15
measure on it panda 6 under 4, in the
00:08:19
same way we configure it as
00:08:20
high-speed outputs,
00:08:22
but everything is also there, nothing so
00:08:26
complicated there, how it works for us
00:08:29
means
00:08:33
they install it like it was said
00:08:34
we set our output of the desk to 6
00:08:39
which is connected to the input of the trigger of
00:08:40
the sensors,
00:08:41
we hold the unit for some time, namely here
00:08:45
it is set here, this is some kind of personally 30
00:08:48
something there turns out to be
00:08:51
about 17 microseconds after which we
00:08:54
lower it again to zero and start wait for
00:08:56
when a
00:08:58
single pulse begins to appear from the output of the
00:09:03
echo sensor, as soon as it begins
00:09:06
to appear we begin to measure time,
00:09:09
that is, we increase the time register and we also
00:09:12
measure how much time has passed while there are
00:09:16
units at the input, as soon as the
00:09:18
unit disappears we return from this
00:09:21
function, here is a range measurement function
00:09:25
where we divide the result that
00:09:28
the function passed to us by some
00:09:29
value, I subtract it as I measured
00:09:33
the distance and when changing personal and looked at how much
00:09:38
time it takes me, I
00:09:40
got a price tag of 43, this allows us to
00:09:45
get the value here in this
00:09:49
radish the range is in centimeters how it
00:09:52
works, let’s say we direct the sensor
00:09:55
to besides the cattle on the adjacent wall an hour
00:09:57
is directed at it for about two and a half
00:09:58
meters this is 2 and 3 here it shows us the
00:10:00
value here at 2 and 3 meters let’s try to
00:10:03
direct to another place so
00:10:06
we redirected 21 centimeters,
00:10:11
yes, this is how it measures how it beeps beeps
00:10:16
how we implemented the beeper,
00:10:19
or we installed
00:10:21
the timer on the timer, we sorted it out in the last lesson,
00:10:23
if you remember, you can see how it’s
00:10:26
all done there, that is, the settings for the
00:10:28
light timer are the same the same
00:10:29
thing, that is, somewhere you get
00:10:34
200 microseconds each
00:10:37
timer interrupt and we implement a tweeter for this,
00:10:41
we organize low registers, more precisely 1
00:10:44
register of us will be specially
00:10:47
called bitumen for the tweeter every time when about
00:10:49
someone 1 on the timer we increase by
00:10:51
one if we have less than ten, yes,
00:10:54
that is, it turns out to be two milliseconds
00:10:56
in sound, it’s normally audible to the ear
00:10:59
now, it will seem to you like it’s
00:11:00
heard there and with food, yes, it turns out that we have a
00:11:06
list, if not, then we don’t write,
00:11:10
but the Sunny register is resettable to me 0 then
00:11:14
there is, and we continue to count
00:11:15
further, we count up to the value of
00:11:18
our measured range, multiplied by
00:11:20
2, that is, with this we implement that same
00:11:23
time delay between the sands, that is,
00:11:25
yes, that is, but the range is increased, the longer it is, the
00:11:26
delay between
00:11:28
searches turns out to be longer, this is how
00:11:32
it works how it works how it can be heard as
00:11:35
it can be seen now I’ll connect the sensor
00:11:37
beeper I mean, I’m connecting it I beeped the
00:11:41
glasses and let’s say I point it at the wall I do
00:11:47
n’t know whether you can hear it you won’t hear it
00:11:48
we tried to make it audible
00:11:50
we launch the program
00:11:52
here we have the beeper and here it is I bring
00:11:55
something between it and the wall of the vessel, the property
00:12:02
starts to squeak, the length is
00:12:07
planted a little inconveniently, like a special one, I
00:12:12
won’t show you the video, I don’t have
00:12:14
a video camera, of course, he
00:12:16
would show it all better like this, I can
00:12:20
only show you a photo, these photos with phones are
00:12:22
beautiful, well, they are so beautiful there is, don’t blame me and
00:12:25
there is no other equipment,
00:12:27
let’s say no one wants it, and this is what it
00:12:28
looks like, here’s the sensor, here’s ours, here’s our
00:12:34
module, here’s the wait, ticklish beeper, here’s
00:12:37
our module, connected, and
00:12:40
what does it look like, so it works, in
00:12:47
principle, I don’t know instantly, anyone
00:12:49
interested, you can finish it lights, in
00:12:52
principle, in fact, you can complete all this
00:12:55
to a normal circuit,
00:12:58
use a normal microcontroller for its intended
00:12:59
purpose, that is, like a car parking sensor,
00:13:01
it works stably,
00:13:03
no failures or errors, nothing
00:13:05
arises, well, what else is the
00:13:09
follow-up to these, I would like to say the
00:13:10
real seeds, let’s get down
00:13:13
to answer those theories about the ADC module, yes, that
00:13:16
is, we will analyze the ADC module,
00:13:18
how it works, after which we will try to
00:13:20
implement a thermometer on it using thermistors,
00:13:24
that is, with an indication of
00:13:27
temperature changes, that’s probably all you
00:13:30
had with you, a soldering iron, you’re on a date

Description:

Рассмотрено построение датчика парковки на базе ультразвукового датчика HC-SR04 и активного пьезокерамического звукового излучателя KY-012. Файлы можно скачать в теме поддержки на форуме: http://forum.cxem.net/index.php?showtopic=162791 HC-SR04 стоит менее 1$: https://hz.ru.aliexpress.com/af/HC%25252dSR04.html?SearchText=HC-SR04&af=2052_1&cv=3122818&cn=45sewilntannh8rz8xij6medukswwqoj&dp=v5_45sewilntannh8rz8xij6medukswwqoj&af=2052_1&cv=3122818&cn=45sewilntannh8rz8xij6medukswwqoj&dp=v5_45sewilntannh8rz8xij6medukswwqoj&afref=&aff_fcid=dc1fe2070cf34d979ba8b73dda47f5b2-1718084651551-03003-_9hwhcM&aff_fsk=_9hwhcM&aff_platform=portals-hotproduct&sk=_9hwhcM&aff_trace_key=dc1fe2070cf34d979ba8b73dda47f5b2-1718084651551-03003-_9hwhcM&terminal_id=80222714895448e992ccb42644efdb3b

Preparing download options

popular icon
Popular
hd icon
HD video
audio icon
Only sound
total icon
All
* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "STM8 - Урок #5. Практика 1. Измерение расстояния УЗ датчиком HC-SR04. Датчик парковки"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.