Coder Social home page Coder Social logo

hc-sr04test's Introduction

Ultrasonic HC-SR04 Test

Overview

Concept testing of time measurement from HC-SR04 ultrasonic sensor echo pulse on Mongoose OS. Interrupt code based on IR library. Eventually, code need to be converted to a lib for general use.

Examples build:

git clone https://github.com/Tommystus/hc-sr04test.git
mos build --arch esp8266
mos flash

Wiring circuit for this test: HC-SR04-Test

The diode is there to protect ESP8266 from 5v signal of the HC-SR04 module (just in case!).

Much time was spent on moving code around to prevent trigger interrupt from interfering with timer. See code comment. Also, keep trigger and echo lines separated to prevent signal crosstalk which may cause false trigger.

Rough formula for converting echo pulse width micro-second time to centimeter: d = (t+14)/55

Examples ping to sound pingbuz.js demo video

hc-sr04test's People

Contributors

tommystus avatar

Stargazers

 avatar

Watchers

 avatar

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.