Giter VIP home page Giter VIP logo

sharp-ir-sensor-curve-fitting's Introduction

Sensor-Curve-Fitting

This project aimed for the derivation of an output function for SHARP IR sensor (GP2Y0A21YK0F) in order to convert the raw value to meaningful distance.

Issue

SHARP IR sensor (GP2Y0A21YK0F) outputs a raw value which is not linearly correlated with the distance. So, a non-linear function is needed to output the distance from raw value.

The distance measureing characteristics (output) of GP2Y0A21YK0F is shown below:

Source: Datasheet

Experiment

The experiment is designed with a fixed opaque obstacle, a ruler for distance measurement and the sharp IR sensor. Matlab Arduino Support Package and Curve Fitting Toolbox was used respectively for Arduino Nano-Matlab connectivity and curve fitting.

  • Total 25 distance data of the obstacle and the sensor was recorded from the physical scale to the Matlab input prompt.
  • The corresponding sensor raw ADC value was recorded simultaneously.
  • Curve Fitting Toolbox was used on the recorded ADC value and measured distance following the settings.
Fitting Characteristics= Rational
Numerator degree= 0
Denominator degree= -1

Result

General model Rat01:
     f(x) = (p1) / (x + q1)
Coefficients (with 95% confidence bounds):
       p1 =        4835  (4723, 4948)
       q1 =      -28.76  (-33.52, -24)

Goodness of fit:
  SSE: 1.701
  R-square: 0.9987
  Adjusted R-square: 0.9986
  RMSE: 0.272

Derived output function:

Comment

The output function resembles the output characteristics of the sensor within 10-80 cm distance.

sharp-ir-sensor-curve-fitting's People

Contributors

farhanfuadabir 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.