当前位置:网站首页>ESP8266-Arduino programming example-HC-SR04 ultrasonic sensor driver
ESP8266-Arduino programming example-HC-SR04 ultrasonic sensor driver
2022-07-30 18:02:00 【Vision & IoT Intelligence】
HC-SR04 Ultrasonic Sensor Driver
1. Brief introduction to HC-SR04
The HC-SR04 ultrasonic sensor uses sonar to determine the distance to objects such as bats or dolphins.The ultrasonic ranging module HC-SR04 provides 2cm-400cm measurement, and the ranging accuracy can reach 3mm.The module includes an ultrasonic transmitter, receiver and control circuit.
The workflow of the HC-SR04 ultrasonic sensor is as follows:
- IO trigger of at least 10us high level signal
- The module automatically sends 8 40 kHz and detects if there is a pulse signal back.
- If there is a signal return, through high level, the high level output IO duration is the time from sending the ultrasonic pulse to returning.
Test distance = (high level time × speed of sound (340M/s) / 2)
2. Hardware preparation
- ESP8266 NodeMCU development board
- One HC-SR04 sensor module
- Panel one
- Several DuPont lines
- A data cable
The hardware wiring diagram is as follows:

3. Software preparation
- Arduino IDE or VSCode + PlatformIO
In the previous article, I gave a detailed introduction to how to build the ESP8266 development environment, please refer to:
边栏推荐
- JVM 上数据处理语言的竞争:Kotlin, Scala 和 SPL
- ESP8266-Arduino programming example-BMP180 air pressure temperature sensor driver
- 游戏化产品搭建思路的拆解与探究
- 毕业1年从事软件测试拿下11.5k,没有给98后丢脸吧...
- 【开发者必看】【push kit】推送服务典型问题合集3
- 今年这情况。。真心推荐专科的工程师升个本!
- [Solved] The problem that Unity Hub fails to obtain a license or does not respond and cannot develop
- 微博广告分布式配置中心的构建与实践(有彩蛋)
- 测试.net文字转语音模块System.Speech
- JVM诊断命令jcmd介绍
猜你喜欢
随机推荐
网络基础(二)-Web服务器-简介——WampServer集成服务器软件之Apache+MySQL软件安装流程 & netstat -an之检测计算机的端口是否占用
Informatics Olympiad 1915: [01NOIP Popularization Group] Greatest Common Divisor and Least Common Multiple | Luogu P1029 [NOIP2001 Popularization Group] The problem of the greatest common divisor and
数据库系统原理与应用教程(067)—— MySQL 练习题:操作题 82-89(十一):数据的增、删、改操作
JVM 上数据处理语言的竞争:Kotlin, Scala 和 SPL
LayaBox---TypeScript---枚举
DevEco Studio3.0下载失败,提示An unknown error occurred
ESP8266-Arduino programming example-BMP180 air pressure temperature sensor driver
针不戳,数据库性能优化八大方案。
测试.net文字转语音模块System.Speech
微博广告分布式配置中心的构建与实践(有彩蛋)
ESP8266-Arduino编程实例-BMP180气压温度传感器驱动
[OC学习笔记]属性关键字
宽带射频放大器OA4SMM4(1)
图解LeetCode——11. 盛最多水的容器(难度:中等)
【HMS core】【FAQ】Account Kit、MDM能力、push Kit典型问题合集6
超声波探伤仪是做什么用的?
Py程序员的七夕情人节
快使用flyway管理sql脚本吧~
UE5第一人称射击游戏蓝图教程
数据库系统原理与应用教程(069)—— MySQL 练习题:操作题 95-100(十三):分组查询与聚合函数的使用









