GithubHelp home page GithubHelp logo

abtom87 / distance-measurement- Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 627 KB

Distance measurement using HC-SR04 and ATMEGA328p

Shell 0.98% C 99.02%
hc-sr04 atmega328p ultrasonic-sensor distance-measure avr

distance-measurement-'s Introduction

Distance measurement using HC-SR04 and ATMEGA328p.

Distance measurement using HC-SR04 and ATMEGA328p. In this project i have measured distance in centimetres, with the help of HC-SR04 Ultrasound sensor, ATMEGA328p microcontroller, LCD Display via I2C bus.

Principle:

Timer2 of ATMEGA328p is used to generate a Trigger pulse of 20uS, the ultrasonic module sends out a 8cycle burst of 40khz which hits the object surface and returns back to raise an echo pulse. The pulse-width of this pulse is proportional to the distance between the module and Object.

Input capture module of the ATMEGA was used to capture the time between rising and falling edges of the echo pulse. The prescaler of this unit was chosen, such that the resolution of pulse-width is 16uS.

The Timer count (OCR2A) of Timer2 was chosen such that a trigger pulse signal of width 10uS is sent, and there is a pause (pin stays Digtal Low) for around 1.4mS.

Hardware used:

  • Arduino-UNO
  • HC-SR04 Ultrasonice sensor
  • LCD Display with integrated PCf8574T chip enabling serial (I2C from uC) to parallel conversion.
  • 2.2k Pullup resistors for I2C bus.

SW and Toolchain:

  • Software was written entirely in C,
  • Developed in EClipse CDT,
  • AVR-GCC compiler was used,
  • AVRDUDE was used to program the hex onto the target,
  • Operating System - Ubuntu(Linux)

distance-measurement-'s People

Contributors

abtom87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nirmalrg

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.