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

How to Use LilyTiny: Examples, Pinouts, and Specs

Image of LilyTinyDesign with LilyTiny in Cirkit Designer

Introduction

The LilyTiny is a diminutive, programmable microcontroller board designed for integrating into wearable electronics and small projects. Its compact size and flexibility make it ideal for applications where space is at a premium and simplicity is key. The LilyTiny is often used in DIY e-textiles, interactive artwork, and educational projects to add functionality without the bulk of larger microcontroller boards.

Explore Projects Built with LilyTiny

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Cellular-Enabled IoT Device with Real-Time Clock and Power Management: A project utilizing LilyTiny in a practical application
Cellular-Enabled IoT Device with Real-Time Clock and Power Management

This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.

Open Project in Cirkit Designer

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 PB5 Reset and digital I/O, PWM
2 PB3 Analog input A3 and digital I/O, PWM
3 PB4 Analog input A2 and digital I/O
4 GND Ground
5 PB0 Analog input A0 and digital I/O, PWM
6 PB1 Analog input A1 and digital I/O
7 VCC Positive supply voltage
8 PB2 Analog input A1 and digital I/O

Usage Instructions

Integrating LilyTiny into a Circuit

  1. Powering the LilyTiny: Connect a power supply of 2.7V to 5.5V to the VCC and GND pins. Ensure that the power supply is stable and within the recommended voltage range to prevent damage.

  2. Programming the LilyTiny: The LilyTiny can be programmed using an external programmer. Connect the programmer to the ISP header pins on the LilyTiny, ensuring correct orientation and pin alignment.

  3. Connecting I/O Pins: Use the digital I/O pins to connect sensors, actuators, or other components. Remember that the LilyTiny can source or sink up to 40 mA per I/O pin.

  4. Using PWM and Analog Inputs: Some pins offer PWM functionality for controlling devices like LEDs or motors with variable power. Analog input pins can be used to read signals from sensors.

Important Considerations and Best Practices

Example Code for Arduino UNO

// Blink an LED connected to pin 0 of the LilyTiny
int ledPin = 0; // LED connected to digital pin 0

void setup() {
  pinMode(ledPin, OUTPUT); // Set the LED pin as an output
}

void loop() {
  digitalWrite(ledPin, HIGH); // Turn the LED on
  delay(1000);                // Wait for a second
  digitalWrite(ledPin, LOW);  // Turn the LED off
  delay(1000);                // Wait for a second
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips

FAQs

Q: Can I use the Arduino IDE to program the LilyTiny? A: Yes, you can program the LilyTiny using the Arduino IDE by selecting the ATtiny25/45/85 board and choosing the appropriate programmer.

Q: What is the maximum voltage that can be applied to the LilyTiny? A: The maximum voltage that should be applied to the VCC pin is 5.5V.

Q: How can I extend the number of I/O pins on the LilyTiny? A: You can use multiplexers or shift registers to increase the number of I/O pins available for your project.

Q: Can the LilyTiny be used in commercial products? A: Yes, the LilyTiny is suitable for use in commercial products, but ensure that your design adheres to all relevant safety and regulatory standards.