Skip to the content
PCBKitNew board
2 layers85.7 × 85.7 mmAttiny85 time switch, the printed circuit board in 3D

Attiny85 time switch

UCSIG/attiny85_time_switch1

Low-power time switch using the ATtiny85 microcontroller.

Size
85.7 × 85.7 mm
Copper layers
2
Thickness
1.6 mm
Parts
32
Nets
19
Pads
90
Tracks, vias
157, 2
Pours
2
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
10 May 2023
Updated
16 Aug 2025

Overview

Attiny85 time switch is an open-source printed circuit board by UCSIG, from the UCSIG/attiny85_time_switch repository on GitHub, published under the MIT licence. It is a 2-layer board of 85.7 × 85.7 mm with 32 parts on 19 nets, routed with 157 tracks and 2 vias.

It is built around the ATTINY85V-10PU, FG18X5R1H105KRT06 and BSS84AK,215(ES), with the TL1105AF160Q and PMV20XNER among its other parts. Its parts include 8 connectors, 7 capacitors, 7 resistors, 2 ICs and 2 diodes. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

5

README

README.md

ATtiny85 Time Switch

Low-power 12/24V time switch with undervoltage protection using the internal oscillator of the ATtiny85

The aim of this project is to switch a load on and off in regular time intervals. The device itself consumes only very little sleep current (~19.6uA on average).
The device also monitors the supply voltage and turns off the load if the supply drops lower than the defined threshold.

PCB 3D View

Features

  • Clock calibration algorithm with values stored in the internal eeprom
  • Supply voltage monitoring
  • Jumper configuration for feature selection (supply voltage monitoring + time switch/only supply voltage monitoring)
  • Jumper configuration for undervoltage threshold selection (12/24V)
  • Low current consumption (~19.6uA)

Specifications

TypeValue
Average Current Consumption19.6uA
Maximum Load Current5.7A (cont.)
Supply Voltages12/24V
Switch TypeLow-Side

Detailed Description

There are three jumpers which must be set to either select the 12V or the 24V configuration. This changes the on/off times as well as the undervoltage thresholds.
Every time the jumper configuration is changed, a reset must be performed for the changes to take effect.

Upon coming out of reset, the device reads its clock calibration values stored in the internal eeprom to provide accurate timings for the time switch.

The device wakes up periodically and immediately goes back to sleep. That way, very long deep sleep periods can be reached.
The ATtiny85 runs off of the internal 128kHz low speed oscillator during deep sleep. The watchdog timer wakes up the device every 8.192s (the maximum watchdog timeout) and the ATtiny increments a counter variable. If it surpasses a pre-defined threshold, the load switch changes state from on->off or the other way round.

Every 15 minutes it also measures the supply voltage and compares it to a pre-defined threshold. If the supply is lower than that threshold, the load is switched off until the device is reset.
The maximum load current is determined by the sizing of the n-fet Q1. With the n-fet PMV20XNER one can switch up to 5/7A. The load is switched with a low side switch.

The internal 8MHz oscillator of the ATtiny85 is used as the primary clock source. However, the clock frequency can vary by up to ±15%. In order to get accurate on/off times from the time switch, this internal oscillator must be calibrated. A detailed description of how to do that can be found here.

Mechanical

The pcb is designed to fit in the EL111 enclosure by IDE electric. It is screwed into the case using four M4 screws. The case itself is rated IP65-67. Its dimensions are 113x113x68 mm (Height x Width x Depth).

Project structure

The code resides in the folder src and include. PlatformIO is chosen as the build environment. The best way to program the ATtiny85 is to use PlatformIO and VS Code as the IDE.
The pcb project can be found under pcb_project/attiny85_time_switch. The relevant code snippets for changing the timing values and the undervoltage thresholds are at the top of main.cpp. The gerber files are in pcb_project/attiny85_time_switch/fabrication_outputs/.

Parts

