Getting Started with the Teensy

Pages
Contributors: Toni_K, MTaylor
Favorited Favorite 7

Introduction

The Teensy line is a collection of microcontrollers from PJRC based around several different powerful ICs. This basic getting started guide will help you start using the Teensy that's best for your project.

Teensy Family

The Teensy 3.1, the Teensy++ 2.0, and the Teensy LC.

Required Materials

To follow along with this tutorial, you will need the following materials. You may not need everything though depending on what you have. Add it to your cart, read through the guide, and adjust the cart as necessary. You will need the appropriate USB cable for the Teensy board with which you are working. The following boards work with the micro-USB cable:

Teensy 4.1

Teensy 4.1

DEV-16771
$31.50
9
Teensy 4.0

Teensy 4.0

DEV-15583
$23.80
15
USB Micro-B Cable - 6 Foot

USB Micro-B Cable - 6 Foot

CAB-10215
$5.50
15

Teensy 3.6

DEV-14057
15 Retired

Teensy 3.5

DEV-14055
8 Retired

Teensy LC

DEV-13305
17 Retired

Teensy 3.2

DEV-13736
68

The Teensy++ 2.0 works with the mini-USB cable:

SparkFun USB Mini-B Cable - 6 Foot

SparkFun USB Mini-B Cable - 6 Foot

CAB-11301
$4.50
3

Teensy++ 2.0

DEV-11781
3 Retired

You will also need the appropriate headers for your project. There are several different options available. Below are a few common headers used with the boards.

Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.75
20
Female Headers

Female Headers

PRT-00115
$1.75
8
Teensy Stackable Header Kit (Extended)

Teensy Stackable Header Kit (Extended)

PRT-17152
$1.75
Teensy Header Kit

Teensy Header Kit

PRT-13925
$1.50

Tools

You will need a soldering iron, solder, and general soldering accessories. We recommend the beginner Tool Kit for soldering any of the Teensy boards.

SparkFun Beginner Tool Kit

TOL-14681
Retired

Alternatively, if you are planning on doing a lot of intense soldering, you can also use the following wishlist as a guide.

Suggested Reading

If you aren't familiar with the following concepts, we recommend reading these articles first before continuing with this getting started guide.

How to Solder: Through-Hole Soldering

This tutorial covers everything you need to know about through-hole soldering.

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

Serial Peripheral Interface (SPI)

SPI is commonly used to connect microcontrollers to peripherals such as sensors, shift registers, and SD cards.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

Suggested Viewing

Check out some of the related videos.

Hardware Overview

Each Teensy board has its own key features which are highlighted here. For individual pinout diagrams and detailed schematic information, please check PJRC's page here. The pin functionality for each version is can be different so make sure to check before switching versions.

For full specifications and detailed comparison chart of the Teensy, check out respective product pages or the Teensy Technical Specifications page.

Teensy 4.1

The Teensy 4.1 builds on the Teensy 4.0. The size is uses the same size and footprint as the Teensy 3.5/3.6. Most technical specifications are the same as the Teensy 4.0 except with a few expanded features. Some of the more notable features include pins for Ethernet port (10 / 100 Mbit DP83825 PHY), host USB port, options to expand memory with two locations to solder SOIC memory chips, and a microSD card socket. This runs off of the NXP iMXRT1062 IC, which is a 32-bit ARM Cortex-M7. It is 3.3V tolerant only on its I/O pins.

Teensy 4.1

Teensy 4.1

DEV-16771
$31.50
9
Teensy 4.1 (Headers)

Teensy 4.1 (Headers)

DEV-16996
$35.95
3

Teensy 4.1 Features
FeatureNumber Available
PWM35
Analog In18
I/O55
Serial Port8
I2C Port3
SPI Port8
Real Time Clock1
Flash8MB (64K reserved for recovery & EEPROM emulation)
RAM1024K (512K is tightly coupled)

Teensy 4.0

