Tags:
tag this topic
create new tag
view all tags
---+ Le module HC-SR04, un capteur ultrason ---++ Introduction Le module [[https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf][HC-SR04]] émet des ondes ultrason et mesure le temps qu'il prend pour recevoir un écho. Il met à disposition un signal <i>Trig </i>qui lance l'émission et un pin _Echo_ qui retourne un signal d'une durée, qui correspond au temps que les ondes prennent pour voyager jusqu'à un obstacle qui les réfléchies et retour. <img alt="hc-sr04.png" height="276" src="%ATTACHURL%/hc-sr04.png" title="hc-sr04.png" width="455" /> Pour avoir la meilleure résolution en temps et en conséquence la meilleure résolution dans la mesure de distance, on utilise des méthodes * ticks_us * ticks_diff * sleep_us du module utime de !MicroPython. D'abord un signal positive de 10 us est envoyé au pin _trig_ du HC-SR04 et en suite la durée du signal de réponse _écho_ est mesuré. Pour les connexions du HC-SR04 voir [[HCSR04]]. ---++ Le calcul de la distance La vitesse du son dans l'air est 330 m/s ou 33000 cm/s. La distance est alors : s = v * t = 33000 * longeur_du_signale_echo /2 /1000000 Le facteur 2 vient du fait que l'onde ultrason fait un aller-retour, le facteur 1000000 converti <font face="Liberation Serif, serif">µ</font>s en s. La feuille d'exercice en format odt: %ATTACHURL%/hc-sr04.odt ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
odt
hc-sr04.odt
r1
manage
178.7 K
2021-06-29 - 15:07
UliRaich
png
hc-sr04.png
r1
manage
161.6 K
2021-06-29 - 14:33
UliRaich
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r2 - 2021-06-30
-
UliRaich
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
IoT_Course_French Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback