The SparkFun RedBoard Qwiic is the newest edition of the Arduino-compatible development platforms in the SparkFun catalog. This updated version of the classic SparkFun RedBoard incorporates a few key improvements over its predecessor (see Hardware Overview). However, like the original SparkFun RedBoard, it is designed to be an easy-to-use learning platform for coding, physical computing, and project prototyping. These skills are becoming increasingly significant in today's education and the technological community.
SparkFun RedBoard Qwiic DEV-15123The SparkFun RedBoard Qwiic is an Arduino-compatible development board with a built in Qwiic connector, eliminating the need …
This tutorial aims to familiarize you with the new SparkFun RedBoard Qwiic and help you get started using it. To begin, we'll guide you through the installation of the Arduino IDE (Integrated Development Environment) software, the main user interface for programming the board. Next, we will go over the hardware and features of the board. Finally, we will walk you through a few examples using the Arduino IDE.
The SparkFun RedBoard Qwiic can interact with real-world sensors, control motors, display information, and perform near-instantaneous calculations. It enables anyone to create unique, nifty projects from something as simple as displaying characters on an LCD display or detecting changes in light to vastly more complicated projects like an IoT cellular device (Not recommend for beginners... start with something simpler and work your way up.). If you're familiar with how the original SparkFun RedBoard worked, you may want to skim over parts of this tutorial.
Required Materials/ToolsTo get started, all you need is a few things:
Troubleshooting Tip: If you are not a technical or computer savy individual and you have your choice of computers, a Windows 7 or 10 computer is highly recommended. You will usually run into the the least issues, if any, with these operating systems.
That is ALL... pretty simple right? Now you won't be able to do much since there are no additional sensors to interact with the physical world. However, you can at least blink an LED and do some math calculations.
Jumper Modification Qwiic Example
Click the buttons above to toggle the additional materials based on the tasks youIf you would like to modify the 3.3V/5V I/O jumper or A4/A5 Qwiic connector jumpers, you will need
soldering equipmentand/or a
knife.
Solder Lead Free - 100-gram Spool TOL-09325This is your basic spool of lead free solder with a water soluble resin core. 0.031" gauge and 100 grams. This is a good spoo…
Hobby Knife TOL-09200It's like an Xacto knife, only better. We use these extensively when working with PCBs. These small knives work well for cutt…
Weller WLC100 Soldering Station TOL-14228The WLC100 from Weller is a versatile 5 watt to 40 watt soldering station that is perfect for hobbyists, DIYers and students.…
RetiredIf you would like to follow along with the examples below to interact with the physical world, you will also need the following items:
Qwiic Cable - 100mm PRT-14427This is a 100mm long 4-conductor cable with 1mm JST termination. It’s designed to connect Qwiic enabled components together…
Suggested ReadingThe SparkFun RedBoard Qwiic aims to be a beginner-friendly microcontroller platform. You can get started without an innate knowledge of Ohm's Law or How Electricity Works (but a little understanding wouldn't hurt!). The following are some subjects you should be familiar with; however, to use the more advanced features of the board, it is recommended that you read up on the Logic Levels and I2C tutorials.
What is a Circuit?Every electrical project starts with a circuit. Don't know what a circuit is? We're here to help.
What is an Arduino?What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.
Logic LevelsLearn the difference between 3.3V and 5V devices and logic levels.
I2CAn introduction to I2C, one of the main embedded communications protocols in use today.
One of the new, advanced features of the board is that it takes advantage of the Qwiic connect system. We recommend familiarizing yourself with the Logic Levels and I2C tutorials (above) before using it, as all Qwiic sensors utilize an I2C communication protocol. Click on the banner above to learn more about Qwiic products.
Fun Fact: Qwiic is a play on words between "quick" and I2C or "iic".
Installing Drivers Note:The USB-to-Serial adapter IC, used on the RedBoard Qwiic, is different from what was used on the original RedBoard.
The new CH340C chip will require a different driver than the FTDI chip used on the original RedBoardbecause they are different chips made by separate manufacturers.
Please make sure to follow the driver installation guide before plugging this new board into your computer.The SparkFun RedBoard Qwiic uses a CH340C USB-to-Serial adapter made by WCH. The driver for the CH340C chip will need to be installed on your computer. We have tested and confirmed that the driver works on Windows 7, Windows 10, Mac OSX High Sierra, and Raspbian Stretch (11-13-2018 release) for the Raspberry Pi. On all operating systems, if you have previously installed the CH340G drivers, you will need to uninstall those drivers first before updating to the new CH340C driver. For more information, check out our How to Install CH340 Drivers Tutorial.
Installing the CH340C driver allows your computer to recognize the SparkFun RedBoard Qwiic as a device and lets it communicate with the board over the USB connection. You can also find the latest version of the CH340 drivers from WCH here. (Most of their pages are in Mandarin, but if you use a Chrome web browser, you should have the option to have the web page translated.)
Installing the Arduino IDE Download/Install ArduinoYou can download the Arduino IDE from their website. They have installation instructions, but we will also go over the installation process as well. Make sure you download the version that matches your operating system.
Click for Arduino IDE Download PageThe installation procedure is fairly straightforward, but it does vary by OS. Here are some tips to help you along. We've also written a separate Installing Arduino tutorial in case you get stuck.
Troubleshooting Tips:The Windows version of Arduino is offered in two options: an installer or a zip file. The
installeris the easier of the two options, just download that, and run the executable file to begin the installation.
When you're prompted to install a driver during installation, select "Install". This will install drivers for Arduino specific boards (like the Uno, Nano, etc.) that you may use in the future.
The Mac download of Arduino is only offered in a zip file version. After the download is finished, simply
double-click the .zip fileto unzip it.
Following that, you'll need to
copy the Arduino application into your applications folderto complete the installation.
Linux Install TipsAs Linux users are no doubt aware, there are many flavors of Linux out there, each with unique installation routines. Check out the
FAQ sectionof the Arduino webpage for more details. Otherwise, you can also use the
Linux section of our Installing Arduino tutorialfor some helpful links for an assortment of Linux distributions.
Raspbian StretchRaspberry Pi users with Raspbian installed should use the
Linux ARMdownload. Do not use the command line installation process. For more information, please refer to this
blog post from Arduino.
Ubuntu and DebianFor Ubuntu and Debian users, installing Arduino should only need a simple "
apt-get" command like:
sudo apt-get update && sudo apt-get install arduino arduino-core
Other Distributions Other Linux distros aren't too dissimilar from the Ubuntu and Debian instructions.
With Arduino downloaded and installed, the next step is to plug the board in and test it out! Pretty soon you'll be blinking LEDs, reading buttons, and doing some physical computing!
Below is an annotated image, and an overview of all of the important features for the SparkFun RedBoard Qwiic:
Click the buttons below for more details.New Features Dimensions Microcontroller Power/Reset Status LEDs Programming Pin Functions Pin Connections Qwiic Connection Jumpers
New FeaturesThe new features of the SparkFun RedBoard Qwiic include:
The new CH340C IC allows the
SparkFun RedBoard Qwiicto utilize the USB micro-B connection and should reduce the need for users to manually install drivers. Newer operating systems should automatically recognize and install the drivers for the board.
AP2112 Voltage RegulatorThe AP2112 is a more robust
3.3Vregulator to provide more power to daisy chain multiple Qwiic devices. Unlike the MIC5205, which could only source about 150mA of current; the AP2112 can source up to
600mAof current and should be able to handle most of your
Qwiic deviceneeds.
Qwiic ConnectorThis connector allows the
SparkFun RedBoard Qwiicto seamlessly interface with
SparkFun's Qwiic Ecosystem.
A4/A5 JumpersPins
A4and
A5are tied directly to the I
2C bus. These jumpers can be used to disconnect the logic level converters from pins
A4and
A5so that they might be used independently from the
Qwiic systemfor analog readings.
Voltage Level JumpersThese jumpers allow users to easily switch from a
3.3Vto
5Vboard. This allows the user to convert the board (and I/O pins) to either
3.3Vor
5Vbased on their needs. Unlike the the
original SparkFun RedBoard, you no longer need a logic level converter to interface directly to a
3.3Vdevice or sensor.
Reset ButtonThe board also includes a new, more pronounced reset button that is easier to push. Anyone with "
fat fingers" can relate to this struggle.
The TX LED is now green, instead of yellow and the RX LED is now yellow, instead of red.
DimensionsThe dimensions for the board are approximately 2.7" x 2.1". The board uses female headers laid out in a standard configuration for Arduino shields. The barrel jack for power uses a standard 5.5mm outer diameter and 2.1mm inner diameter mating connection. The Qwiic connector uses a
4-pin JST SH typeconnector. There are also 4 mounting points on the board.
For the more details on the board sizing and component placement please refer to the Eagle files provided.
Download Eagle Files (ZIP)is a free for educators, makers, and hobbyists (i.e. basically, anything not for commercial purposes). All measurements are accurate, excluding any manufacturing tolerances. (Unfortunately, we do not have any tolerance information available; you may need to just measure the board you purchase.)
MicrocontrollerThe microcontroller (ATmega328 IC) is the work horse of the
SparkFun RedBoard Qwiic. The ATmega328 is an 8-bit AVR microcontroller manufactured by Atmel, now Microchip. Once an Arduino sketch is uploaded to the board, the program is stored in the memory of the ATmega328. The microcontroller will then run/execute the program while the
SparkFun RedBoard Qwiicis powered.
For more details on the ATmega328, memory, and the bootloader check out these tutorials:
The
SparkFun RedBoard Qwiiccan be powered via the USB and/or barrel jack connectors. If you choose to power it via USB, the other end of the USB cable can be connected to either a
computer or a 5V (regulated) USB wall charger. Otherwise, should you choose to use the barrel jack, any wall adapter connected to this jack should supply a
DC voltage between 7 and 15V.
Our 9V and 12V power adapters are good choices if you're looking to power the board through the barrel jack. Any wall adapter connected to this jack should supply a DC voltage between 7 and 15V as specified by the electrical characteristics of the LM1117 voltage regulator used on the board. The input voltage pin VIN on the power headers is directly connected to the input voltage of the barrel jack.
USB A USB micro-B cable is usually the easiest way to power the board, especially when you're programming it because the USB interface is required for uploading code too. A traditional USB port supplies a regulated 5V, but is limited to about 500mA (USB 2.0). Additionally, there is a fuse that protects your computer from shorts and overcurrent. If more than ~750mA is drawn through the USB port, it automatically throttles the current draw or disconnects power until the short/overload is removed. If you need more than that a barrel jack wall adapter is the best choice.Users should take care
NOTto pry or leverage on the connector when inserting/removing the USB cable. Doing so,
WILLdamage the board and cause the pads and/or traces to tear off as well. The cable should be removed by pulling straight outwards from the board.
The fuse can also be tripped with a high current draw and high ambient temperatures.
AP2112 Voltage Regulator The AP2112 is a more robust 3.3V regulator to provide more power to daisy chain multiple Qwiic (I2C) devices. Unlike the MIC5205, which could only source about 150mA of current; the AP2112 can source up to 600mA of current and should be able to handle the needs of your Qwiic devices. Troubleshooting Tip:If you need more power for your Qwiic devices, you can attach a separate power supply. However, it is recommended that you cut the 3.3V line of the Qwiic cable to the
SparkFun RedBoard Qwiic. Leave the GND line alone, as that ground loops your system, providing a consistent reference voltage for your I
2C signals. By cutting the 3.3V line, this allows you to power all your devices without straining the 3.3V regulator. For more details on voltage regulators, check out this
According to Peteblog post.
The Power Header The power headers provides all your reference, input, and output, voltages.It is fine to connect both a barrel jack and a USB connector at the same time. The
SparkFun RedBoard Qwiichas power-control circuitry to automatically select the best power source.
USB and barrel jack wires connected.
Status Indicator LEDsThere are 4 status LEDs on the
SparkFun RedBoard Qwiicthat indicate power, serial communication, and a test/status LED.
There is a small change to the color of ther status LEDs from the
original RedBoard. The power LED is green, the LED for Pin 13 is blue, the RX LED is yellow, and the TX LED is green. However, the color of the LED's don't really matter, the indication is based on whether the LED is on/off. The color differences only help to indicate which LED is on when the LED is blinks quickly or from a quick glance.
Power The first LED is the power LED. This LED indicates that there is a potential between the VCC and GND pins. A good secondary test for this status indicator is to use a multimeter to test the VIN, 5V, and 3.3V pins against the GND pin. RX/TX The next two status LEDs are the serial communication LEDs. These LEDs indicate that there is data moving between the serial UART RX/TX pins and the USB-to-Serial Converter. A good secondary test for this status indicator is to make sure that these LEDs are flashing during upload or any other serial communication. Pin 13 The last indicator is the Pin 13 LED. This is typically only used as a test LED to make sure that a board is working or for basic debugging. However, for the SparkFun RedBoard Qwiic, this LED also indicates if the presence of the bootloader. If the board was properly flashed, the LED should flash a few times on power up. Troubleshooting Tips:If you must use pin 13 as a digital input, it is recommended that you set the pinMode() as an INPUT
pinMode(13, INPUT);
and use an external pulldown resistor.
There are two ways to program the
SparkFun RedBoard Qwiic. The most common way for users is through the USB connection. The other slightly less common method is through the ISP headers or pins.
Troubleshooting Tip:
Users should take care NOT to pry or leverage on the connector when inserting/removing the USB cable. Doing so, WILL damage the board and cause the pads and/or traces to tear off as well. The cable should be removed by pulling straight outwards from the board.
AVR ISP Pinouts – Top View.
On the SparkFun RedBoard Qwiic the MOSI and D11 pins, MISO and D12 pins, and SCK and D13 pins are tied together. To program the SparkFun RedBoard Qwiic through the ISP pins, you will want to set the I/O jumper to 5V. This will tie the VCC of the microcontroller to the 5V rail//pin of the ISP header. Otherwise, you will probably run into issues and likely damage the I/O pins and/or the microcontoller chipset. Troubleshooting Tip: Re-flashing the BootloaderOften, this method is used as a last ditch effort, when after all else has failed to revive a board (do not attempt, unless you know what you are doing). Most likely your board isn’t bricked unless you have done something drastic like modified the fuses. In which case, reflashing the board probably won’t help you. However, if you have no options left and want to try to reflash the bootloader with an Uno or RedBoard. Here are links to some tutorials to get you started:
If you would like to take a look back, here is a tutorial from back in
June 2008on
How to Get Code Onto a Microcontroller. We have come so far since then!
Back then, it wasn't as easy to get into programming or processing. Without a USB-to Serial Converter or Bootloader, you needed an external ISP programmer to flash a microcontroller. You needed to use a lower level language and complex development platform to create and compile code for your microcontroller. Before flash memory, you could only program chips once.
(
*Make sure to upload the ISP sketch to the programming board. Lastly, be sure to double check the board options you are selecting so that the Arduino IDE uses the correct bootloader hex file.)
Pin FunctionsAll of the
SparkFun RedBoard Qwiic'spins are broken out to 0.1" spaced female headers (i.e. connectors) on the outer edges of the board. The pins are arranged into logical collections; there are headers dedicated to power inputs/outputs, analog inputs, and digital inputs.
To learn more about analog vs. digital signals, check out this great
tutorial.
Power PinsThe power pins aren't really
I/O(Input/Output) pins for the microcontroller; however, they are pertinent to the board. For more details on these pins, see the
Power/Reset section.
The
power headeris mostly full of voltage supply pins. These pins are traditionally
used as power sourcesfor other pieces of hardware (like LEDs, potentiometers, and other circuits).
All of the
I/Opins on this board are
digital inputsor
outputsfor the microcontroller (ATmega328). There are select pins, like the
Analog pins, which have additional capabilities.
Digital I/OThere are 20
I/Opins on this board that can be used as
digital inputsor
outputsfor the microcontroller (ATmega328). This includes the pins labeled as
Analog, which may be configured and used in the same manner as the
Digital pins. These are what you connect to buttons, LEDs, sensors, etc. to interface the Arduino with other pieces of hardware.
The maximum current an I/O pin can source (provide positive current) or sink (provide negative current) is 40 mA (milliamps). For more details, you can refer to the
ATmega328 datasheetor this
reference page. Attempting to run high current devices may damage the output the pin or entire ATmega328 chip.
For more details about
digitalpins, check out this
reference page.
Additional FunctionsThere are several pins that have special functionality in addition to general
digital I/O. These pins and their additional functions are listed in the tabs below. For more technical specifications on the
I/Opins, you can refer to the
ATmega328 datasheet.
Analog Input PinsThere are 6
analog inputson the analog header. These pins all have 10-bit (10-bit = 1024 different values)
analog to digital converter(ADC), which can be used to read in an analog voltage between 0 and VCC. These are useful if you need to read the output of a potentiometer or other analog sensors.
Troubleshooting Tip:
To take analog readings on pins A4/A5, the jumpers for the Qwiic connector need to be cut. Otherwise, the pullup resistors for the logic level converters will act as voltage dividers and the pins will read improper values at lower voltages.
The
AREFpin provides a reference voltage for the analog inputs. This pin can be used to get a higher resolution at lower voltage levels. Be sure to read the
Notes and Warningson the
analogReference()page.
Analog pins 4 and 5 also support I2C (TWI) communication using the Wire library.
For more details on the analog inputs, check out these tutorials:
Pulse Width Modulation (PWM) Output PinsDigital pins (3, 5, 6, 9, 10, and 11) marked with a tilde (~) are 8-bit
PWM capable outputs, which you can use to dim LEDs or run servo motors.
Troubleshooting Tip:
Novice users often mistake PWM pins as an analog output. Although, it can somewhat mimic that functionality, it is not a true analog output.
For more details on pulse width modulation, check out these tutorials:
Serial Communication PinsDigital pins 0 (RX) and 1 (TX) are also dedicated serial communication pins ties to the USB-to-serial converter (CH340C). These pins are used to receive (RX) and transmit (TX) TTL serial data as well as program the microcontroller. Other digital pins can be use to emulate serial communication with
SoftwareSerial().
Troubleshooting Tip:
If a device is communicating to the microcontroller over digital pins 0 and 1, while you are trying to upload code, you will run into an upload error. Disconnect the device before uploading code again. It may be easier to emulate serial communication with another set of pins to make debugging easier.
For more details on serial communication, check out these tutorials:
Digital pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK) support Serial Peripheral Interface (SPI) communication.
Note:
Using the Serial Peripheral Interface, configures the SCK and MOSI pins to be directly managed by the SPI hardware. Therefore, while in use, pins 11 and 13 can't be used (i.e. the LED on pin 13 can no longer be used as a debug/status indicator.) Executing "SPI.end();" allows those pins 11 and 13 to be used as general I/O again.
For more details on the serial peripheral interface, check out these tutorials:
Analog pins 4 (SDA) and 5 (SCL) support I
2C (TWI) communication.
The Qwiic system is intended to be a quick, hassle-free cabling/connector system for I
2C devices. The Qwiic connector is tied to the I
2C pins via the A4 /A5 jumpers. Also, there are a set of logic level converters for the Qwiic system, which uses a 3.3V logic level.
Troubleshooting Tip:
Be sure to double check that you are not trying to use and I2C device while you are trying use analog pin 4 or 5 to read analog data, you will run into issues. You can only do one or the other.
For more details on the serial peripheral interface, check out these tutorials:
Interrupt PinsInterrupts allow you to
interruptthe code running in your main loop and execute another set of instructions (also known as interrupt handler or interrupt service routine) before returning back to the main loop. Digital pins 2 and 3 can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value.
For more details on the interrupts, check out these tutorials:
Connecting to the Board Jumper WireAll of the
SparkFun RedBoard Qwiic's pins are broken out to 0.1"-spaced female headers (i.e. connectors) on the outer edges of the board. There are a variety of wires, connectors, and other items that can be inserted into these headers to interface with the Arduino.
Jumper wiresare a good option if you want to connect the RedBoard up to other pieces of circuitry that may live on a breadboard.
When connecting to the headers, be sure you are aware of the functionality of the pins you are using.
Arduino ShieldsShields are another popular way to interface with the headers. These Arduino-shaped boards are stackable and connect to all four headers of the
SparkFun RedBoard Qwiicat once. Shields exist in hundreds of forms, they can add GPS, WiFi, MP3 decoding, and all sorts of other functionality to your Arduino. For more details on Arduino shields and shield assembly, please refer to this
Arduino Shieldstutorial.
Troubleshooting tip:
Most shields are expecting a 5V board. Double check the documentation or datasheet for the shield you are using to verify what voltage it is expecting. You will need to adjust the I/O jumper accordingly.
The most convenient feature of the board is the Qwiic connector that allows the
SparkFun RedBoard Qwiicto seamlessly interface with
SparkFun's Qwiic Ecosystem.
What is Qwiic?The Qwiic system is intended a quick, hassle-free cabling/connector system for I
2C devices. Qwiic is actually a play on words between "quick" and I
2C or "iic".
Features of the Qwiic System Keep your soldering iron at bay.Cables plug easily between boards making quick work of setting up a new prototype. We currently offer three different lengths of Qwiic cables as well as a breadboard friendly cable to connect any Qwiic enabled board to anything else. Initially you may need to solder headers onto the shield to connect your platform to the Qwiic system but once that’s done it’s plug and go!
Minimize your mistakes.How many times have you swapped the SDA and SCL wires on your breadboard hoping the sensor will start working? The Qwiic connector is polarized so you know you’ll have it wired correctly, every time, from the start.
The PCB connector is part number SM04B-SRSS (Datasheet) or equivalent. The mating connector used on cables is part number SHR04V-S-B or equivalent. This is a common and low cost connector.
1mm pitch, 4-pin JST connector
Expand with ease.It’s time to leverage the power of the I2C bus! Most Qwiic boards will have two or more connectors on them allowing multiple devices to be connected.
Logic Level Conversion There are logic level converters used on the Qwiic connector to maintain a 3.3V logic level on the I2C bus. They are tied directly to the VCC of the microcontroller and the 3.3V rail. Therefore, the board automatically does the logic level conversion for the I/O voltage selected.Troubleshooting Tip:
To take analog readings on pins A4/A5, the jumpers for the Qwiic connector need to be cut. Otherwise, the pullup resistors for the logic level converters will act as voltage dividers and the pins will read improper values at lower voltages.
You will need a
knifeto modify the A4/A5 jumpers. To modify the jumper, located on the back of the board next to the Qwiic connector, you need to
cut the tracebetween the two pads. Once you have cut the trace, the Qwiic connector and logic level conveters will be disconnected. To repair the connection, you just need to solder a jumper between the pads of both jumpers. Be sure to test the jumper with a multimeter to make sure you have a good soldered connection.
Adding External PowerIf you need more power for your Qwiic devices, you can attach a separate power supply. However, it is recommended that you cut the 3.3V line of the Qwiic cable to the
SparkFun RedBoard Qwiic. Leave the GND line alone, as that ground loops your system, providing a consistent reference voltage for your I
2C signals.
By cutting the 3.3V line, this allows you to power all your devices without straining the 3.3V regulator on the board. Since, all voltage regulators are slightly different and don't maintain a perfect 3.3 voltage, the 3.3V AP2112 regulator would be constantly battling the voltage regulator of your separate power supply to regulate
itsversion of 3.3V. For more details on voltage regulators, check out this
According to Peteblog post.
JumpersThere are 3 jumpers on the
SparkFun RedBoard Qwiic. The two jumpers on the back of the board can be used to disconnect the Qwiic connector from the A4/SDA and A5/SCL pins. The last jumper, on the top of the board, allows users to change the voltage level of the microcontroller.
Using the I/O jumperOne of the great features of the
SparkFun RedBoard Qwiicis this
I/O jumperthat allows users to easily switch from a
3.3Vto
5Vboard.
ATmega328 Logic Levels
In most electrical devices, the logic level used is the same as the
VCC(
Voltage Common Collector). For example, in the
original SparkFun RedBoard, the
VCCof the microcontroller is set by the LM117
5Vlinear voltage regulator. Therefore, the
original SparkFun RedBoardwas a
5V boardthat used
5V logic levels.
However, the
updated SparkFun RedBoard Qwiichas an IO voltage jumper that lets you connect the
VCCof the microcontroller to the LM117
5Vor AP2112
3.3Vlinear voltage regulator. Therefore, the logic level of the ATmega328 can be set to
3.3Vor
5V. For more details see our
Logic Leveltutorial.
If you choose to program the
SparkFun RedBoard Qwiicthrough the ISP pins, you will want to
set the I/O jumper to 5V. This will tie the
VCCof the microcontroller to the
5V rail//pinof the ISP header. Otherwise, you will probably run into issues and likely damage the I/O pins and/or the microcontoller chipset.
A4/A5 jumpers Since the SparkFun's Qwiic System, utilizes the I2C bus of the SparkFun RedBoard Qwiic, these jumpers are used to separate the board from the Qwiic connector are provided. These jumpers directly disconnect the logic level converters and the Qwiic connector from the A4/SDA and A5/SCL pins.Note: There are logic level converters used on the Qwiic connector to maintain a 3.3V logic level on the I2C bus. They are tied directly to the VCC of the microcontroller and the 3.3V rail. Therefore, the board automatically does the logic level conversion for the I/O voltage selected.
How to Modify the I/OYou will need a
knifeto modify the A4/A5 jumpers. To modify the jumper, located on the back of the board next to the Qwiic connector, you need to
cut the tracebetween the two pads. Once you have cut the trace, the Qwiic connector and logic level converters will be disconnected. To repair the connection, you just need to solder a jumper between the pads of both jumpers. Be sure to test the jumper with a multimeter to make sure you have a good soldered connection.
Arduino Examples Example 1: Uploading BlinkIn this example we will go over the basics of the Arduino IDE and upload a sample code. This is a great way to test the basic functionality of any board to make sure it is working.
The Arduino IDENow it's finally time to
open up the Arduino software. You'll be presented with a window that looks a little something like this:
Before we can send the code over to the RedBoard, there are a couple of adjustments we need to make.
Select a BoardThis step is required to tell the Arduino IDE
whichof the
available Arduino boards, we are using. Go up to the
Toolsmenu. Then hover over
Boardand make sure
Arduino/Genuino Unois selected.
Next up we need to tell the Arduino IDE which of our computer's serial ports the RedBoard is connected to. For this, again go up to
Tools, then hover over
Serial Portand select your RedBoard's COM port.
If you've got more than one port, and you're not sure which of the serial ports is your RedBoard, unplug it for a moment and check the menu to see which one disappears.
Blink SketchCode written for the Arduino IDE are referred to as sketches. All code in Arduino is C based. Let us upload a
Blink sketchto make sure our new RedBoard setup is totally functional. Go up to the
Filemenu in Arduino, then go to
Examples > 01.Basics > Blinkto open it up.
With all of those settings adjusted, you're finally ready to upload some code! Click the
Uploadbutton (the right-pointing arrow) and allow the IDE some time to compile and upload your code. It should take around 10-20 seconds for the process to complete. When the code has uploaded, you should see something like this in your console window:
And if you look over to the RedBoard, you should see the blue LED turn on for a second, off for a second, on for a second, off for a second...ad infinitum (at least until it loses power).
If you want to adjust the blink speed, try messing with the "1000" value in the
delay(1000);
lines. You're well on your way to becoming an Arduino programmer!
Something Wrong?Uh oh! If you didn't get a "Done Uploading" message, and instead got an error, there are a few things we can double-check.
If you got an avrdude: stk500_getsync(): not in sync: resp=0x00
error in your console window.
Either your serial port or board may be incorrectly set. Again, make sure
Arduino/Genuino Unois the board selection (under the "
Tools>
Board" menu). The serial port is usually the more common culprit here. Is the Serial Port correctly set (under the "
Tools>
Serial Port" menu)? Did the drivers successfully install? To double check your RedBoard's serial port, look at the menu when the board is plugged in, then unplug it and look for the missing port. If none of the ports are missing, you may need to go back to
driver installation.
Example 2: Qwiic ConnectorOne of the great features of the RedBoard (Qwiic) is its ability to interface with I
2C devices using our
Qwiic system. The Qwiic system is a solderless connection system that allows users to seamlessly daisy chain multiple I
2C devices with ease.
The Qwiic Distance SensorFor this example, we will be running a basic sketch using the
SparkFun 4m Distance Sensor (VL53L1X). For more examples with this sensor, please refer to the
complete hookup guide.
Hardware AssemblyThe wiring for this is simple. Use the Qwiic cable and connect the distance sensor to the board. That is it! The connections are polarized, so you don't have to worry about which side or connector you are using.
Hardware assembly for VL53L1X distance sensor example.Let's run an example for our distance sensor to see how it behaves.
Install the Arduino LibraryNote: If you have not previously installed an Arduino library, please check out our Arduino library installation guide.
First, you'll need the Sparkfun VL53L1X Arduino library. You can obtain these libraries through the Arduino Library Manager. Search for Sparkfun VL53L1X Arduino Library to install the latest version. If you prefer downloading the libraries from the GitHub repository and manually installing it, you can grab them here:
DOWNLOAD THE SPARKFUN VL53L1X ARDUINO LIBRARY (ZIP) Example 1 - Read DistanceTo get started with this example, open up
File>
Examples>
SparkFun VL53L1x 4M Laser Distance Sensor>
Example1_ReadDistance. In this example, we begin by creating a
SFEVL53L1X
object called
distanceSensor
with our wire port,
Wire
, and then our shutdown and interrupt pins. Then we initialize our sensor object in the
setup()
loop. The code to do this is shown below.
language:c
#include <Wire.h>
#include "SparkFun_VL53L1X.h"
//Optional interrupt and shutdown pins.
#define SHUTDOWN_PIN 2
#define INTERRUPT_PIN 3
SFEVL53L1X distanceSensor(Wire, SHUTDOWN_PIN, INTERRUPT_PIN);
void setup(void)
{
Wire.begin();
Serial.begin(9600);
Serial.println("VL53L1X Qwiic Test");
if (distanceSensor.init() == false)
Serial.println("Sensor online!");
}
Once we've initialized our sensor, we can start grabbing measurements from it. To do this, we send some configuration bytes to our sensor using distanceSensor.startRanging()
to initiate the measurement. We then wait for data to become available and when it does, we read it in, convert it from millimeters to feet, and print it out over serial. The void loop()
function that does this is shown below.
language:c
void loop(void)
{
distanceSensor.startRanging(); //Write configuration bytes to initiate measurement
int distance = distanceSensor.getDistance(); //Get the result of the measurement from the sensor
distanceSensor.stopRanging();
Serial.print("Distance(mm): ");
Serial.print(distance);
float distanceInches = distance * 0.0393701;
float distanceFeet = distanceInches / 12.0;
Serial.print("\tDistance(ft): ");
Serial.print(distanceFeet, 2);
Serial.println();
}
Opening your serial monitor to a baud rate of 9600 should show the distance between the sensor and the object it's pointed at in both millimeters and feet. The output should look something like the below image.
Below, we have also included some additional troubleshooting tips for issues that you may come across with the new RedBoard (Qwiic).
If neither of the troubleshooting guides above were able to help, here are some tips you might have missed. (Most of this material is summarized from the tutorial.):
Are You Using a Recommended Computer OS?This board is not tested using the Arduino Web IDE. We do
NOTrecommend using a Chromebook, Netbook, tablet, phone, or the Arduino Web IDE in general. If you are here, try a
RECOMMENDEDoperating system (see
Installing the Arduino IDE).
My Board Isn't Working:Every board that
wemanufacture gets tested. If you didn't buy the board from us or one of our authorized distributors, it could be a knock-off. That being said, let's try a basic test to see if just the board is working. Disconnect everything that you have attached to the board; we just want to test the board.
If you don't see your board as an available COM port on the Arduino IDE:
There are two types of issues that you will usually see in the console of the Arduino IDE, compile errors or upload errors. The easiest way to see where to start is by clicking the
Verifybutton (check mark); the Arduino IDE will try to compile your code. A failure here is a compile error.
It takes a some experience, but if you enable the verbose output from the Arduino IDE preferences, it may give you more clues to where the issue is.
Screen shots of how to enable verbose output. Click to enlarge.
If an input pin is read and that is floating (with nothing connected to it), you will see random data/states. In practice, it may be useful to tie an input pin to a known state with a pullup resistor (to VCC), or a pulldown resistor (to GND).
Pin 13 is difficult to use as a digital input because of the voltage drop from status LED and resistor soldered in series to it. If you must use pin 13 as a digital input, it is recommended that you set the pinMode() as an INPUT and use an external pulldown resistor.
The maximum current an I/O pin can source (provide positive current) or sink (provide negative current) is 40 mA (milliamps). You can power small sections of LED strips or small motors, but will run into issue with high power devices.
Be sure to double check that you are not trying to use an I2C device while you are trying use analog pins A4 or A5 to read analog data. You will run into issues where the analog read will appear to be at a constant value. As a result, the analog readings will not reflect the changes seen from the sensor output. You can only do one or the other.
Using the Serial Peripheral Interface, configures the SCK and MOSI pins to be directly managed by the SPI hardware. Therefore, while in use, pins 11 and 13 can't be used (i.e. the LED on pin 13 can no longer be used as a debug/status indicator.) Executing "SPI.end();" allows those pins 11 and 13 to be used as general I/O again.
This issue doesn't happen too often, but it can be arbitrarily, common: If your mouse pointer begins to move erratically, your mouse becomes unresponsive to your inputs, and your board is sending a lot of serial data, there is a chance that your computer thinks your board as a serial mouse. The fix is to unplug your board and the plug it back in while holding the reset button down, giving your computer a chance enumerate the COM port.
Now that you've successfully got started with your SparkFun RedBoard Qwiic, it's time to incorporate it into your own project! For more information, check out the resources below:
Need some inspiration for your next project? Check out some of these related tutorials:
Arduino Board Comparison Guides Standard Arduino Comparison GuideArduino Comparison Guide Uno or Pro Mini? Bluetooth or wireless? When it comes to Arduinos, there are a lot of choices. We've compiled every Arduino development…
RedBoard vs. UnoIn this tutorial we discuss the differences and similarities between the RedBoard and the Arduino Uno (SMD and PTH). The development platforms
Arduino Shields Arduino Shields v2An update to our classic Arduino Shields Tutorial! All things Arduino shields. What they are and how to assemble them.
Beginner Intermediate AdvancedClick the buttons above for tutorials relating to the board functionality based on topic difficulty.
Beginner Serial CommunicationAsynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!
Logic LevelsLearn the difference between 3.3V and 5V devices and logic levels.
Analog vs. DigitalThis tutorial covers the concept of analog and digital signals, as they relate to electronics.
Data Types in ArduinoLearn about the common data types and what they signify in the Arduino programming environment.
How to Work with Jumper Pads and PCB TracesHandling PCB jumper pads and traces is an essential skill. Learn how to cut a PCB trace, add a solder jumper between pads to reroute connections, and repair a trace with the green wire method if a trace is damaged.
Intermediate I2CAn introduction to I2C, one of the main embedded communications protocols in use today.
Processor Interrupts with ArduinoWhat is an interrupt? In a nutshell, there is a method by which a processor can execute its normal program while continuously monitoring for some kind of event, or interrupt. There are two types of interrupts: hardware and software interrupts. For the purposes of this tutorial, we will focus on hardware interrupts.
Advanced Installing an Arduino BootloaderThis tutorial will teach you what a bootloader is and why you would need to install or reinstall it. We will also go over the process of burning a bootloader by flashing a hex file to an Arduino microcontroller.
Integrated CircuitsAn introduction to integrated circuits (ICs). Electronics' ubiquitous black chips. Includes a focus on the variety of IC packages.
Example Projects RedBoard Edge Hookup GuideThe RedBoard Edge is a RedBoard that's been rebuilt around the idea that projects are eventually put into an enclosure to help clean up their look.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4