The Teensy 4.0 is the same size and footprint as the Teensy 3.1/LC but even more powerful with its whopping 600MHz clock speed! The pin functionality is slightly different compared to the other versions. This runs off of the NXP iMXRT1062 IC, which is a 32-bit ARM Cortex-M7. It is 3.3V tolerant only on its I/O pins.

Teensy 4.0

Teensy 4.0

DEV-15583
$23.80
15
Teensy 4.0 (Headers)

Teensy 4.0 (Headers)

DEV-16997
$26.80
2

Teensy 4.0 Features
FeatureNumber Available
PWM31
Analog In14
I/O40
Serial Port7
I2C Port3
SPI Port3
Real Time Clock1
Flash2048K (64K reserved for recovery & EEPROM emulation)
RAM1024K (512K is tightly coupled)

Teensy 3.6

The Teensy 3.6 uses a similar pinout as the smaller Teensys. However, the board breaks out more pins and includes a microSD card socket. This runs off of the MK66FX1M0VMD18 IC, which is a 32-bit ARM Cortex-M4. It is 3.3V tolerant only on its I/O pins.

Teensy 3.6

DEV-14057
15 Retired

Teensy 3.6 (Headers)

DEV-14058
7 Retired

Teensy 3.6 Features
FeatureNumber Available
PWM22
Analog In25
I/O62
Serial Port6
I2C Port4
SPI Port3
Real Time Clock1
Touch Sense pins11
Flash1024K
RAM256K

Teensy 3.5

The Teensy 3.5 is similar to the 3.6. This runs off of the MK64FX512VMD12 IC, which is a 32-bit ARM Cortex-M4. It is 5V tolerant on its I/O pins.

Teensy 3.5

DEV-14055
8 Retired

Teensy 3.5 (Headers)

DEV-14056
1 Retired

Teensy 3.5 Features
FeatureNumber Available
PWM20
Analog In27
I/O62
Serial Port6
I2C Port3
SPI Port3
Real Time Clock1
Touch Sense pins0
Flash512K
RAM256K

Teensy 3.2/3.1

The Teensy 3.2 is the same size and footprint as the Teensy LC but more powerful. This runs off of the MK20DX256 IC, which is a 32 bit ARM Cortex-M4. It is also 5V tolerant on its digital I/O pins and can provide up to 3.3V at 100mA to other devices. The analog pins are 3.3V tolerant only.

Teensy 3.2

DEV-13736
68

Teensy 3.1 Features
FeatureNumber Available
PWM12
Analog In21
I/O34
Serial Port3
I2C Port2
SPI Port1
Real Time Clock1
Touch Sense pins12
Flash256K
RAM64K

The pushbutton on the 3.1 is a reboot trigger and does not reset the entire system, similar to the pushbutton on the LC. In order to reset the board, you must access the RESET test point on the bottom of the board.

Reset

Teensy 3.1 Reset pad.

Teensy ++ 2.0

This Teensy board is the only AVR-based Teensy that SparkFun carries. It runs off of the AT90USB1286, an 8 bit AVR running at 16MHz. It also has the largest footprint of all of the Teensy boards, at 1.375 in2.

Teensy++ 2.0

DEV-11781
3 Retired

Teensy 2.0 ++ Features
FeatureNumber Available
PWM9
Analog In8
I/O46
Serial Port1
I2C Port1
SPI Port1
Flash128K
RAM8K

The push button on the end of the Teensy 2.0 ++ is a RESET button. This is also used during programming the Teensy with Teensyduino, discussed later.

Teensy LC

Note: Teensy LC does not have 5V tolerant I/O pins. This is not the board for you if your project runs 5V signals, unless you want to use a logic shifter.

The Teensy LC is 0.98 in2. It runs off of the 32 bit ARM Cortex-M0+ at 48MHz and runs at 3.3V.

The Digital to Analog converter is on pin A12 of the microcontroller. Pin 17 outputs voltages up to the supplied Vin voltage, at 8mA.

Pins D5, D16, D17 and D21 can source signals up to 20mA. All other pins are limited to 5mA.

Teensy LC

DEV-13305
17 Retired