32
QtyValueFootprintReferences
4100nCapacitor_THT:C_Disc_D6.0mm_W2.5mm_P5.00mmC3, C4, C5, C7
31uCapacitor_THT:C_Disc_D3.8mm_W2.6mm_P2.50mmC1, C2, C6
3Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3, J5, J6
210kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR4, R7
21MResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR3, R5
2Conn_01x02_PinConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ7, J8
2Screw_Terminal_01x02attiny85_time_switch:TerminalBlock_4Ucon_1x02_P3.50mm_VerticalJ1, J4
10751.0052attiny85_time_switch:0751.0052_FuseF1
1100kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1
122kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR2
13k3Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR6
1AP7383-50W5-7Package_TO_SOT_SMD:TSOT-23-5_HandSolderingU2
1ATtiny85V-10PPackage_DIP:DIP-8_W7.62mmU1
1BSS84AKPackage_TO_SOT_SMD:TSOT-23Q2
1Check FETButton_Switch_THT:SW_PUSH_6mm_H5mmSW2
1Conn_02x03_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x03_P2.54mm_VerticalJ2
1DDiode_THT:D_A-405_P7.62mm_HorizontalD1
1EL111attiny85_time_switch:Case EL111Case1
1LEDLED_THT:LED_D5.0mmD2
1PMV20XNERPackage_TO_SOT_SMD:TSOT-23Q1
1ResetButton_Switch_THT:SW_PUSH_6mm_H5mmSW1

Questions

How big is the Attiny85 time switch PCB?

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

What parts does the Attiny85 time switch use?

32 parts, built around the ATTINY85V-10PU, FG18X5R1H105KRT06, BSS84AK,215(ES) and TL1105AF160Q. 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 Attiny85 time switch KiCad files?

From the UCSIG/attiny85_time_switch repository on GitHub, at the commit this page was made from: the board is pcb/attiny85_time_switch_rev1/attiny85_time_switch.kicad_pcb and its schematic pcb/attiny85_time_switch_rev1/attiny85_time_switch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Attiny85 time switch 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).

Similar boards

  • 2 layers99.1 × 99.1 mmVent, the printed circuit board in 3D

    Vent

    pandemiaplan/OP-Vent

    A Simple, Open-Source Ventilator using a Proportional Solenoid Valve

    113 parts5
  • 2 layers25 × 37.3 mmTheLock schematics, the printed circuit board in 3D

    TheLock schematics

    bitraf/toollock

    Each lock has a key with a matching key pattern. The key is physically attached to the tool using a wire. An optical sensor detects that the right key is used.

    14 parts
  • 4 layers87.1 × 67.4 mmRFclockgen, the printed circuit board in 3D

    RFclockgen

    Jjbinstock/RF-Clock-Generator

    A dual channel, tunable RF clock generator PCB project

    75 parts
  • 2 layers74 × 25 mmRakieta, the printed circuit board in 3D

    Rakieta

    PTR-projects/PTR_arecorder

    A compact, high-g flight data recorder designed specifically for model and amateur rocketry. The Arecorder logs 3-axis acceleration and orientation data to an SD card during launch, ascent, apogee, and recovery.

    83 partsMIT
  • 2 layers60 × 150 mmPhone, the printed circuit board in 3D

    Phone

    TheEinfachFelix/CampPhone

    Warum habe ich mich dagegen entschieden, das Sim Modul selber zu implementieren? Ich habe kein Chip gefunden, der günstiger als das fertige Modul war, und ein Datenblatt in Englischer Sprache hat.

    137 parts
  • 2 layers105.5 × 60.5 mmBuzzer Box, the printed circuit board in 3D

    Buzzer Box

    TheEinfachFelix/GameMaster

    A Framework that alows you to easely program gameshows

    77 parts
  • 2 layers95.9 × 100 mmPipeWatch, the printed circuit board in 3D

    PipeWatch

    TheEinfachFelix/PipeWatch

    64 parts