Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ATtiny-Controlled LED Blinker Circuit

View and Edit Project In Cirkit DesignerImage of ATtiny-Controlled LED Blinker Circuit

Circuit Documentation

Summary of the Circuit

This circuit is designed to control an LED using an ATtiny microcontroller. The LED is turned on by the microcontroller via one of its GPIO pins. A resistor is included in series with the LED to limit the current and protect the LED from damage. The circuit is powered by a 3.3V battery, which also supplies power to the ATtiny microcontroller.

Component List

ATtiny Microcontroller

Resistor

LED: Two Pin (red)

3.3V Battery

Wiring Details

ATtiny Microcontroller

Resistor

LED: Two Pin (red)

3.3V Battery

Documented Code

ATtiny Microcontroller Code

File: sketch.ino

/*
 * This Arduino Sketch is for an ATtiny microcontroller.
 * It turns on an LED connected to pin 4 (PB4) of the ATtiny.
 */

void setup() {
  // Initialize pin 4 (PB4) as an output
  pinMode(3, OUTPUT);
  // Turn on the LED connected to pin 4
  digitalWrite(3, HIGH);
}

void loop() {
  // No repeated actions needed
}

This code configures pin PB4 (referred to as pin 3 in the Arduino environment) of the ATtiny microcontroller as an output and sets it to a high state, which turns on the connected LED. The loop() function is empty as no repeated action is required; the LED remains on as long as the microcontroller is powered.