Git Product home page Git Product logo

esp-idf-ultrasonic's Introduction

esp-idf-ultrasonic

Ultrasonic distance sensor for ESP-IDF

I forked from here.

Hardware requirements

  • Ultrasonic ranging module like US-015/US-025/US-026/US-100/HC-SR04/HY-SRF05.

HY-SRF05-3

  • esp-idf-ultrasonic-Stick is for M5Stick

  • esp-idf-ultrasonic-StickC is for M5StickC

  • esp-idf-ultrasonic-Stack is for M5Stack

  • esp-idf-ultrasonic-WebSocket is for generic ESP32

Software requirement

esp-idf v4.4/v5.0.

Speed of sound

The speed of sound is affected by temperature and can be calculated with 331.5+0.61*temperature[m/sec].
If the temperature is 20 degrees, it will be 331.5+0.61*20=343.7[m/sec].
343.7[m/sec]=34370[cm/sec]=34.37[cm/millisec]=0.03437[cm/microsec]
Counting backwards, the time required for 1 cm is 29.0951 microseconds.
In other words, the desired distance [cm] when the temperature is 20 degrees can be calculated by dividing the round trip time [microseconds] from the time the sound wave is emitted until it returns by 29.0951*2 (approximately 58.2).
This example uses 58 as an approximation.
If you want more accuracy, you should measure the temperature at the same time and use the measured temperature to calculate the distance.

esp-idf-ultrasonic's People

Contributors

nopnop2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

esp-idf-ultrasonic's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.