Teensy LC Features
FeatureNumber Available
PWM10
Analog In13
I/O27
Serial Port3
I2C Port2
SPI Port2
Touch Sense Pins11
Flash62K
RAM8K

The pushbutton on the LC is not a reset button but instead triggers HalfKay mode. This allows the board to reboot to the newest code or accept new uploaded code.

Soldering Options

When it comes to soldering your Teensy, there are many different options available to you. IF you have not soldered before, make sure to check out the following tutorial!

How to Solder: Through-Hole Soldering

September 19, 2013

This tutorial covers everything you need to know about through-hole soldering.

Solder Directly Into Your Circuit

We generally recommend against soldering directly between any two boards you want to connect -- if something burns out or is connected incorrectly, you've set yourself up for a lot of annoying rework (and the danger of ripping a pad off of the board).

Teensy Flush on board

Soldering your Teensy directly to the board leads to a small profile, but you run the risk of needing to desolder a lot of pins!

One benefit of soldering directly to your circuit however is that it gives a very small profile for the project. If you plan on doing this, we recommend testing your circuit design with Alligator clips or Pig-tail cables before hand to verify functionality.

Solder Headers

Most users prefer using male headers on the Teensy and matching female headers on other boards into which the Teensy fits.

If you plan on using this method, you must ensure you solder the headers on straight, otherwise you're going to have a hard time inserting or removing the Teensy from other boards.

We recommend inserting headers into a breadboard and soldering the Teensy on from there.

Breadboard Teensy

Teensy 3.1 inserted in a breadboard for soldering. Half the pins are soldered and half aren't.

After you finish soldering the headers along the length of the board, your Teensy may look similar to the image below depending on your project.

Breadboard Teensy with Headers Soldered On

Teensy 3.2 inserted in a breadboard for soldering with all pins soldered along the length of the board.

Using male headers with the Teensy allows you to solder the headers on nice and straight, preventing crooked header insertion. As you can see from the images above however, if you intend to use the Teensy LC or Teensy 3.1+ on a breadboard, you cannot solder all of the headers.

Breadboard Incompatible

These pins aren't breadboard compatible!

If you've already soldered together a board that works with the Teensy LC/3.1, you can simply line your headers up in that board to hold them straight while soldering to the Teensy.

Hold Headers Straight

The male headers for the Teensy are being held straight by this Teensy Arduino Shield Adapter.

Once the headers are lined up straight, it's easy to simply 'plug' the Teensy into the headers and solder everything together.

Teensy Lined Up

You can see the Teensy lined up on the headers, waiting to be soldered.

You can also solder female headers or stackable headers onto the top of the board, allowing other boards to be plugged into the top of the Teensy.

TeensyOnBottom

Teensy with stackable female headers on top, allowing the Audio shield to be plugged in and the Teensy to fit into a breadboard.

If you do solder your headers on like this, keep in mind it may limit your access to the push button on board, requiring you to break out the reboot/reset signal from the header pin.

What about Those Additional Headers on the LC/3.1+?

Inner Headers

Inner Pins

Inner headers - what to do with those?!

There are a few options to work with these pins. You can:

a) Leave them unconnected (boring!)

b) Solder wires to the pins as you find uses for them

c/d) Solder headers on the top/bottom

If you go for options c or d, there's an easy way to solder connectors on there without driving yourself crazy attempting to solder a lonely pin by itself.

If you are using male headers, you can use pliers to push/pull one of the pins out. This will allow you to use the spacer to hold the pins straight, but will remove the non-compatible pin.

Using Pliers to modify Headers

Removing the unnecessary pin using pliers.

If you are using female headers, this method won't work, but you can still use the pliers to pull out the unnecessary pins.

Female Header modification

Simply pull the header pin out, and out of the way!

Once the header strip has been modified, simply line it up with those holes, and solder them.

SMD Headers

Both the 3.1+ and LC Teensy boards have SMD pins on the board bottom that you can solder to. If you know you will need access to these pins, we recommend that you solder the headers onto the top side of your Teensy.

