Eチーム
      • 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
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners 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 New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • 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 Help
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
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 卒業研究経過報告(Eチーム)#13 メンバー:鈴木,堀 [前回のメモ](https://hackmd.io/Fs3QOlPBS3OLIVDMWmGPiw) [前回の先生のメモ](https://hackmd.io/@okuisatoshi/r1KXIyPGF) ## 目標 卒論の主張の柱 先行研究(田中先輩)と比較して以下の利点を主張 分圧測定のマトリックス回路を再設計し1マスずつ電流を流して測定するようにしたことで以下の利点を得た. 消費電力が小さくなり、バッテリーの稼働時間が伸びた 稼働するための電流が小さくですむ(1/7〜1/9程度)のでトランジスタが不要になった 旧回路ではブロックをたくさん並べたときに過負荷(十分な電流を流せない)になり分圧の測定値に大きな誤差がでる欠点があった(杉山先輩の論文参照)が、これが改善された ・執筆と並行して以下の残された課題に取り組む 設計した回路を実際に組んで,上記の利点を実験(計測)で客観的に実証する. ## 今回やること 1. マルチプレクサについて調べる 2. 実際にマルチプレクサを使用して回路の作成 ## マルチプレクサについて マルチプレクサとは、2つ以上の入力を1つの信号として出力するための機構のことをいい、種類が色々とある。 ### 使用するマルチプレクサ 今後はとりあえず、先輩の使用していた74HC4051APというマルチプレクサを使用していく。 ![](https://i.imgur.com/aswqeeG.jpg =350x) ### 74HC4051APについて これはCMOS技術を用いたアナログマルチプレクサで、アナログ、デジタル信号を高速でスイッチングすることが出来るのが特徴。 ![](https://i.imgur.com/MxIp76o.png =300x) ![](https://i.imgur.com/YetyOyz.jpg =500x) 上の写真は74HC4051APのpinの役割についての物である。また1つ下の写真は回路を組むにあたって参考にしたものである。 今回は縦列を読み取るマルチプレクサは、操作用pinとしてs0, s1, s2をデジタルpinの14, 15, 16に、Vccを3.3Vに、zをアナログpinの2pinに接続し、y2, y1, y0, y3を縦列用の4つに使用している。 また、横列を読み取るマルチプレクサは、操作用pinとしてs0, s1, s2をデジタルpinの12, 11, 9に、y2, y1, y0, y3を横列用の4つに、zを基準抵抗につなげている。 ## 実験 ### 回路 ![](https://i.imgur.com/rvvkA6r.jpg =300x) 今回は上の回路図をブレッドボード上で再現する。 この回路で使われている抵抗は左の1列から220, 6800, 2200, 510の順で設置している。また、基準抵抗は510を使用している。 ![](https://i.imgur.com/zy5NWvH.jpg =300x) 線がかなりややこしくて見づらいが上の写真がブレッドボード上で再現したものである。 ### プログラム 今回書いたプログラムは以下である。 ```c++= #include"MicroBit.h" #define TATE 4 #define YOKO 4 #define ID_READ_BUTTON 10 int n = 0; //読み取りボタンインスタンスのID7 #define MUX_READ 4 //マルチプレクサで拡張するピンの数 uint16_t board[TATE][YOKO]; MicroBit uBit; MicroBitButton readButton(MICROBIT_PIN_P19, ID_READ_BUTTON, MICROBIT_BUTTON_ALL_EVENTS, PullUp); //読み取りルーチン void read(){ static MicroBitPin muxControl[3]={uBit.io.P14, uBit.io.P15,uBit.io.P16};//マルチプレクサ操作用ピン static MicroBitPin muxRead=uBit.io.P2;//マルチプレクサで読み取るピン static MicroBitPin muxControl2[3]={uBit.io.P9, uBit.io.P11,uBit.io.P12};//マルチプレクサ操作用ピン //ここから読み取り for(int i = 0;i < YOKO; i++){//直接読み取り for(int j = 0;j < MUX_READ; j++){ for(int k = 0;k < 3; k++){ muxControl[k].setDigitalValue((j >> k) & 1); } for(int k = 0;k < 3; k++){ muxControl2[k].setDigitalValue((j >> k) & 1); } board[j][i] = muxRead.getAnalogValue(); } } } //読み取りボタン押されたら実行 void OnButton(MicroBitEvent){ n = 0; uBit.display.disable(); read(); uBit.display.enable(); //値を表示(デバッグ用) for(int i=0; i < TATE; i++){ for(int j=0; j <YOKO; j++){ if(board[i][j]<10){ uBit.serial.send(" "); }else if(board[i][j] < 100){ uBit.serial.send(" "); }else if(board[i][j] < 1000){ uBit.serial.send(" "); }else{ uBit.serial.send(" "); } uBit.serial.send(board[i][j]); n++; } uBit.serial.send("\r\n\r\n"); } uBit.serial.send("------------------------------------------------------"); uBit.serial.send("\r\n\r\n"); } int main(){ uBit.init(); uBit.messageBus.listen(ID_READ_BUTTON, MICROBIT_BUTTON_EVT_CLICK,OnButton, MESSAGE_BUS_LISTENER_DROP_IF_BUSY); while(true){ uBit.sleep(1000); } } ``` 今回はマルチプレクサを二つ使用して分圧を計測した。そのため前回使用していたプログラムの読み取り部分を大幅に改変し、マルチプレクサへのピンの割り当てや読み取り操作を行うプログラムに変えた。しかしまだマルチプレクサに対する理解が浅く、先輩のソースなどを参考にしつつコードを書いたので理想の値を得られる確証がない状態。 | 理想の値 | | | | | ---- | ----- | ----- | ------- | | 715 | 715 | 715 | 715 | | 71 | 71 | 71 | 71 | | 237 | 237 | 237 | 237 | | 511 | 511 | 511 | 511 | 上で説明した回路図とプログラムを使用した場合大体この表のように値が表示されれば成功したと言える。 ## 結果 ![](https://i.imgur.com/2xxvIpk.png =300x) ## 考察 結果を見ると理想の値とは違う値が出てしまっていることが分かる。しかし横向きの行で見た場合上の4つ以外の行は比較的まとまった数字になっている。 しかし、原因は調査中 ## 今後の課題 * 一度縮小化し、2×2の回路でマルチプレクサを使い、実験を行う。 * 回路図を見直す(特にマルチプレクサ周辺) * マルチプレクサに読み取りを指示する部分を重点的に、プログラムを見直す ## 参考文献 [74HC4051APの仕様書](https://www.chip1stop.com/pdf/product/TOSH/TC74HC4051AF_TC74HC4053AP_JA_DATASHEET_071001.PDF)

    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