AED 23.00
Description
The Digispark ATtiny85 USB REV3 is a compact and cost-effective development board that provides USB connectivity and is compatible with the Arduino IDE. It offers a range of input/output capabilities and is ideal for small-scale embedded projects requiring USB communication.
Package Includes:
- 1 x Digispark ATtiny85 USB REV3
Features:
- ATtiny85 Microcontroller: The board is based on the ATtiny85 microcontroller, which offers 8KB of flash memory for program storage and 512 bytes of SRAM for data storage.
- USB Connectivity: The board features a built-in USB interface, allowing it to be directly connected to a computer for programming and communication. This eliminates the need for external programmers or additional hardware.
- Arduino Compatibility: The Digispark ATtiny85 USB REV3 is fully compatible with the Arduino IDE, enabling users to easily write, upload, and debug code using the Arduino programming language. It supports a wide range of Arduino libraries and examples.
- I/O Pins: The board provides 6 general-purpose I/O pins, which can be used for digital input/output or analog input. These pins can be configured to interface with various sensors, actuators, and other external components.
- Power Options: The board is powered via USB and does not require any external power supply. It has a built-in voltage regulator that supports a wide input voltage range (5V-16V), allowing it to be powered from various sources.
- Compact Size: The Digispark ATtiny85 USB REV3 has a small form factor, making it suitable for projects with space constraints or applications where portability is important.
- Low Cost: The board offers an affordable solution for embedded projects, making it accessible to hobbyists, students, and professionals on a tight budget.
- Programmable: Users can easily program the board using the Arduino IDE and take advantage of the vast Arduino ecosystem, including libraries, examples, and community support.
- Standalone Operation: The board can function as a standalone device without the need for additional components. It can be used for a wide range of applications, including robotics, automation, IoT, and more.
- Open-Source: The design and schematics of the Digispark ATtiny85 USB REV3 are open-source, allowing users to modify and customize the board to suit their specific needs.
Description:
The Digispark ATtiny85 USB REV3 is a small and compact development board based on the ATtiny85 microcontroller. It is designed to provide a low-cost and versatile solution for embedded projects that require USB connectivity. The board includes a built-in USB interface, allowing it to be directly connected to a computer for programming and communication. Despite its small size, the ATtiny85 microcontroller offers a surprising amount of functionality. It features 8KB of flash memory for program storage, 512 bytes of SRAM for data storage, and 6 general-purpose I/O pins for connecting to external components. The board supports a wide range of digital and analog input/output capabilities, making it suitable for various applications. One of the key features of the Digispark ATtiny85 USB REV3 is its compatibility with the Arduino IDE. This allows developers to leverage the vast Arduino ecosystem and programming language to easily write and upload code to the board. It also supports various libraries and examples, simplifying the development process for both beginners and experienced users. The board is powered via USB and does not require any external power supply. It can be used as a standalone device or integrated into larger projects. Its small form factor makes it suitable for projects with space constraints or where portability is a priority.
Principle of Work:
the Digispark ATtiny85 USB REV3 board operates by running user-programmed code on the ATtiny85 microcontroller. The board communicates with a computer via USB and can emulate USB devices. It provides I/O pins for interfacing with external components, is powered via USB, and is compatible with the Arduino IDE for easy development:
- Microcontroller Operation: At the heart of the board is the ATtiny85 microcontroller. It runs the code written by the user and controls the behavior of the board. The microcontroller executes instructions stored in its flash memory and uses the SRAM for temporary data storage during program execution.
- USB Communication: The board features a built-in USB interface, which serves two main purposes. First, it allows the board to be connected directly to a computer for programming and communication. Second, it enables the board to emulate a USB device, such as a keyboard, mouse, or serial port, depending on the user's program. This USB communication is facilitated by the USB firmware running on the ATtiny85.
- Programming: The Digispark ATtiny85 USB REV3 is programmable using the Arduino IDE. Users write code in the Arduino programming language, which is a simplified version of C++, and upload it to the board via USB. The Arduino IDE handles the compilation and conversion of the code into a format that the ATtiny85 can understand. The compiled code is then transferred to the board, where it is stored in the microcontroller's flash memory.
- Input/Output: The board provides 6 general-purpose I/O pins that can be configured as either digital input/output or analog input. These pins can be used to interface with various external components such as sensors, actuators, LEDs, and more. The microcontroller can read digital or analog signals from these pins and perform actions accordingly, or it can output signals to control external devices.
- Power Supply: The Digispark ATtiny85 USB REV3 is powered via USB, which provides the necessary voltage for the board's operation. The board has a built-in voltage regulator that supports a wide input voltage range, allowing it to be powered from various sources. The voltage regulator ensures that the microcontroller and other components receive a stable and regulated power supply.
- Arduino Compatibility: The board is fully compatible with the Arduino ecosystem, including the Arduino IDE, libraries, and examples. This compatibility simplifies the development process for users familiar with Arduino, as they can leverage existing resources and community support.
Pinout of the Module:
- P0: I2C SDA, PWM (connected to on-board LED in previous revisions)
- P1: PWM (connected to on-board LED in revisions 2, 3, and 4)
- P2: I2C SCK, analog input
- P3: Analog input, USB positive
- P4: PWM, analog input, USB
- P5: Analog input (outputs 3V when set to HIGH)
Digital I/O:
- The board has 6 digital input/output pins, with 4 of them capable of PWM output. These pins can be configured as either digital inputs to read logic values (0 or 1), or digital outputs to control modules like LEDs or relays. Functions such as pinMode(), digitalWrite(), and digitalRead() can be used to interact with these pins.
Analog Pins:
- The board has 4 analog input pins.
GND:
- Ground pins.
AREF:
- A reference voltage (0-5V) for analog inputs. It can be configured using analogReference() and sets the top value of the analog input range.
SDA and SCL:
- Pins for I2C communication.
USB Connection:
- The board features a USB interface with software USB functionality using the V-BUS library. It emulates a USB port, even though there is no serial converter on the board. To connect the board to a PC, the necessary driver must be installed.
On-Board LED:
- There is a built-in LED driven by digital pin 0. When the pin is set to HIGH, the LED turns on, and when the pin is set to LOW, the LED turns off.
Voltage Regulator:
- The board includes a voltage regulator that converts an external DC input voltage of 7-12V to a regulated 5V DC. This 5V power is then distributed to the processor and other components on the board.
Power Pin 5V:
- Output pin providing a 5V voltage.
Vin:
- This pin allows you to supply external DC power input of 7-12V to the board.
Power LED Indicator:
- The power LED serves as an indicator. If it is on, it indicates that the circuit board is correctly powered. If it is off, there may be a power connection issue.
Applications:
- Prototyping and Electronics Projects: The board is widely used in prototyping and DIY electronics projects. Its compact size, USB connectivity, and compatibility with the Arduino IDE make it suitable for building and testing small-scale electronic systems.
- Home Automation: The Digispark ATtiny85 board can be utilized in home automation projects to control and monitor devices such as lights, fans, sensors, and actuators. With its I/O pins and USB connectivity, it can interface with various home automation components and provide automation capabilities.
- Internet of Things (IoT): The board can be integrated into IoT projects where small-sized, low-power devices are required. It can connect to sensors, collect data, and communicate with other devices or cloud platforms using the USB interface or external modules.
- Robotics: The Digispark ATtiny85 board can be used as a controller in small-scale robotic projects. It can interface with motors, sensors, and other robotic components to control the robot's movements and behaviors.
- Wearable Electronics: The board is suitable for wearable electronics projects due to its small form factor and low power requirements. It can create wearable devices such as smartwatches, fitness trackers, and interactive clothing, leveraging its I/O pins to interface with sensors and actuators.
- Educational Projects: The board is often employed in educational settings to teach programming, electronics, and embedded systems. Its simplicity, Arduino compatibility, and affordable cost make it an ideal choice for introducing students to the world of electronics and programming.
- Art and Interactive Installations: Artists and makers can use the board to create interactive installations, kinetic sculptures, and interactive art projects. It's small size and USB connectivity allow for seamless integration into artistic creations.
- Sensor Data Logging: With its analog input pins and USB connectivity, the board can be used for data logging applications. It can read data from various sensors, such as temperature, humidity, or light sensors, and log the data to a computer or SD card via the USB interface.
Circuit:
We will not need any circuit, in this testing code, we will rely on the built-in LED on the P0 pin.
Library:
Connecting the Digispark ATtiny85 USB REV3 board for the first time:
-
Open the Arduino IDE:
- If you haven't done so already, download the Arduino IDE from the software page.
-
Connect the board to your computer:
- Ensure the board is connected to your computer using a USB cable.
-
Add Additional Boards Manager URLs:
- Open the Arduino IDE and go to File → Preferences.
- In the Preferences dialog box, find the "Additional Boards Manager URLs" box.
- Paste the following URL: http://digistump.com/package_digistump_index.json
- Click OK to save the preferences.
-
Install Digispark Board Support Package:
- In the Arduino IDE, go to Tools → Board → Boards Manager.
- In the Boards Manager window, search for "Digispark" in the search field.
- Look for "Digistump AVR Boards" in the search results and click on the Install button.
- Wait for the installation to complete and then click Close.
-
Install the Digispark Windows 10 Drivers:
- Download the Digispark Digistump Drivers for Windows.
- Visit the official Digistump website: http://digistump.com/
- Look for the Downloads section on the website.
- Locate the Digispark Digistump Drivers specifically designed for Windows.
- Click on the download link provided for the Windows drivers.
- Save the downloaded file to a location on your computer where you can easily access it.
- Extract the downloaded file (Digistump.Drivers.zip).
- Run the appropriate installer file based on your Windows version: DPinst64.exe for 64-bit or DPinst.exe for 32-bit.
- Follow the prompts to install the Digispark drivers.
- If prompted with a dialog displaying "Windows can't verify the publisher of this driver software," click Install this driver software anyway.
- Download the Digispark Digistump Drivers for Windows.
-
Select the Board:
- In the Arduino IDE, go to Tools → Board and select Digispark (Digispark Rev3) from the list.
- Note that the Programmer and Port selections do not matter for this step.
-
Upload a sketch:
- Write your code or open a Digispark example sketch in the Arduino IDE.
- Click on the upload button (do not connect the Digispark ATtiny85 to your PC yet).
- The status box will prompt you to plug in your Digispark. At this point, connect the Digispark to your computer or unplug and replug it if already connected.
- The IDE will display the upload progress and then immediately run your code on the Digispark.
Note: If you unplug the Digispark and reconnect it or attach it to another power source, there will be a 5-second delay before the programmed code starts running. This delay is the Digispark checking if you are trying to program it again.
Code:
A sample code for the Digispark ATtiny85 USB REV3 board that demonstrates how to blink an LED connected to pin P0 (also known as digital pin 0) with a delay of 1 second between on and off states.
// Pin declaration const int LED_PIN = 0; // Pin P0 as LED output void setup() { pinMode(LED_PIN, OUTPUT); // Set LED_PIN as output } void loop() { digitalWrite(LED_PIN, HIGH); // Turn on the LED delay(1000); // Delay for 1 second digitalWrite(LED_PIN, LOW); // Turn off the LED delay(1000); // Delay for 1 second }
By uploading this code to the Digispark ATtiny85 board, you should observe the LED connected to pin P0 blinking on and off with a 1-second interval. You can modify the delays or the pin assignment as per your requirements for different blinking patterns or connect the LED to a different pin.
How the code works:
- we declare a constant
LED_PIN
and set it to 0. This represents pin P0, which is connected to the LED. - In the
setup()
function, we usepinMode()
to set theLED_PIN
as an output pin. This configures the pin to send signals to the LED. - The
loop()
function is where the main code execution takes place. It runs repeatedly. - Inside the
loop()
function, we usedigitalWrite()
to turn on the LED by setting theLED_PIN
toHIGH
. This sends a high-voltage signal to the LED, causing it to light up. - We then use
delay(1000)
to pause the program for 1 second. This creates a delay between turning the LED on and off. - After the delay, we use
digitalWrite()
again to turn off the LED by setting theLED_PIN
toLOW
. This sends a low voltage signal to the LED, turning it off. - Another
delay(1000)
is used to pause the program for 1 second before repeating the loop.
Technical Details:
- Microcontroller: ATtyny 85
- Microcontroller Clock Speed 16.5MHz
- Operating Voltage +5V
- DC Current for 5V Pin 500mA
- Input Voltage(recommended) +7~+12V
- Output Voltage +5V
- Digital I/O Pins 6
- Rated Current per Pin 20mA/Pin
- High-performance design
- Low power consumption in operating mode on 1.8 volts current consumption is only 300uA & on power down mode current consumption is only 0.1uA on 1.8V.
- Minimum & maximum temperature -40 degree centigrade to 105-degree centigrade
- Dimensions: 1.8cm x 2.6cm
Resources:
- Arduino IDE Download
- The reference for the language
- Digispark Digistump Drivers for Windows.
Comparisons:
- The Digispark board, despite being inferior to the Uno board in terms of capabilities, has a unique feature that sets it apart - the ability to function as a USB device. The ATtiny85 microcontroller used in the Digispark board does not have a hardware USB module. However, with the help of a specialized library called V-USB, it is possible to emulate the USB 1.1 protocol on any AVR microcontroller with at least 2 kB of Flash memory and 128 bytes of RAM. This means that the Digispark board can be used to create USB-based devices such as keyboards, mice, joysticks, virtual COM ports, and more.
- Another notable feature of the Digispark board is the inclusion of an LDO (Low Drop-Out) regulator. This regulator allows the board to be powered by a voltage applied to the VIN pin within the range of 7 to 12 V. It's important to note that the LDO regulator takes up a significant portion of the board space.
- The Arduino compatibility of the Digispark board is also a factor that contributes to its popularity. It can be programmed using the Arduino IDE, which means that the vast collection of Arduino libraries and resources can be utilized for developing projects with the Digispark board.
- However, it's worth mentioning that the Digispark board may not be suitable for beginners. Its limited number of pins and smaller form factor make it more suitable for small-scale projects that don't require a large number of I/O pins. Beginners who are new to microcontroller programming and electronics may find it easier to start with a more beginner-friendly board like the Arduino Uno, which offers a wider range of features and resources.