If you already have another Teensy soldered, you can use this as a soldering jig to keep the headers straight, as shown below.

Headers Soldered On Top

Headers are soldered on the top of the board, enabling access to the SMD pads on the bottom.

With the headers soldered onto the Teensy this way, the user has access to all of the SMD pads on the bottom of the board. Keep in mind however, this does minimize access to the pushbutton, so balance that with your project needs.

If you need help with soldering to the SMD pads on the bottom of the board, please check out our tutorial here.

You can also check out this video for SMD soldering tips and tricks.

Programming

To start working with the Teensy, all you need to do is plug in your USB cable to your computer and your Teensy board. There are two options for programming the Teensy boards - the Arduino IDE or your favorite C compiler.

Arduino IDE

Note: If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

Teensyduino Add-On Installation

You will need to download the Teensyduino add-on for Arduino. You can find the Teensyduino download from PJRC here.

Please follow their installation instructions for the most up-to-date version of the Teensyduino. You will also need to select which Teensy-compatible libraries you'd like to install at that time. If you aren't sure which libraries you will want, you can always download them and install them later from the curated list.

Programming the Teensy

When you first plug the Teensy in, the appropriate drivers will be installed (if using a Windows machine). Your Teensy should default to the standard Blink sketch. You should see the LED blinking, as a quick check to make sure your board is functioning.

Open up the Arduino IDE, and select the appropriate Teensy board from the Board menu. This will provide you with additional options in the Tools menu.

Arduino Teensy Options

Drop-down options in Arduino for Teensy boards.

If you would like to use the Teensy as an HID, MIDI, or user interface device (such as a keyboard or mouse), you can select that option from the USB Type menu.

The CPU speed can be changed for low-power applications.

Note: If you are using the Teensy 3.1, you must set the CPU speed to 24MHz or faster for proper functionality.

The Keyboard Layout option can be updated to your preferred style.

Press the button on the Teensy to open the Teensy loader program. You should see this window:

Teensy Loader

Teensy Loader Window

Verify your example code, and upload to the board as usual in the Arduino IDE. You will need to hit the on-board button once the IDE has compiled the code to finish uploading it to your Teensy. You should only need to do this the first time you upload code for the duration that your Teensy is powered.

C Compiler

This is typically a more advanced option. For step-by-step instructions on using a C-compiler for the Teensy, please check out PJRC's directions here. You will still need to download and install the Teensyduino and modify the Arduino files to use the Makefile for the Teensy boards.

Additional support for other languages is slowly being added. Please check here for more information.

MicroPython

For those that are comfortable with Python language, you can also load MicroPython on the Teensy! Check out the following tutorial for more information on getting started.

How to Load MicroPython on a Microcontroller Board

September 4, 2018

This tutorial will show you how to load the MicroPython interpreter onto a variety of development boards.

Troubleshooting

Having trouble using your Teensy? Try checking out some of the common troubleshooting tips from PJRC when using your Teensy.

Resources and Going Further

Now that you have a basic understanding of working with the Teensy, it's time to start building projects with one! Make sure to check out the schematic for your particular Teensy when building any new projects.

Teensy Schematics

Teensy schematics are available here.

Need some inspiration for your next project? Check out these additional resources for more information and other project ideas.

Or check out the following tutorials for inspiration.

HID Control of a Web Page

Learn how to move a slider on a webpage and make a motor spin. We connect HTML and HID to read sensors and interface with the physical world.

Boss Alarm

Build a Boss Alarm that alerts you of anyone walking into your office and automatically changes your computer screen.

LuMini 8x8 Matrix Hookup Guide

The LuMini 8x8 Matrix (APA102-2020) are the highest resolution LED matrix available.

MicroMod Teensy Processor Hookup Guide

Add the processing power and versatility of the Teensy to your MicroMod project following this guide for the SparkFun MicroMod Teensy Processor.

Or check out some of these blog posts for ideas.


If you have any feedback, please visit the comments or contact our technical support team at TechSupport@sparkfun.com.