Skip to the content
PCBKitNew board
2 layersATTINY841Version, 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
6
Nets
21
Pads
33
Tracks, vias
13, 0
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
23 Apr 2018
Updated
15 Oct 2019

Overview

ATTINY841Version 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 6 parts on 21 nets, routed with 13 tracks and 0 vias.

It is built around the ATTINY841-SSU and WS2812B. Its parts include 2 capacitors, 1 IC, 1 diode, 1 switch and 1 crystal. It belongs with the interfaces and adapters boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

2

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

6
QtyValueFootprintReferences
2CCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC1, C2
1ATtiny841-SSUPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU1
1CrystalCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mm_HandSolderingY1
1Rotary_Encoder_SwitchMatthewFootprints:RotaryEncoder_Alps_EC12E-Switch_Vertical_H20mmSW1
1WS2812BLED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mmD1

Questions

What parts does the ATTINY841Version use?

6 parts, built around the ATTINY841-SSU and WS2812B. 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 ATTINY841Version KiCad files?

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

Can I use the ATTINY841Version 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 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
  • 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 layers33 × 51.6 mmTpms silencer, the printed circuit board in 3D

    Tpms silencer

    gcormier/tpms_silencer

    Spoof TPMS sensors to prevent blinking lights/etc

    27 parts20
  • 2 layersHeadlamp, the printed circuit board in 3D

    Headlamp

    kajusK/Darkstar-Mk.II

    High-power bomb-proof headlamp for caving

    60 parts7
  • 2 layers65 × 56 mmRaspberryPi UPS HAT, the printed circuit board in 3D

    RaspberryPi UPS HAT

    gvoigtlaender/RaspberryPi_UPS_HAT

    RaspberryPi UPS HAT

    63 parts4GPL-3.0
  • 2 layers29.8 × 20.3 mmFranzininho tiny841, the printed circuit board in 3D

    Franzininho tiny841

    Franzininho/Franzininho-Tiny

    Repositório para Franzininho Tiny - Uma placa com attiny841 da família Franzinho

    22 parts3
  • 2 layers65 × 56 mmPi supercap ups, the printed circuit board in 3D

    Pi supercap ups

    mairas/pi-super-ups

    Power Monitor for Raspberry Pi and SignalK

    92 parts2BSD-3-Clause
  • 2 layers26.7 × 20.3 mmIsp, the printed circuit board in 3D

    Isp

    captdam/AVR441ISP

    24 parts1
  • 2 layers49.5 × 49.5 mmPcb workshop sensor, the printed circuit board in 3D

    Pcb workshop sensor

    BarnabyShearer/pcb_workshop_sensor

    Simple lowpower MSP and Temp sensor PCB for a PCB design workshop.

    31 parts
  • 2 layers49.5 × 49.5 mmSignalsignal, the printed circuit board in 3D

    Signalsignal

    BarnabyShearer/signalsignal

    PCB for cheep high-density IO.

    32 parts