陌語
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    ###### tags: `FRC` # 紅外線測距儀 ## 1. 使用(參考)型號 - SHARP **GP2Y0A41SK0F** - Distance Measuring Sensor Unit - Measuring distance : 4 to 30 cm - Analog output type ## 2. 官方簡介 **GP2Y0A41SK0F** is a distance measuring sensor unit, composed of an integrated combination of ***PSD*** (position sensitive detector,位置傳感器) , ***IR-LED*** (infrared emitting diode,紅外線發射二極管) and ***signal processing circuit***(訊號處理電路).The variety of the ***reflectivity*** of the object(物體反射率的變化), the environmental temperature(環境的溫度) and the operating duration are not influenced easily to the distance detection. because of adopting the ***triangulation method***(三角測定法).This device outputs the voltage corresponding to the detection distance. So this sensor can also be used as a proximity sensor. ## 3. 程式碼 ```cpp= int IR_SENSOR = 0; // 類比讀取腳設為A0 int intSensorResult = 0; //偵測結果 float fltSensorCalc = 0; //計算距離 void setup(){ Serial.begin(9600); //設定和電腦的連接去將結果顯示在序列埠監控視窗(Serial Monitor) } void loop(){ //從IR sensor讀取傳感值 intSensorResult = analogRead(IR_SENSOR); //從類比讀腳(A0)獲取傳感值 fltSensorCalc = (6787.0 / (intSensorResult - 3.0)) - 4.0; //以公分為單位計算距離 Serial.print(fltSensorCalc); //傳送距離到電腦中 Serial.println("cm"); //將"cm"加到顯示結果中 delay(200); //延遲0.2秒 } ``` ## 4. 電路圖 ![](https://i.imgur.com/oeJFa2K.png) P.S. 圖源我統一放在下面 ## 4. 特殊名詞解釋 ### **一,PSD(位置傳感器)** 解釋: 位置傳感器是可量測位置的傳感器。 可分為絕對位置傳感器和相對位置傳感器(位移傳感器)。根據測量變量的性質來分類,位置傳感器可分為線性的、角度的以及多軸的。 ### **二,IR-LED(紅外線發射管)** 解釋: 紅外線發射管(IR-LED)也稱紅外線發射二極管,屬於LED二極體類。它是可以將電能直接轉換成近紅外光(不可見光)並能輻射出去的發光器件,主要應用於各種光電開關、觸摸屏及遙控發射電路中。紅外線發射管的結構、原理與普通發光二極管相近,只是使用的半導體芯片材料不同。 ### **三,signal processing circuit(訊號處理電路)** 解釋: 指對訊號表示、轉換、運算等進行處理的過程。 ### **四,reflectivity(反射率)** 解釋: 材料表面的反射率是其反射輻射能的有效性。它是在邊界處反射的入射電磁功率的分數。反射率是材料的電子結構對光的電磁場的響應的一個組成部分,通常是光的頻率或波長、其偏振和入射角的函數。反射率對波長的依賴性稱為反射率光譜或光譜反射率曲線。 ### **五,triangulation method(三角測定法)** 解釋: 以多種方法研究一個問題(方案)。 ## 5. 參考網站 -原廠技術文件(.pdf): https://global.sharp/products/device/lineup/data/pdf/datasheet/gp2y0a41sk_e.pdf -參考網站一: https://www.taiwansensor.com.tw/product/sharp-gp2y0a41sk0f-%E7%B4%85%E5%A4%96%E7%B7%9A%E8%B7%9D%E9%9B%A2%E6%84%9F%E6%B8%AC%E5%99%A8-%E6%B8%AC%E9%87%8F%E7%AF%84%E5%9C%8D-430cm-analog-%E5%A4%8F%E6%99%AE%E6%B8%AC%E8%B7%9D%E6%84%9F%E6%B8%AC/ -紅外線發射管解釋: https://www.luckylight.cn/zh-hant/product-category/infrared-led/ -PSD解釋(維基百科): https://zh.wikipedia.org/wiki/%E4%BD%8D%E7%BD%AE%E4%BC%A0%E6%84%9F%E5%99%A8 -訊號處理電路解釋: https://coggle.it/diagram/W9ACFEDGor-WurVb/t/%E8%A8%8A%E8%99%9F%E8%99%95%E7%90%86%E9%9B%BB%E8%B7%AF -反射率解釋(維基百科): https://en.wikipedia.org/wiki/Reflectance -參考程式碼及電路圖: https://hackmd.io/@J-T-LEE/Distance-Sensor

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully