Skip to the content
2 layers27.9 × 27.9 mmOpto counter, the printed circuit board in 3D

Universal infrared proximity sensor/counter of events

Size
27.9 × 27.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
13
Nets
16
Pads
42
Tracks, vias
88, 3
Pours
2
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
22 Oct 2023
Updated
9 Jun 2026

Overview

Opto counter is an open-source printed circuit board by ppetr, from the ppetr/hw-opto-counter repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 27.9 × 27.9 mm with 13 parts on 16 nets, routed with 88 tracks and 3 vias.

It is built around the ATTINY3224-SSU, TSSP6038TR and TSAL4400. Its parts include 3 resistors, 3 connectors, 2 ICs, 2 diodes and 1 capacitor. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

3

README

README.md

Universal IR optical, directional proximity detector/counter with TWI (I²C) interface

Disclaimer: This is not an officially supported Google product.

3D model of the board

The board uses two IR LEDs with a modulated signal (both either 38KHz or 56KHz, depending on the receiver type) whose light reflects off objects in front of the device into an IR receiver.

Using two LEDs allows to determine an approximate position (or direction of movement) of an object in one dimension. Modulating the signal significantly reduces interference from natural IR light sources.

The microcontroller (ATtiny3224) varies the signal strength to compute the strength of the reflected signal using the binary search algorithm.

The measured values are made available through I²C (subordinate).

Event counter

In addition to reporting current values of reflections from both LEDs, the microcontroller also counts the number of times the reflection quickly changes (which we call "events"). These events are defined using two parameters:

  • Exponential moving average smoothing factor ("half-life"), which computes the baseline signal to compare against. The default value is half-life of 10s.
  • Delta factor [0..1]. An event is triggered when the signal differs more than the delta factor from its exponential moving average.

There are the following event types that are counted independently:

  1. Signal reflected from LED1 crosses the delta boundary and returns while LED2's signal remained within.
    text
    LED1:  ___|‾‾‾|___
    LED2:  ___________
  2. Similarly the other way around.
  3. LED1's signal crossed outside the delta boundary followed by LED2's signal crossing outside. This captures the situation when an object is moving in the direction LED1->LED2.
    text
    LED1:  __|‾‾‾|____
    LED2:  ____|‾‾‾|__
  4. Similarly the other way around.

Status

Development of a prototype.

Contributions

Please see Code of Conduct and Contributing.

Parts

13
QtyValueFootprintReferences
24k7Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1, R3
2MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2
2TSAL4400LED_THT:LED_D3.0mm_IRBlackD1, D2
1100nFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC1
1220Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR2
1ATtiny3224-SSPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU1
1IR-RECConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ1
1TSSP6038opto-counter:TSS60xxU2
1UPDIConnector_JST:JST_XH_S3B-XH-A_1x03_P2.50mm_HorizontalJ3
1qwiicConnector_JST:JST_XH_S4B-XH-A_1x04_P2.50mm_HorizontalJ2

Similar boards

  • 2 layers47 × 20.6 mmIR Ring, the printed circuit board in 3D

    IR Ring

    ItzJannis/CoRoSoN-Package_Draft

    Draft version to the official CoRoSoN-Kit.

    29 parts1GPL-3.0
  • 2 layers56.7 × 25.4 mmBatteryMonitorATTiny3224, the printed circuit board in 3D

    BatteryMonitorATTiny3224

    ieb/BatterySensor

    A Modbus RTU Battery Current and Voltage sensor board based Attiny3224, MAX485, MAX9918 chips.

    24 parts1
  • 2 layers21.1 × 19.6 mmSoic14-bb, the printed circuit board in 3D

    Soic14-bb

    jaco-pixeldump/attiny-soic-14-barebone-breakout-board

    A compact, breadboard-friendly breakout adapter PCB for 14-pin SOIC Microchip ATtiny microcontrollers (such as ATtiny3224, ATtiny1624, ATtiny824, ATtiny424, as well as 1-series and 0-series parts like ATtiny1614…

    5 parts1MIT
  • 2 layers79 × 80 mmDiy esc, the printed circuit board in 3D

    Diy esc

    Siddharth2308/esc

    79 parts1
  • 2 layers93 × 93 mmAMN TopPcb, the printed circuit board in 3D

    AMN TopPcb

    hschack/ANM_TOP_PCB

    31 parts
  • 2 layers62.5 × 48.5 mmVacSensor, the printed circuit board in 3D

    VacSensor

    hschack/ZB3245TSS_OPENPNP

    More to come Link Mellow Fly Super8Pro https://teamgloomy.github.io/flysuper8proh723general35.html

    25 parts
  • 2 layers64 × 78 mmActuator board, the printed circuit board in 3D

    Actuator board

    ieb/autopilot

    An ML Autopilot designed and written almost entirely by Google AntiGravity.

    37 parts

Questions

How big is the Opto counter PCB?

It measures 27.9 × 27.9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Opto counter use?

13 parts, built around the ATTINY3224-SSU, TSSP6038TR and TSAL4400. 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 Opto counter KiCad files?

From the ppetr/hw-opto-counter repository on GitHub, at the commit this page was made from: the board is hw/opto-counter.kicad_pcb and its schematic hw/opto-counter.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Opto counter design in my own project?

Its repository publishes it under the Apache-2.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).