

I2c rotary encoder
i2c_rotary_encoder
- Size
- 12.7 × 10.2 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 3
- Nets
- 8
- Pads
- 16
- Tracks, vias
- 29, 2
- Pours
- 2
- Routed
- Yes
- KiCad
- KiCad 5 (file 20171130)
- Created
- 14 Aug 2022
- Updated
- 15 Aug 2022
Overview
I2c rotary encoder is an open-source printed circuit board by palette-system, from the palette-system/i2c_rotary_encoder repository on GitHub, published under the MIT licence. It is a 2-layer board of 12.7 × 10.2 mm with 3 parts on 8 nets, routed with 29 tracks and 2 vias.
README
README.mdI2C ロータリーエンコーダ
説明
I2CロータリエンコーダはATTiny202を利用したロータリエンコーダの操作をI2C越しに読み込みをするための基板です。
(販売はDIP変換基板と、下記ファームウェアを書き込んだATTiny202を販売します)
ファームウェアソース
software/i2c_rotary_encorder/i2c_rotary_encorder.ino
ATTiny202 ピン
| 番号 | ピン | 接続 | 番号 | ピン | 接続 | |
|---|---|---|---|---|---|---|
| 1 | VDD | VCC | 8 | GND | GND | |
| 2 | PA6 | rotary1_B | 7 | PA3 | rotary0_B | |
| 3 | PA7 | rotary1_A | 6 | PA0 | rotary0_A | |
| 4 | PA1 | I2C SDA | 5 | PA2 | I2C SCL |
アドレス設定方法
プログラムの中に固定値でアドレスを指定しているため、ビルドして書込みを行わない限りアドレスの変更はできません。
デフォルトで 0x45 が書き込まれています。
メリット、デメリット
■ メリット
・マイコンのI/Oを消費しない
・アドレス変えていけば割といっぱい付けられる
■ デメリット
・実装するICと消費電力が増える
読み込み方
I2Cでアドレスを指定して1バイトリクエストするだけで取得できます。
最後にデータ取得した時から現在までにロータリエンコーダの操作があった場合に該当のビットが1になって帰ってきます。
一度取得するとまた0になり、ロータリエンコーダが操作されるまで0を取得します。
uint8_t r;
Wire.requestFrom(0x45, 1); // 指定したアドレスのATTiny202に1バイト分データ取得要求
r = Wire.read(); // 1バイトデータ受け取る
if (r & 0x08) # ロータリエンコーダ0左回り
if (r & 0x04) # ロータリエンコーダ0右回り
if (r & 0x02) # ロータリエンコーダ1左回り
if (r & 0x01) # ロータリエンコーダ1右回り
AZ-CORE、えむごっち等に接続する場合のAZTOOL手順
https://twitter.com/4py1/status/1559090793159458816 https://twitter.com/4py1/status/1559088312589365248
ATTiny202 開発環境の作り方
https://ameblo.jp/pta55/entry-12654450554.html
詳細情報
電圧: 1.8V ~ 5.5V
信号: I2C (~1.7MHz)
Similar boards
- 2 layers40 × 30 mm

- 2 layers51.9 × 16 mm

Passive2-rpi non standard adapter
hzeller/rpi-rgb-led-matrix
Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
3 parts4.4kGPL-2.0 - 2 layers16.3 × 16.3 mm

- 2 layers

Sub
atopile/atopile
Design circuit boards with code! ✨ Get software-like design reuse 🚀, validation, version control and collaboration in hardware; starting with electronics ⚡️
3 parts4kMIT - 2 layers85 × 30 mm

- 2 layers124.5 × 33.7 mm

- 2 layers10.5 × 83 mm

- 2 layers21.2 × 51.3 mm

Pico reset
hackclub/sprig
🍃 Learn to code by making games in a JavaScript web-based game editor.
3 parts1.1kMIT
Questions
How big is the I2c rotary encoder PCB?
It measures 12.7 × 10.2 mm and has 2 copper layers, 1.6 mm thick.
What parts does the I2c rotary encoder use?
3 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the I2c rotary encoder KiCad files?
From the palette-system/i2c_rotary_encoder repository on GitHub, at the commit this page was made from: the board is hardware/i2c_rotary_encoder.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the I2c rotary encoder design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).