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

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
4
Nets
12
Pads
29
Tracks, vias
80, 8
Pours
2
Routed
Yes
KiCad
KiCad 4
Created
23 Apr 2018
Updated
15 Oct 2019

Overview

ATTINYFreqSet 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 4 parts on 12 nets, routed with 80 tracks and 8 vias.

Its parts include 2 connectors, 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

4
QtyValueFootprintReferences
1ATTINY85-PHousings_DIP:DIP-8_W7.62mm_LongPadsIC1
1BNCConnectors_TE-Connectivity:BNC_Socket_TYCO-AMP_LargePadsP1
1CONN_02X05Pin_Headers:Pin_Header_Straight_2x05_Pitch2.54mmP2
1Rotary_Encoder_SwitchMatthewLib:RotEncSW1

Questions

What parts does the ATTINYFreqSet use?

4 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 ATTINYFreqSet KiCad files?

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

Can I use the ATTINYFreqSet 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 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.

    5 parts1GPL-3.0

Similar boards

  • 2 layers18.5 × 26 mm24g2usb rp2350zero, the printed circuit board in 3D

    24g2usb rp2350zero

    joypad-ai/joypad-os

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

    4 parts1.7kApache-2.0
  • 2 layers116 × 33 mm966595-1 and 963356-1, the printed circuit board in 3D

    966595-1 and 963356-1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    4 parts1.2k
  • 2 layers19 × 18 mmDaughter board, the printed circuit board in 3D

    Daughter board

    hackclub/OnBoard

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

    4 parts915
  • 2 layers24.8 × 24.8 mmNrf24 breakout, the printed circuit board in 3D

    Nrf24 breakout

    tardate/LittleArduinoProjects

    a collection of "Little Electronic & Arduino Projects", most involving electronics or an Arduino in one way or another!

    4 parts803MIT
  • 2 layers26 × 20 mmCap chain, the printed circuit board in 3D

    Cap chain

    drandyhaas/KiCadRoutingTools

    A set of Python/Rust tools to aid routing in KiCad

    4 parts744MIT
  • 2 layers34.7 × 20 mmXG Station Power MSI, the printed circuit board in 3D

    XG Station Power MSI

    osy/XG_Mobile_Station

    Open source eGPU dock for ROG Ally and ROG Flow

    4 parts712CC-BY-4.0
  • 2 layers20.3 × 24.5 mmJack power input, the printed circuit board in 3D

    Jack power input

    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.

    4 parts546MIT