Skip to the content
PCBKitNew board
2 layersRotaryEncoderAttiny85, the printed circuit board in 3D

RotaryEncoderAttiny85

MatthewAHarvey/SmartEncoder1

Arduino friendly, serially addressable, ATTINY85 based rotary encoders. Reduce the pin count from 3 * n where n is the number of encoders (pins A, B and button C) to 2 total. Serial in, Serial out. Use Hardware Serial, AltSoftSerial or Software Serial

Copper layers
2
Thickness
1.6 mm
Parts
5
Nets
8
Pads
23
Tracks, vias
37, 0
Pours
2
Routed
Yes
KiCad
KiCad 4
Created
23 Apr 2018
Updated
15 Oct 2019

Overview

RotaryEncoderAttiny85 is an open-source printed circuit board by MatthewAHarvey, from the MatthewAHarvey/SmartEncoder repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board with 5 parts on 8 nets, routed with 37 tracks and 0 vias.

Its parts include 2 connectors, 1 capacitor, 1 IC and 1 switch. It belongs with the interfaces and adapters boards and the AVR (ATmega, ATtiny) boards of this library.

README

README.md

SmartEncoder

Arduino friendly, serially addressable, ATTINY85 based rotary encoders. Reduce the pin count from 3 * n where n is the number of encoders (pins A, B and button C) to 2 total. Serial in, Serial out. Use Hardware Serial, AltSoftSerial or Software Serial

Handling lots of encoders at the same time can be a challenge. For example, in our use case, we had 15 encoders attached to one Arduino Mega. After all the connections to other peripherals, we ran out of pins. The encoders had to be polled since there are not enough interrupts. Our solution is to offload the handling of the encoders to dedicated ATTINY85 chips. These then talk asynchronous serial at 125000 baud in a ring with the master arduino. The arduino now only needs 2 pins: 1 serial tx and 1 serial rx. At the moment this is limited to one of the hardware serial ports but tests show it's possible with software serial implementations.

In order for this to work, the ATTINY85s' clock frequencies must be set more accurately than straight from the factory.

Installation instructions:

  1. First, the ATTINYs must be frequency calibrated. We do this by burning the arduino bootloader on to an ATTINY and uploading the FreqCal sketch. We use the ATTINYCore which must be installed in the Arduino IDE. We output a square wave from pin 6 and observe it using an oscilloscope. An attached rotary encoder is then used to adjust this signal until it is as close to 1 MHz as possible. Pressing the encoder button saves the current OSCCAL register value to the EEPROM.

Arduino IDE settings for ATTINY85: ATTINY85 Settings

Schematic for the FreqCal rotary encoder programme: Schematic

  1. Now upload the ATTINY85RotEncCode sketch to each of the ATTINYs.

  2. The example SEHandlerTest programme can be uploaded to the master arduino mega.

To Do:

  1. Add individual encoder direction swap command that can be called any time after init().
  2. Add global encoder direction swap at creation time that tells all the individual encoders to swap direction at init time.

Parts

5
QtyValueFootprintReferences
2CONN_01X03Pin_Headers:Pin_Header_Straight_1x03_Pitch2.54mmP1, P2
1ATTINY85-PHousings_SOIC:SO-8_5.3x6.2mm_Pitch1.27mmIC1
1CCapacitors_SMD:C_0805_HandSolderingC1
1Rotary_Encoder_SwitchMatthewLib:RotEncSW1

Questions

What parts does the RotaryEncoderAttiny85 use?

5 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 RotaryEncoderAttiny85 KiCad files?

From the MatthewAHarvey/SmartEncoder repository on GitHub, at the commit this page was made from: the board is PCBs/RotaryEncoderAttiny85_SOIC/RotaryEncoderAttiny85.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the RotaryEncoderAttiny85 design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

More from MatthewAHarvey/SmartEncoder

3
  • 2 layersRotaryEncoderAttiny85, the printed circuit board in 3D

    RotaryEncoderAttiny85

    MatthewAHarvey/SmartEncoder

    Arduino friendly, serially addressable, ATTINY85 based rotary encoders. Reduce the pin count from 3 * n where n is the number of encoders (pins A, B and button C) to 2 total. Serial in, Serial out.

    9 parts1GPL-3.0
  • 2 layersATTINY841Version, the printed circuit board in 3D

    ATTINY841Version

    MatthewAHarvey/SmartEncoder

    Arduino friendly, serially addressable, ATTINY85 based rotary encoders. Reduce the pin count from 3 * n where n is the number of encoders (pins A, B and button C) to 2 total. Serial in, Serial out.

    6 parts1GPL-3.0
  • 2 layersATTINYFreqSet, the printed circuit board in 3D

    ATTINYFreqSet

    MatthewAHarvey/SmartEncoder

    Arduino friendly, serially addressable, ATTINY85 based rotary encoders. Reduce the pin count from 3 * n where n is the number of encoders (pins A, B and button C) to 2 total. Serial in, Serial out.

    4 parts1GPL-3.0

Similar boards

  • 2 layers98 × 27 mmXy limit, the printed circuit board in 3D

    Xy limit

    opulo-inc/lumenpnp

    The LumenPnP is an open source pick and place machine.

    5 parts3.7k
  • 2 layers21 × 33 mm24g2usb pico2w, the printed circuit board in 3D

    24g2usb pico2w

    joypad-ai/joypad-os

    Universal controller firmware for building adapters, dongles, and custom controllers.

    5 parts1.7kApache-2.0
  • 2 layers53.2 × 59.6 mmA10 OLinuXino Lime Rev B SHIELD TEMPLATE, the printed circuit board in 3D

    A10 OLinuXino Lime Rev B SHIELD TEMPLATE

    OLIMEX/OLINUXINO

    OLINUXINO is Open Source / Open Hardware, low cost from EUR 24 Linux Industrial grade Single Board Computer capable to operate -25+85C

    5 parts1.5k
  • 2 layers30 × 11 mmMain control board servo tester, the printed circuit board in 3D

    Main control board servo tester

    jamro/tiny-engineer

    A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.

    5 parts1.1k
  • 2 layers78.8 × 35.3 mmKiCadTest, the printed circuit board in 3D

    KiCadTest

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    5 parts915
  • 2 layers50 × 23 mmMiniCircuits LTCC, the printed circuit board in 3D

    MiniCircuits LTCC

    VanceVagell/kv4p-ht

    Open source handheld ham radio project KV4P-HT

    5 parts828GPL-3.0
  • 2 layers20.3 × 15.2 mmL0 light sensor, the printed circuit board in 3D

    L0 light sensor

    Luos-io/luos_engine

    Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

    5 parts546MIT