当前位置:网站首页>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:
边栏推荐
猜你喜欢

ESP8266-Arduino编程实例-DS18B20温度传感器驱动

莫队--优雅的暴力

知识蒸馏1:基础原理讲解及yolov5项目实战介绍

windwons 下GPU环境和pytorch安装

基础架构之Mongo

Network Basics (3) 01-Basic Concepts of Networks - Protocols, Host Addresses, Paths and Parameters of URL Addresses & 127.0.0.1 Local Loopback Address & View URL IP Address and Access Ping Space + URL

Metaverse Web 3.0 和 DeFi大师班

网络基础(三)01-网络的基础概念——URL地址组成之协议、主机地址、路径和参数&127.0.0.1本地回环地址& 查看网址IP地址并访问之ping空格+网址&netstat -anb查看本机占用端口

【HMS core】【Analytics Kit】【FAQ】如何解决华为分析付费分析中付款金额显示为0的问题?

FastJson反序列化漏洞(复现)
随机推荐
Linux-安装MySQL(详细教程)
躲避雪糕刺客?通过爬虫爬取雪糕价格
华为无线设备配置Mesh业务
18.支持向量机(SVM)的介绍
Presto 中 lookUp Join的实现
【HMS Core】【FAQ】运动健康、音频编辑、华为帐号服务 典型问题合集7
如何让 JOIN 跑得更快?
【HarmonyOS】【FAQ】鸿蒙问题合集4
基于亚马逊云科技无服务器服务快速搭建电商平台——性能篇
LayaBox---TypeScript---类
Prometheus 基本概念
linux 安装mysql8.0 超详细教程(实战多次)
JVM诊断命令jcmd介绍
js中的基础知识点 —— BOM
Basic knowledge points in js - BOM
JVM 上数据处理语言的竞争:Kotlin, Scala 和 SPL
数据库系统原理与应用教程(066)—— MySQL 练习题:操作题 71-81(十):连接查询
LayaBox---TypeScript---类型推论
宽带射频放大器OA4SMM4(1)
千亿级、大规模:腾讯超大 Apache Pulsar 集群性能调优实践