Yi-Zhe Wang
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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 New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Arduino 教學 9:線性霍爾磁力感測器 > 作者:王一哲 > 日期:2020/11/25 ## 元件基本資料 KY-024 是一種常見的線性霍爾磁力感測器,售價大約90元。測量原理是利用外加磁場使晶片中的載子偏轉,使晶片於電流、磁場同時垂直的方向上產生電壓。但是 KY-024 只能測量磁場強度的相對值,無法精確地測量磁場強度的絕對值,因此在使用上比較適合作為開關,或是利用磁場量值隨時間的變化測量時間間隔。從下方的照片中可以看到由上至下的接腳功能分別為**類比訊號**、**接地**、**電源**、**數位訊號**,分別將它們接到 Arduino 開發板上的 **類比輸入**、**GND**、**5V**、**數位輸入**。 <img style="display: block; margin-left: auto; margin-right: auto" height="60%" width="60%" src="https://i.imgur.com/s6b308N.jpg"> <div style="text-align:center">KY-024 照片</div> <br /> <img style="display: block; margin-left: auto; margin-right: auto" height="60%" width="60%" src="https://imgur.com/l4zn3wH.png"> <div style="text-align:center">KY-024 電路圖</div> <br /> <img style="display: block; margin-left: auto; margin-right: auto" height="60%" width="60%" src="https://imgur.com/QWee7yA.jpg"> <div style="text-align:center">KY-024 裝置照片</div> <br /> ## 測試用程式碼 ```arduino= #define ANALOG A0 #define DIGITAL 3 int analog, digital; void setup() { pinMode(ANALOG, INPUT); pinMode(DIGITAL, INPUT); Serial.begin(9600); Serial.println("t (ms), analog, digital"); } void loop() { analog = analogRead(ANALOG); digital = digitalRead(DIGITAL); Serial.print(millis()); Serial.print(", "); Serial.print(analog); Serial.print(", "); Serial.println(digital); delay(100); } ``` <br /> 測試結果如下: 1. 沒有磁鐵靠近時,類比輸入讀取數值約為530,數位輸入讀取值為0。 2. 磁鐵N極靠近晶片正面或S極靠近晶片背面,類比輸入讀取數值約為870,數位輸入讀取值為0。 3. 磁鐵N極靠近晶片背面或S極靠近晶片正面,類比輸入讀取數值約為435,數位輸入讀取值為1。 <br /> <img style="display: block; margin-left: auto; margin-right: auto" height="60%" width="60%" src="https://imgur.com/pk53Npw.jpg"> <div style="text-align:center">磁鐵 N 極靠近 KY-024 晶片正面</div> <br /> <img style="display: block; margin-left: auto; margin-right: auto" height="60%" width="60%" src="https://imgur.com/FJJJIfC.jpg"> <div style="text-align:center">磁鐵 N 極靠近 KY-024 晶片背面</div> <br /> ## 測量複擺週期 將強力磁鐵吸附在鐵尺的下方,再將鐵尺懸掛起來,將鐵尺向右拉到某個角度後由靜止釋放。當鐵尺擺動到最低點時,下方磁鐵的 N 極會接近磁力感測器晶片的背面,使類比輸入讀取到的數值降低到 430 左右,從數值 - 時間的資料及關係圖中可以看出鐵尺擺動到最低點的時間間隔,這應該是鐵尺擺動的半個週期,大約為 374 ms。為了盡量縮短測量的時間間隔,實驗時會將程式碼中最後一行的 delay(100) 註解掉,但理論上磁場變化影響到感測器輸出數值需要一些時間,這部分還需要再研究看看。 <br /> <img style="display: block; margin-left: auto; margin-right: auto" height="40%" width="40%" src="https://imgur.com/rAOhKXk.jpg"> <div style="text-align:center">測量複擺週期裝置照片</div> <br /> <img style="display: block; margin-left: auto; margin-right: auto" height="75%" width="75%" src="https://imgur.com/ug2MGo9.png"> <div style="text-align:center">測量複擺週期實驗結果</div> <br /> ## 參考資料 KY-024 線性霍爾磁力感測器資料表:https://arduinomodules.info/ky-024-linear-magnetic-hall-module --- ###### tags:`Arduino`、`Physics`

    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
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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