Quick Start Guide
Welcome to the SparkFun Teensy Ethernet Adapter Quick Start Guide. In this guide we'll go over everything you'll need to use the SparkFun Teensy Ethernet Adapter to connect a Teensy 4.1 development board to the Internet over an Ethernet connection.
Required Materials
- SparkFun Teensy Ethernet Adapter
- Teensy 4.1 (Headers) (or other Teensy 4.1)
- Micro USB Cable
- Ethernet Cable
- Straight Header - Male (PTH, 2mm, 2x3-Pin)
- Ribbon Cable - 120mm (2mm, 2x3-Pin)
Required Tools
Users will need to solder the 2x3 header to their Teensy 4.1. If you need a soldering iron or solder, check out the following categories on SparkFun:
If you've never soldered before or would like some tips or a refresher, take a look at our How to Solder: Through-Hole Soldering tutorial.
Recommended Reading
This guide assumes users are familiar with the Arduino IDE and the Teensyduino Add-On. If you've never worked with Arduino or Teensy before, we recommend reading through these guides:
Basic Assembly
Start by soldering the 2x3 straight header to the 2x3 PTH connector on the Teensy 4.1.
We recommend soldering this header with the longer ends of the pins on the top of the board to make it easy to plug into with the Teensy seated on a breadboard like this:
Next, take the 2x3 ribbon cable and connect it to the 2x3 headers on the Teensy 4.1 and Teensy Ethernet Adapter. Take care to align the cable properly to match the pins on the Teensy Ethernet Adapter to the correct pins in the Teensy 4.1:
Finally, connect the ethernet cable to the RJ45 jack on the Teensy Ethernet Adapter, plug the other end into an Ethernet port either on your router or other Ethernet/Internet hub and then connect the Teensy 4.1 to your computer using a USB MicroB cable. The completed assembly should look similar to the photo below:
Software Setup - Arduino & Teensyduino
With the hardware assembly complete, let's move on to connecting to the Internet using the Arduino IDE. This example requires installation of the Teensyduino add-on and the Ethernet Arduino library.
Teensyduino Installation
Using Teensy boards with Arduino requires installing the Teensy boards package also known as Teensyduino. Installing the Teensy boards requires adding a JSON URL to the Arduino "Additional boards manager URLS" field in the Preferences menu. Open the "Preferences" menu by navigating to File > Preferences and look for the "Additional boards manager URLS" field. Copy the link below into the field and click "Ok":
https://www.pjrc.com/teensy/package_teensy_index.json
Next, open to the "Boards Manager" tool on the left side of the Arduino window and search for "Teensy". Install the latest release of the Teensy (for Arduino IDE 2.0.4 or later). This package includes all the board files for Teensy Arduino boards.
Ethernet Library Installation
If the Ethernet library is not already installed, open the "Library Manager" tool on the left side of the Arduino window and search for "Ethernet". Install the latest release of the Ethernet library.
Arduino Example
Now that we have everything assembled, connected and installed, let's run a quick test sketch in Arduino to make sure we can connect to the Internet. For this we'll use the WebClient example included in the Ethernet Arduino Library to connect to a website (in this case, http://www.pjrc.com) and print out . Open the example by navigating to File > Examples > Ethernet > WebClient. Select your Board and Port and click the "Upload" button.
After the code finishes compiling and uploading, open the serial monitor with the baud set to 9600. The example attempts to
Code to Note
You may notice in the screenshot above that the Teensy is connecting to "www.pjrc.com" instead of "www.google.com". The code defaults to use DNS to connect to a website here:
//IPAddress server(74,125,232,128); // numeric IP for Google (no DNS)
char server[] = "www.google.com"; // name address for Google (using DNS)
You can enter any full web address here so we changed it to PJRC's website. Alternatively, you can uncomment the IPAddress server (); line and comment out the char server[] = "www.google.com"; to connect directly to an IP address and bypass DNS to reduce the size of the sketch.





