Giter Club home page Giter Club logo

sharpir's Introduction

SharpIR

Arduino Infra Red Sharp Lib

Based on an original work of Dr. Marcal Casas-Cartagena .

  1. Perform 25 reading of analog pin (Nb samples can be changed in .h)
  2. Sort values
  3. Convert median value to cm

Usage

  • #include <SharpIR.h>
  • SharpIR sharp(ir_analog_pin, model);
  • int dist = sharp.distance();

Sharp IR Volt Centimeter conversion

GP2Y0A02YK0F

Model: "20150" [20cm to 150cm]

| Volt | Distance | | 2,8 | 15 | | 2,5 | 20 | | 2 | 30 | | 1,55 | 40 | | 1,24 | 50 | | 1,05 | 60 | | 0,905 | 70 | | 0,82 | 80 | | 0,7 | 90 | | 0,66 | 100 | | 0,6 | 110 | | 0,55 | 120 | | 0,5 | 130 | | 0,455 | 140 | | 0,435 | 150 |

Using MS Excel, we can found folowing formula (For distance > 15cm) :

Distance = 60.374 X POW(Volt , -1.16)

GP2Y0A21YK

Model: "1080" [10cm to 80cm]

| Volt | Distance | | 2,6 | 10 | | 2,1 | 12 | | 1,85 | 14 | | 1,65 | 15 | | 1,5 | 18 | | 1,39 | 20 | | 1,15 | 25 | | 0,98 | 30 | | 0,85 | 35 | | 0,75 | 40 | | 0,67 | 45 | | 0,61 | 50 | | 0,59 | 55 | | 0,55 | 60 | | 0,5 | 65 | | 0,48 | 70 | | 0,45 | 75 | | 0,42 | 80 |

Using MS Excel, we can found folowing formula (For distance > 10cm) :

Distance = 29.988 X POW(Volt , -1.173)

GP2Y0A710K0F

Model: "100500" [100cm to 500cm]

Based on the SHARP datasheet we can calculate the linear function: y = 137500x + 1125 which gives us: 1 / ((Volt - 1125) / 137500) = distance_in_cm (For distance > 100cm)

sharpir's People

Contributors

guillaume-rico avatar tibm avatar ghirlekar 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.