Quantcast
Channel: SparkFun Tutorials
Viewing all 1123 articles
Browse latest View live

smôl ARTIC R2 Hookup Guide

$
0
0

smôl ARTIC R2 Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2056

Introduction

smôl is a new board format and, as the name suggests, they're really small!

smôl ARTIC R2

smôl ARTIC R2

SPX-18618
$199.95

The smôl ARTIC R2 Peripheral Board is a complete satellite transceiver for the ARGOS satellite network.

When we designed our ARGOS Satellite Transceiver Shield - ARTIC R2, we knew that people would want to use it for applications like wildlife tracking. In fact, all programs using ARGOS have to be related in some way or other to environmental protection, awareness or study, or to protecting human life. But what if you want to develop something much smaller? Say, a small dart for whale tracking, or a small backpack for avian tracking. Or you just need your battery to last for months. smôl is designed to meet those needs.

Each smôl board measures just 1.60" by 0.42" (40.6mm by 10.7mm). We made the boards just wide enough so we could squeeze USB-C and 16-way Flexible Printed Circuit (FPC) connectors on there. Some of the boards have components on both top and bottom layers which again helps keep the boards small.

smôl boards are designed to stack one on top of the other, using 16-way 0.5mm-pitch FPCs to provide the interconnect from one board to the next. Each board has an IN FPC connector on the bottom layer and an OUT FPC connector on the top layer. The boards stack in a zig-zag daisy chain; signals and power are passed from one board to the next up and down the chain through the FPCs.

Required Materials

As a minimum, you're going to need a suitable antenna:

ARGOS Omnidirectional Antenna - 401MHz

ARGOS Omnidirectional Antenna - 401MHz

WRL-17523
$6.95















The ARTIC R2 Peripheral Board is part of the smôl ecosystem. Why not pair it with one of the smôl Processor Boards?

smôl ESP32

smôl ESP32

SPX-18619
$17.95













To be able to reduce the sleep current below 10µA, you're going to want to pair the ESP32 with one of our intelligent smôl Power Boards:

smôl Power Board AAA

smôl Power Board AAA

SPX-18621
$17.95
smôl Power Board LiPo

smôl Power Board LiPo

SPX-18622
$17.95

Of course, a satellite tracking system needs to know where it is. Why not add a smôl ZOE-M8Q GNSS board to your smôl ecosystem?

smôl ZOE-M8Q

smôl ZOE-M8Q

SPX-18623
$39.95













Don't forget that you will need Flexible Printed Circuits to connect your smôl boards together. You're going to need one FPC per board. Our 36mm FPC is the perfect length if you want the smôl boards to stack neatly, one on top of the other.

smôl 36mm 16-way Flexible Printed Circuit

smôl 36mm 16-way Flexible Printed Circuit

CAB-18731
$0.95















Need to do some prototyping with smôl? Or want to connect your smôl stack to another Qwiic board? The smôl Header is perfect for that:

smôl Header

smôl Header

SPX-18620
$2.95













Suggested Reading

This is the hookup guide for the smôl ARTIC R2 Peripheral Board. Click the button below if you want to find out more about smôl itself.

We recommend taking a look through the following tutorials if you are not familiar with the concepts covered in them:

Serial Peripheral Interface (SPI)

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

I2C

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

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

ARGOS & ARTIC R2

Is your project linked to environmental protection, awareness or study, or to protecting human life? Perhaps you are developing a wildlife tracker, ocean buoy, environmental monitoring system or need to transfer emergency medical information? Do you need to be able to transmit and receive data anywhere? If so, this is the smôl product for you! Our smôl ARTIC R2 allows you to send and receive short bursts of data via the ARGOS satellite network, anywhere on Earth including the Polar regions.

The ARGOS satellite system has been around for quite a while. It was created in 1978 by the French Space Agency (CNES), the National Aeronautics and Space Administration (NASA) and the National Oceanic and Atmospheric Administration (NOAA), originally as a scientific tool for collecting and relaying meteorological and oceanographic data around the world. Today, ARGOS is revolutionising satellite communication, adding a constellation of 25 nanosatellites to complement the 7 traditional satellites carrying ARGOS instrumentation. The first of these, ANGELS, is already in operation and SparkFun were among the first users to transmit data to ANGELS in October 2020. When the constellation is complete, there will be a maximum of 10-15 minutes between satellite passes.

The ARTIC R2 is an integrated, low-power, small-size ARGOS 2/3/4 single chip transceiver. ARTIC implements a message based wireless interface. For satellite uplink communication, ARTIC will encode, modulate and transmit provided user messages. For downlink communication, ARTIC will lock to the downstream, demodulate and decode and extract the satellite messages. The ARTIC can transmit signals in frequency bands around 400MHz and receive signals in the bands around 466MHz, in accordance with the ARGOS satellite system specifications.

The smôl ARTIC R2 has been tested and certified by Kinéis. Compared to other satellite communication systems, the smôl ARTIC R2 has a much lower current draw and will work with a very simple, very lightweight quarter-wave wire antenna. The ARTIC R2 chipset on our board operates from 3.3V and the on-board flash memory enables fast boot times. If you don’t need the full transmit power, or want to conserve your battery life, you can transmit at reduced power too thanks to opto-isolated gain control.

Our Arduino Library makes it really easy to get up and running with ARGOS. We’ve provided a full set of examples which will let you: configure the ARTIC R2 chipset; predict the next satellite pass; receive allcast and individually-coded messages; transmit messages using ARGOS 2, 3 and 4 encoding. There are dedicated examples for the smôl ARTIC R2.


The ARGOS satellite system is restricted to specific programs and applications. Please check that your project meets these requirements before buying hardware. CLS (France) and the Woods Hole Group (America) will be able to advise if your project meets the requirements. "To meet system use requirements, all programs using Argos have to be related in some way or other to environmental protection, awareness or study, or to protecting human life."

Hardware Overview

In this section we'll cover what's included on the smôl ARTIC R2 Peripheral Board.

ARTIC R2

The heart of the smôl ARTIC R2 is, of course, the ARTIC R2 transceiver itself. This is a clever chip containing a Digital Signal Processor (DSP) which modulates transmit messages and demodulates received messages. The DSP can boot from on-board flash memory or from an external microcontroller via SPI. When transmitting, it produces a 1mW (0dBm) output signal which is fed to a separate power amplifier.

Pictured is the ARTIC R2 chip

Our Arduino Library does all of the heavy lifting for you. By default, the library will tell the ARTIC R2 DSP to boot from the on-board flash memory. However, by changing one line of code, you can instead boot via SPI with your microcontroller providing the firmware for the DSP.

RF Amplifier

During transmit, the RFPA0133 power amplifier boosts the 0dBm (1mW) signal from the ARTIC R2.

Pictured is the RFPA0133 amplifier chip

By default, the amplifier uses full gain and boosts the signal to approximately 25.8dBm (380mW). If you are using ARGOS 2 or 3 modulation and are transmitting from a 'noisy' environment, like a city, then you are probably going to need to use full power to ensure your messages get through. However, if you are using ARGOS 4 modulation and/or are transmitting from a 'quiet' environment, like the tundra or the ocean, then you will be able to transmit at reduced power.

Gain Control

There are two ways to reduce the smôl ARTIC R2 transmit power. You can adjust the gain through software and the on-board opto-isolated gain control circuit.

Pictured is the opto-isolated gain control

Our Arduino Library can reduce the gain for you. If you call:

language:c
myARTIC.attenuateTXgain(true);

from inside your code, the opto-isolator will pull the RFPA0133's G8 pin low, reducing the gain by approximately 5dB. This also has the advantage of reducing the transmit current by approximately 80mA.

If you are experimenting with ARGOS 4 modulation, you may want to reduce the gain even further. You can do that by opening the split-pad jumper next to the opto-isolator. Opening the jumper will pull the RFPA0133's G16 pin low and will reduce the gain by approximately 11dB. If you haven't used jumpers before, please check out our tutorial.

How to Work with Jumper Pads and PCB Traces

Handling 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.

Flash Memory

If you turn the smôl ARTIC R2 over, you will be able to see the small flash memory chip.

Pictured is the flash memory chip

During production testing at SparkFun, we program the flash memory with the ARTIC R2 firmware (ARTIC006) and a Platform ID allocated by CLS. You will need to register the Platform ID on your ARGOS account to activate it.

GPIO Expander

The larger chip on the bottom of the board is a PCA9536 I2C GPIO expander.

Pictured is the PCA9536 GPIO expander

smôl only supports two GPIO signals, so we added a separate I2C GPIO expander to allow the ARTIC R2 RESETB, INT1 and BOOT signals, plus the RF amplifier G8 pin, to be controlled via I2C.

You won't need to communicate with the GPIO expander directly, our Arduino Library will do that for you, we're just letting you know why that chip is there.

Antenna

The antenna connection for the ARTIC R2 is u.FL.

Pictured is the u dot f l antenna connector

Check out our tutorial if you haven't used u.FL before:

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Warning: Always connect a 401MHz antenna to your smôl ARTIC R2 before connecting the power. Transmitting with no antenna attached will damage the RF power amplifier.

Current Draw

If you are using the smôl ARTIC R2 to develop your own wildlife tracker, you will of course be very interested in how much current the board draws.

The fantastic Otii Arc Power Analyzer has allowed us to capture the ARTIC R2's exact peak transmit current draw at all four gain settings, and to study the average current drawn when the chip is idle. We've used this data to help optimize the code in this example to extend the battery life as much as possible when using the smôl ARTIC R2 with the smôl ESP32 Processor Board, smôl ZOE-M8Q GNSS Board and the smôl Power Board LiPo.

Maximum Gain (G16 High, G8 High)

The picture below shows the current draw captured by Otii Arc for a complete transmit cycle using this example. The gain here is set to maximum.

Pictured is the current draw during a complete transmit cycle
Having a hard time seeing? Click the image for a closer look.

At the start of the transmit cycle, the ESP32 Processor Board is woken up by the Power Board. It turns on the ZOE-M8Q GNSS board and waits for a fix. The current draw here is approximately 100mA for ~10 seconds.

Once the ESP32 has a location fix, it can calculate the time of the next ARGOS satellite pass. The power board woke the ESP32 up 1 minute before the start of the next pass, so the ESP32 goes in and out of light sleep for the next ~30 seconds.

The ARTIC R2 is powered on at the 40 second mark and the first of five transmits takes place just after the one minute mark.

The code example transmits five times on each satellite pass. The gap between the transmits is 90 seconds with a mandatory ±10% jitter. In between, you can see the ESP32 going in and out of light sleep with the ARTIC R2 being powered up 20-30 seconds before the next transmit is due.

The phenomenal data captured by Otii Arc allows us to zoom right in on the transmit itself and capture the true maximum current draw:

Pictured is the peak current draw during the transmit
Having a hard time seeing? Click the image for a closer look.

It's then child's play to extract the data we need!

Current Draw Summary

Below is a summary of the peak transmit current draw for the four ARTIC R2 gain settings. The RFPA0133 G8 pin is controlled by software. The G16 pin is controlled by the split-pad jumper. The smôl stack was powered by a 3.7V LiPo battery.

Please note: the Peak TX Current in this table is the total peak current drawn by the ESP32 + ARTIC R2 + Power Amplifier during the actual transmit

G16G8Approx. TX Power (dBm)Peak TX Current (mA)
HighHigh26238
HighLow21190
LowHigh15133
LowLow4114

Otii Arc lets us collect the other data we need:

  • LiPo Battery Voltage: 3.7V
  • Average Current Draw during a complete 5*TX transmit cycle (maximum gain): 29.9mA
  • Average Current Draw during a complete 5*TX transmit cycle (minimum gain): 24.9mA
  • Average continuous ESP32 + ZOE-M8Q GNSS Current Draw: 97mA
  • Current Draw during deep sleep: 6.4µA
  • Power Consumption during a complete 5*TX transmit cycle (maximum gain): 13.3mWh
  • Power Consumption during a complete 5*TX transmit cycle (minimum gain): 11.1mWh

We can then use this data to predict the battery life based on the transmit power and the number of transmissions per day. The satellite pass-prediction code in our Arduino Library can calculate the timing of the satellite passes with the highest elevation each day to maximize the chance of the transmission being received. Transmitting five times per day at maximum power, we could expect a 2000mAh battery to last approximately 530 days! Even the modest 400mAh battery pictured below should last for more than 100 days.

Pictured is a complete satellite tracker with 400 milliampere hour battery

smôl Specifics

Interfaces:

  • SPI and I2C
    • SPI Chip Select: CS0 (via waterfalling)
    • PCA9536 GPIO Expander I2C Address: 0x41

GPIO:

  • Uses GPIO0 for power control (via waterfalling)
  • Leave GPIO0 floating or pull low to disable power for the ARTIC R2
  • Pull GPIO0 high to enable power for the ARTIC R2
  • Power is controlled automatically via the SparkFun ARTIC R2 Arduino Library

Arduino Example: Satellite Detection

If you are using the smôl ESP32 Processor Board, you are going to want to install the CP210x USB Driver and Arduino Boards Package for the ESP32 first. Please see the smôl ESP32 Hookup Guide for more details.

The smôl ARTIC R2 peripheral board is fully compatible with the SparkFun ARGOS ARTIC R2 Arduino Library. You can install the library through the Arduino IDE Library Manager by searching for SparkFun ARGOS ARTIC. Alternatively, you can grab the library from GitHub or can download it as a zip file by clicking the button below:

The library contains tried-and-tested dedicated examples for the smôl ARTIC R2. The code below is a stripped-down version of Example3_SatelliteDetection. Copy and paste the code into a new window in the Arduino IDE and upload to the ESP32. The ARTIC R2 will try to detect a satellite for up to 10 minutes. You may wish to log into the ARGOS website and predict when the next satellite pass will take place before running this example.

language:c
#include <Wire.h> //Needed for I2C to ARTIC R2 GPIO
#include <SPI.h>
#include "SparkFun_ARGOS_ARTIC_R2_Arduino_Library.h" // http://librarymanager/All#SparkFun_ARGOS_ARTIC_R2
ARTIC_R2 myARTIC;

int CS_Pin = 5;            // smôl CS0 = ESP32 Pin 5
int ARTIC_PWR_EN_Pin = 27; // smôl GPIO0 = ESP32 Pin 27

void setup()
{
  Serial.begin(115200);
  Serial.println(F("ARGOS smôl ARTIC R2 Example"));

  Serial.println(F("ARTIC R2 is booting..."));

  Wire.begin(); // Needed to communicate with the I2C GPIO chip on the smôl ARTIC R2
  SPI.begin();

  //myARTIC.enableDebugging(); // Uncomment this line to enable debug messages on Serial

  // Begin the ARTIC: enable power and boot from flash
  if (myARTIC.beginSmol(CS_Pin, ARTIC_PWR_EN_Pin) == false)
  {
    Serial.println("ARTIC R2 not detected. Please check the smôl stack-up and flexible circuits. Freezing...");
    while (1)
      ; // Do nothing more
  }

  Serial.println(F("ARTIC R2 boot was successful."));

  myARTIC.setTCXOControl(1.8, true); // Set the TCXO voltage to 1.8V and autoDisable to 1

  myARTIC.setSatelliteDetectionTimeout(600); // Set the satellite detection timeout to 600 seconds

  Serial.println(F("Starting satellite detection..."));

  // Start satellite detection
  // The ARTIC will start looking for a satellite for the specified amount of time.
  myARTIC.sendMCUinstruction(INST_SATELLITE_DETECTION);
}

void loop()
{
  delay(1000);

  // Read the ARTIC R2 status register
  ARTIC_R2_Firmware_Status status;
  myARTIC.readStatusRegister(&status);

  // Check the interrupt 2 flag. This will go high if satellite detection times out
  if (status.STATUS_REGISTER_BITS.DSP2MCU_INT2)
  {
    Serial.println(F("INT2 pin is high. Satellite detection has timed out!"));
  }
  // Check the interrupt 1 flag. This will go high when a satellite is detected
  else if (status.STATUS_REGISTER_BITS.DSP2MCU_INT1)
  {
    Serial.println(F("INT1 pin is high. Satellite detected!"));
  }

  // Check the instruction progress
  // checkMCUinstructionProgress will return true if the instruction is complete
  ARTIC_R2_MCU_Instruction_Progress progress;
  boolean instructionComplete = myARTIC.checkMCUinstructionProgress(&progress);

  if (instructionComplete)
  {
    Serial.println(F("Satellite detection is complete! Freezing..."));
    while (1)
      ; // Do nothing more
  }
}

Troubleshooting

Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the smôl ARTIC R2, check out the following links:

smôl ARTIC R2 Documentation:

smôl Documentation:


Thanks! The ARTIC R2 circuit is a remix of the reference design kindly provided by the Arribada Initiative and Icoteq Ltd.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado


smôl Power Board AAA Hookup Guide

$
0
0

smôl Power Board AAA Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2059

Introduction

smôl is a new board format and, as the name suggests, they're really small!

smôl Power Board AAA

smôl Power Board AAA

SPX-18621
$17.95

The smôl Power Board AAA is an intelligent power board for smôl. It is designed to provide 3.3V power for your smôl stack from one or two AAA or AA alkaline (non-rechargeable) batteries. If you need a rechargeable solution, check out the smôl Power Board LiPo.

Each smôl board measures just 1.60" by 0.42" (40.6mm by 10.7mm). We made the boards just wide enough so we could squeeze USB-C and 16-way Flexible Printed Circuit (FPC) connectors on there. Some of the boards have components on both top and bottom layers which again helps keep the boards small.

smôl boards are designed to stack one on top of the other, using 16-way 0.5mm-pitch FPCs to provide the interconnect from one board to the next. Each board has an IN FPC connector on the bottom layer and an OUT FPC connector on the top layer. The boards stack in a zig-zag daisy chain; signals and power are passed from one board to the next up and down the chain through the FPCs.

Required Materials

As a minimum, you're going to need a battery holder or JST-PH cable to go with your power board:

micro:bit Battery Holder - 2xAAA (JST-PH)

micro:bit Battery Holder - 2xAAA (JST-PH)

PRT-15101
$1.95
JST Jumper 2 Wire Assembly

JST Jumper 2 Wire Assembly

PRT-09914
$0.95
3
Battery Holder - 2xAA (JST-PH)

Battery Holder - 2xAA (JST-PH)

PRT-14299
$1.50
Barrel Jack to 2-pin JST

Barrel Jack to 2-pin JST

TOL-08734
$2.95
1

The Power Board AAA is part of the smôl ecosystem. Why not pair it with one of the smôl Processor Boards and a Peripheral Board?

smôl ARTIC R2

smôl ARTIC R2

SPX-18618
$199.95
smôl ESP32

smôl ESP32

SPX-18619
$17.95
smôl ZOE-M8Q

smôl ZOE-M8Q

SPX-18623
$39.95

Don't forget that you will need Flexible Printed Circuits to connect your smôl boards together. You're going to need one FPC per board. Our 36mm FPC is the perfect length if you want the smôl boards to stack neatly, one on top of the other.

smôl 36mm 16-way Flexible Printed Circuit

smôl 36mm 16-way Flexible Printed Circuit

CAB-18731
$0.95















Need to do some prototyping with smôl? Or want to connect your smôl stack to a Qwiic board? The smôl Header is perfect for that:

smôl Header

smôl Header

SPX-18620
$2.95













Suggested Reading

This is the hookup guide for the smôl Power Board AAA. Click the button below if you want to find out more about smôl itself.

We recommend taking a look through the following tutorials if you are not familiar with the concepts covered in them:

Battery Technologies

The basics behind the batteries used in portable electronic devices: LiPo, NiMH, coin cells, and alkaline.

I2C

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

Hardware Overview

In this section we'll cover what this board does and what is included on the smôl Power Board AAA.

What Does This Board Do?

What does this board do? Excellent question! Let's answer that right now.

The main job of the Power Board is to provide power for your smôl ecosystem. smôl is designed to be both small in size and small on current draw. The Power Board plays a critical role in reducing the current draw of smôl as much as possible. This board has a TPS61200 switching regulator on it and is designed to boost the voltage from one or two AAA or AA alkaline cells up to 3.3V. But it also comes with an ATtiny43 AVR microcontroller on it. This is an intelligent power board for the smôl ecosystem!

When you want your project to go into a low power or deep sleep state, it is standard practice to put your processor into the lowest power state it offers. But you may find that the current draw is still something like 100µA to 500µA depending on which processor you are using. Then there is the quiescent current drawn by the voltage regulator. The quiescent current is the current drawn by the regulator when it is on but has no load attached. Again, it varies from regulator to regulator but you may find this adds another 55µA to your current draw. Those little currents add up and reduce your battery life considerably.

With smôl, we took a new approach. The Power Board takes control and provides the 3.3V power for the whole smôl stack. When instructed to by the Processor Board, the on-board ATtiny microcontroller will turn off that power completely and then put itself into a low power sleep state for a pre-defined interval. Sleep intervals from a few 10's of milliseconds to several days are possible. We have used the fantastic Otii Arc Power Analyzer to help us reduce the sleep current to just 12µA. Yes, you read that right, 12 microamps! smôl makes it possible for your battery life to be measured in months not days!

Battery Connector

By far the biggest component on the board is the JST-PH connector for the battery.

Pictured is the Battery Connector
Battery Connector Polarity: Please make sure that you use one of our recommended battery holders or cables. Some battery holders use the same JST connector as ours but have the opposite polarity. Connecting one of these to your smôl power board will destroy it as the board has no reverse polarity protection. If you are going to use your own battery holder or cable, it is up to you to ensure it has the correct polarity. In the above photo, the positive pin is on the right.

ATtiny43U AVR Microcontroller

The smôl Power Board AAA is an intelligent power board. The on-board ATtiny43U microcontroller can monitor the battery voltage and other parameters. When the Processor Board requests it to, the ATtiny43 will turn off the smôl 3.3V power completely and place itself into deep sleep for a pre-defined interval. This is what makes it possible to reduce the sleep current to just 12µA.

Pictured is the ATtiny43 microcontroller

The ATtiny43U may seem a strange choice, but actually it is the perfect choice for this board. We use it because it has a built-in boost converter and can operate directly from voltages as low as 0.7V. It does not need a separate voltage regulator.

Our SparkFun smôl Power Board Arduino Library does all of the heavy lifting for you, making it easy to communicate with the ATtiny through simple function calls.

A Note About Temperature Sensing

The ATtiny43 has a built-in temperature sensor, which can be accessed via the SparkFun smôl Power Board Arduino Library. However, the quoted typical accuracy of the sensor is &pm;10°C. Yes, plus or minus ten degrees C. The sensor measurement requires external calibration to be useful.

Voltage Regulator

The smôl Power Board AAA has a TPS61200 switching regulator on-board. That's the same regulator we use on our LiPower - Boost Converter. It can deliver approximately 550mA when boosting 1.5V up to 3.3V, and approximately 1500mA when boosting 3.0V up to 3.3V. It can be switched off completely by the ATtiny43U microcontroller, avoiding the 55µA quiescent current draw.

Pictured is the TPS61200 switching regulator
The TPS61200 can operate in Buck mode too and regulate higher voltages down to 3.3V. However, we do not recommend operating the board in this mode as the ATtiny43U's VCC supply will also be at that same higher voltage, leading to unexpected behavior and complications. Never exceed 5.5V or you will damage the ATtiny43U.
Ye cannae change the laws of physics! The current draw from a single AAA or AA cell will be approximately three times what smôl is drawing at 3.3V. When powering the smôl ARTIC R2 satellite communication board you are likely to have to use two AA cells for best results.

FPC Connections

Like all of our smôl boards, the Power Board AAA is equipped with two 16-way 0.5mm-pitch Flexible Printed Circuit connectors. FPCs are used to link the smôl boards together in a daisy-chain.

The pin-out for the smôl Power Board AAA is as follows:

Connector Pin No.Signal NameFunctionNotes
1PROC_PWR_ENProcessor Power EnableThe power board pulls this signal low to disable the voltage regulator on the power board
23V33.3V Power Rail
3GNDPower Ground / 0V
4SCLKSPI ClockNot used
5COPISPI Controller Out Peripheral InNot used
6CIPOSPI Controller In Peripheral OutNot used
7CS0SPI Chip Select 0Not used
8CS1SPI Chip Select 1Not used
8CS2SPI Chip Select 2Not used
10GPIO0General Purpose Input / Output 0Not used
11GPIO1General Purpose Input / Output 1Not used
12SDAI2C DataUsed for ATtiny43U communication
13SCLI2C ClockUsed for ATtiny43U communication
14GNDPower Ground / 0V
153V33.3V Power Rail
16V_USBUSB Power Rail (5V)USB power is used to recharge the battery

The IN and OUT pin connections are identical on the smôl Power Board AAA. (That's not always true on smôl Peripheral Boards. Check the appropriate Peripheral Board Hookup Guide for full details.)

The order in which you connect smôl boards is important. However, because the Power Board AAA only uses I2C communication, it can be placed anywhere in the stack. Please see the smôl Hookup Guide for more details.

smôl Specifics

Interface:

  • Interface: I2C
    • ATtiny43U Default Address: 0x50

PROC_PWR_EN:

  • PROC_PWR_EN:
    • The power board pulls PROC_PWR_EN low to disable the regulator on the processor board

Arduino Example: Battery Voltage

If you are using the smôl ESP32 Processor Board, you are going to want to install the CP210x USB Driver and Arduino Boards Package for the ESP32 first. Please see the smôl ESP32 Hookup Guide for more details.

The smôl Power Boards have their own Arduino Library to make communicating with the board as simple as calling a function. You can install the library through the Arduino IDE Library Manager by searching for SparkFun smol power. Alternatively, you can grab the library from GitHub or can download it as a zip file by clicking the button below:

You are also going to need to install the SparkFun MAX1704x Fuel Gauge Arduino Library. The smôl Power Board AAA does not have a fuel gauge on it, but the library does need it to provide support for the smôl Power Board LiPo. Again, you can install this library through the Arduino IDE Library Manager by searching for SparkFun MAX1704x. Alternatively, you can grab the library from GitHub or can download it as a zip file by clicking the button below:

The Power Board library contains a set of tried-and-tested examples which will work with both the smôl Power Board AAA and the smôl Power Board LiPo. There is only one line of code to change when switching from one to the other.

The following code is a simplified version of Example2_BatteryVoltage. Upload the code onto your processor board and open the Serial Monitor or a terminal emulator at 115200 baud to see the output.

language:c
#include <Wire.h>

#include <SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library.h> // Click here to get the library: http://librarymanager/All#SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library
#include <SparkFun_smol_Power_Board.h> //Click here to get the library:  http://librarymanager/All#SparkFun_smol_Power_Board

smolPowerAAA myPowerBoard;

void setup()
{
  Serial.begin(115200);
  while (!Serial)
    ; // Wait for the user to open the Serial console
  Serial.println(F("smôl Power Board example"));
  Serial.println();

  Wire.begin();

  if (myPowerBoard.begin() == false) // Begin communication with the power board using the default I2C address (0x50) and the Wire port
  {
    Serial.println(F("Could not communicate with the power board. Please check the I2C connections. Freezing..."));
    while (1)
      ;
  }

  // Select VCC as the voltage reference - see the full example for more details
  myPowerBoard.setADCVoltageReference(SFE_SMOL_POWER_USE_ADC_REF_VCC);

  float voltage = myPowerBoard.getBatteryVoltage(); // Read the battery voltage from the ATtiny43U
  Serial.print(F("The battery voltage reads as: "));
  Serial.println(voltage);

  if (voltage == -99.0)
  {
    Serial.println(F("A voltage of -99.0V indicates an error."));
  }
}

void loop()
{
  //Nothing to do here
}

Troubleshooting

If your smôl stack is not communicating, it is probably in deep sleep. When the Power Board is commanded into deep sleep by the Processor Board, the only way it will wake it up again is when the sleep interval expires. You cannot wake or reset the system via the USB interface.

Removing and re-inserting the battery connection will reset the power board and wake it up again.

We did not include a reset button on the smôl Power Board to keep the board as small as possible. However, you can reset it via the ISP programming test points on the bottom of the board. Briefly connect RESET to GND to reset the board.

Pictured are the RESET and GND test points on the bottom of the board
Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the smôl Power Board AAA, check out the following links:

smôl Power Board AAA Documentation:

Boost Regulator:

Microcontroller:

smôl Documentation:


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

smôl Header Hookup Guide

$
0
0

smôl Header Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2058

Introduction

smôl is a new board format and, as the name suggests, they're really small!

smôl Header

smôl Header

SPX-18620
$2.95

Need to do some prototyping with smôl? Or want to connect your smôl stack to a Qwiic board or your favorite SPI sensor? The smôl Header is the perfect solution!

Required Materials

If you want to connect a Qwiic board to your smôl stack, you're going to need some Qwiic cables:

SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

KIT-15081
$7.95
12
Qwiic Cable - 50mm

Qwiic Cable - 50mm

PRT-14426
$0.95
Flexible Qwiic Cable - Female Jumper (4-pin)

Flexible Qwiic Cable - Female Jumper (4-pin)

CAB-17261
$1.50
Qwiic Cable - Breadboard Jumper (4-pin)

Qwiic Cable - Breadboard Jumper (4-pin)

PRT-14425
$1.50

If you're prototyping with smôl, you may need:

Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.50
20
Breadboard - Classic

Breadboard - Classic

PRT-00112
$9.95
17
Jumper Wires Premium 6" M/M Pack of 10

Jumper Wires Premium 6" M/M Pack of 10

PRT-08431
$3.95
2
Breadboard - Mini Modular (Red)

Breadboard - Mini Modular (Red)

PRT-12044
$3.95

The Header is part of the smôl ecosystem. Why not pair it with one of the smôl Processor Boards?

smôl ESP32

smôl ESP32

SPX-18619
$17.95













To be able to reduce the sleep current below 10µA, you're going to want to pair the ESP32 with one of our intelligent smôl Power Boards:

smôl Power Board AAA

smôl Power Board AAA

SPX-18621
$17.95
smôl Power Board LiPo

smôl Power Board LiPo

SPX-18622
$17.95

Don't forget that you will need Flexible Printed Circuits to connect your smôl boards together. You're going to need one FPC per board. Our 36mm FPC is the perfect length if you want the smôl boards to stack neatly, one on top of the other.

smôl 36mm 16-way Flexible Printed Circuit

smôl 36mm 16-way Flexible Printed Circuit

CAB-18731
$0.95















Suggested Reading

This is the hookup guide for the smôl Header. Click the button below if you want to find out more about smôl itself.

We recommend taking a look through the following tutorials if you are not familiar with the concepts covered in them:

Serial Peripheral Interface (SPI)

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

I2C

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

Hardware Overview

smôl boards are designed to stack one on top of the other, using 16-way 0.5mm-pitch Flexible Printed Circuits (FPCs). We really like FPCs and we're using them on more and more of our products. But they can be a bit tricky when it comes to prototyping or if you want to connect other devices to your smôl stack. The smôl Header is here to help!

FPC Connections

Like all of our smôl boards, the Header is equipped with a 16-way 0.5mm-pitch Flexible Printed Circuit connector. The pin-out for the smôl Header connector is as follows:

Connector Pin No.Signal NameFunction
1PROC_PWR_ENProcessor Power Enable
23V33.3V Power Rail
3GNDPower Ground / 0V
4SCLKSPI Clock
5COPISPI Controller Out Peripheral In
6CIPOSPI Controller In Peripheral Out
7CS0SPI Chip Select 0
8CS1SPI Chip Select 1
8CS2SPI Chip Select 2
10GPIO0General Purpose Input / Output 0
11GPIO1General Purpose Input / Output 1
12SDAI2C Data
13SCLI2C Clock
14GNDPower Ground / 0V
153V33.3V Power Rail
16V_USBUSB Power Rail (5V)

Breakout Pins

You've got full access to all the smôl pins, so connecting your favorite SPI board to smôl is as easy as plug-and-play! The smôl Header breaks out all 16 smôl connections in good old 0.1" format. The hole pattern is the same as an old school 16-pin 0.3" Dual-In line Package (DIP). Perfect for soldering header pins to and then pushing into standard breadboard.

Pictured are the 16 header breakout pins

Pictured are the dimensions of the breakout pins

Qwiic Connector

We've included a Qwiic connector too, so you can attach your favorite Qwiic boards to your smôl stack qwiicly and easily.

Pictured is the header Qwiic connector

Qwiic (I2C) Pull-ups

The Header also includes pull-up resistors for the I2C SDA and SCL signals. You can disconnect the resistors if required by opening the dual split-pad jumper links.

Pictured are the two pull-up resistors and the split pad jumper links

If you haven't used jumpers before, please check out our tutorial.

How to Work with Jumper Pads and PCB Traces

Handling 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.

Troubleshooting


Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the smôl Header, check out the following links:

smôl Header Documentation:

smôl Documentation:


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

Qwiic ToF Imager - VL53L5CX Hookup Guide

$
0
0

Qwiic ToF Imager - VL53L5CX Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2002

Introduction

The Qwiic ToF Imager - VL53L5CX is here! This little breakout board is built around ST Electronics' VL53L5CX; a state of the art, Time-of-Flight (ToF), multizone ranging sensor enhancing the ST FlightSense product family. This chip integrates a SPAD array, physical infrared filters, and diffractive optical elements (DOE) to achieve the best ranging performance in various ambient lighting conditions with a range of cover glass materials.

Multizone distance measurements are possible up to 8x8 zones with a wide 63° diagonal FoV which can be reduced by software. Thanks to ST Histogram patented algorithms, the VL53L5CX is able to detect different objects within the FoV. The Histogram also provides immunity to cover glass crosstalk beyond 60 cm.

Ideal for 3D room mapping, obstacle detection for robotics, gesture recognition, IoT, laser-assisted autofocus, and AR/VR enhancement, the Qwiic connector on this sensor makes integration easy.

SparkFun Qwiic ToF Imager - VL53L5CX

SparkFun Qwiic ToF Imager - VL53L5CX

SEN-18642
$24.95

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.

Suggested Reading

If you aren't familiar with the Qwiic system, we recommend reading here for an overview.

Qwiic Connect System
Qwiic Connect System

We would also recommend taking a look at the following tutorials if you aren't familiar with them.

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.

How to Work with Jumper Pads and PCB Traces

Handling 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.

Hookup Guide for the SparkFun Artemis Thing Plus

Get started with our SparkFun Artemis Thing Plus - our popular Thing Plus footprint with the powerful Artemis module for ultimate functionality.

Hardware Overview

VL53L5CX

STMicroelectronics' VL53L5CX is a state of the art, time-of-flight (ToF), laser-ranging sensor with an 8x8 multizone range and a wide field of view. To see more details, refer to the datasheet.

The sensor is smack in the center of the board

Qwiic Connectors

Our Qwiic Ecosystem makes sensors pretty much plug and play. There are two Qwiic connectors on either side of the Qwiic Air Velocity Sensor board to provide power and I2C connectivity simultaneously.

The unshifted I2C address of the board is 0x52.

Qwiic connectors live on either side of the board (left and right)

Power

Ideally power will be supplied by the Qwiic connector, but if you wish to supply your own power, pins have been broken out along the bottom side of the board labeled 3V3 and GND. The input voltage range should be between 2.7-3.3V.

First two pins from the left on the bottom of the board are Ground and 3V3

I2C

The I2C pins break out the functionality of the Qwiic connectors. Depending on your application, you can connect to these pins via the plated through holes for SDA and SCL.

The two middle pins on the bottom edge of the board are SDA and SCL (in that order from left)

INT and RST

The interrupt pin is the interrupt output and defaults to an open-drain output. A 47 kΩ pull-up resistor to IOVDD is included.

The reset pin is the I2C interface reset pin and is active high. It is pulled to ground with a 47 kΩ resistor.

Interrupt and Reset are the two pins on the far right on the bottom side of the board

LP, VDDIO, & VDDA

LP is a low power enable pin. Drive this pin to logic 0 to disable the I2C comms to reduce power consumption. Drive this pin to logic 1 to enable I2C comms. This pin is typically only needed when you need to change the I2C address in multidevice systems. A 47 kΩ pull-up resistor to IOVDD is included so it can be left unconnected.

VDDIO/VDDA: These pins are used as an alternate power supply. By default, VDDIO and VDDA are tied together but by opening the PSU jumper they can be isolated. A user must then provide separate VDDIO and VDDA supplies. This is most applicable for users who want to use IO voltages (1.8, 2.8, or 3.3V) separate from AVDD voltages (2.8 or 3.3V) for maximum power reduction.

LP, VDDIO, and VDDA all live on the top side of the back of the board (in that order from left)

Jumpers

PSU

By default, VDDIO and VDDA are tied together. Cutting the PSU jumper will isolate the power rails. A user must then provide separate VDDIO and VDDA supplies. This is most applicable for users who want to use IO voltages (1.8, 2.8, or 3.3V) separate from AVDD voltages (2.8 or 3.3V) for maximum power reduction.

The PSU is the left, bottom jumper

INT

Cut the INT jumper to remove the 47 kΩ pull-up resistor from the INT pin.

INT is the top right jumper

I2C

The SparkFun Qwiic ToF Imager Sensor has two 2.2 kΩ pull-up resistors attached to the I2C bus by default. If multiple sensors are connected to the bus with the pull-up resistors enabled the parallel equivalent resistance may create too strong of a pull-up for the bus to operate correctly. As a general rule of thumb, disable all but one pair of pull-up resistors if multiple devices are connected to the bus. If you need to disconnect the pull-up resistors they can be removed by cutting the traces on the corresponding jumper highlighted below.

I2C is the top left jumper

LED

If minimal power consumption is a concern, or you just don't want that Power LED on the front of the board to light up, go ahead and cut this jumper.

LED is the bottom right jumper

Board Outline

This sensor measures 1" x 1".

Board measures 1" x 1"

Click the image for a closer view

Hardware Hookup

A note on choosing a board: The VL53L5CX is unique in that it requires its firmware to be loaded at power-on over the I2C bus. Because this firmware is ~90k bytes, we recommend a microcontroller with enough flash to store VL53L5CX's firmware as well as your program code. Sorry, Uno's are out. But didn't you want an excuse to try out something new? We recommend choosing either an Artemis Thing Plus or an ESP32 Thing Plus board as your development board.

Using the Qwiic system, assembling the hardware is simple. All you need to do is connect your VL53L5CX Imager Breakout to your chosen development board with a Qwiic cable or adapter cable. If Qwiic is not your thing, or if your dev board doesn't have one built in you can always solder directly to the I2C pins. If you are not using a Qwiic-enabled board, make sure your input voltage and logic are either running at 3.3V or you are shifting the logic level from whatever logic your controller runs at to 3.3V.

Artemis thing plus is connected to the ToF with a qwiic cable

Click the image for a closer view
Before Use: Make sure to remove the vacuum tape from the VL53L5CX sensor before first use!

Software Setup and Programming

Note: Make sure you are using the latest stable version of the Arduino IDE on your desktop. If this is your first time using Arduino IDE, library, or board add-on, please review the following tutorials.

We've written a simple Arduino library to quickly get started reading data from the Qwiic ToF Imager. Install the library through the Arduino Library Manager tool by searching for "SparkFun VL53L5CX". Users who prefer to manually install it can get the library from the GitHub Repository or download the ZIP by clicking the button below:


Example1_DistanceArray

Hook up your ToF imager to your Artemis Thing Plus via the Qwiic cables, and click "File>Examples>SparkFun VL53L5CX Arduino Library>Example1_DistanceArray".

Where to find the Examples in the arduino menu

We'll assume that you have selected the board (in this case the SparkFun Artemis Thing Plus) and the correct COM port at this point. If you have the code open, hit the upload button. Otherwise, copy and paste the following into the Arduino IDE, make sure to select the correct board and COM port, and then upload:

language:c
/*
  Read an 8x8 array of distances from the VL53L5CX
  By: Nathan Seidle
  SparkFun Electronics
  Date: October 26, 2021
  License: MIT. See license file for more information but you can
  basically do whatever you want with this code.

  This example shows how to read all 64 distance readings at once.

  Feel like supporting our work? Buy a board from SparkFun!
  https://www.sparkfun.com/products/18642

*/

#include <Wire.h>

#include <SparkFun_VL53L5CX_Library.h> //http://librarymanager/All#SparkFun_VL53L5CX

SparkFun_VL53L5CX myImager;
VL53L5CX_ResultsData measurementData; // Result data class structure, 1356 byes of RAM

int imageResolution = 0; //Used to pretty print output
int imageWidth = 0; //Used to pretty print output

void setup()
{
  Serial.begin(115200);
  delay(1000);
  Serial.println("SparkFun VL53L5CX Imager Example");

  Wire.begin(); //This resets to 100kHz I2C

  Serial.println("Initializing sensor board. This can take up to 10s. Please wait.");
  if (myImager.begin() == false)
  {
    Serial.println(F("Sensor not found - check your wiring. Freezing"));
    while (1) ;
  }

  myImager.setResolution(8*8); //Enable all 64 pads

  imageResolution = myImager.getResolution(); //Query sensor for current resolution - either 4x4 or 8x8
  imageWidth = sqrt(imageResolution); //Calculate printing width

  myImager.startRanging();
}

void loop()
{
  //Poll sensor for new data
  if (myImager.isDataReady() == true)
  {
    if (myImager.getRangingData(&measurementData)) //Read distance data into array
    {
      //The ST library returns the data transposed from zone mapping shown in datasheet
      //Pretty-print data with increasing y, decreasing x to reflect reality
      for (int y = 0 ; y <= imageWidth * (imageWidth - 1) ; y += imageWidth)
      {
        for (int x = imageWidth - 1 ; x >= 0 ; x--)
        {
          Serial.print("\t");
          Serial.print(measurementData.distance_mm[x + y]);
        }
        Serial.println();
      }
      Serial.println();
    }
  }

  delay(5); //Small delay between polling
}


Open up your Serial Monitor, make sure the baud rate is set appropriately, and you should see something like the following:

Serial Monitor output

Click the image for a closer view

Example2_FastStartup

Hook up your ToF imager to your Artemis Thing Plus via the Qwiic cables, and click "File>Examples>SparkFun VL53L5CX Arduino Library>Example2_FastStartup".

Where to find the Examples in the arduino menu

We'll assume that you have selected the board (in this case the SparkFun Artemis Thing Plus) and the correct COM port at this point. If you have the code open, hit the upload button. Otherwise, copy and paste the following into the Arduino IDE, make sure to select the correct board and COM port, and then upload:

language:c
/*
  Read an 8x8 array of distances from the VL53L5CX
  By: Nathan Seidle
  SparkFun Electronics
  Date: October 26, 2021
  License: MIT. See license file for more information but you can
  basically do whatever you want with this code.

  This example shows how to setup the I2C bus to minimize the amount
  of time taken to init the sensor.

  At each power on reset, a staggering 86,000 bytes of firmware have to be sent to the sensor.
  At 100kHz, this can take ~9.4s. By increasing the clock speed, we can cut this time down to ~1.4s.

  Two parameters can be tweaked: 

    Clock speed: The VL53L5CX has a max bus speed of 400kHz but we have had success up to 1MHz.

    Max transfer size: The majority of Arduino platforms default to 32 bytes. If you are using one 
    with a larger buffer (ESP32 is 128 bytes for example), this can help decrease transfer times a bit.

  Measurements:
    Default 100kHz clock and 32 byte transfer: 9.4s
    400kHz, 32 byte transfer: 2.8s
    400kHz, 128 byte transfer: 2.5s
    1MHz, 32 byte transfer: 1.65s
    1MHz, 128 byte transfer: 1.4s

  Feel like supporting our work? Buy a board from SparkFun!
  https://www.sparkfun.com/products/18642

*/

#include <Wire.h>

#include <SparkFun_VL53L5CX_Library.h> //http://librarymanager/All#SparkFun_VL53L5CX

SparkFun_VL53L5CX myImager;
VL53L5CX_ResultsData measurementData; // Result data class structure, 1356 byes of RAM

int imageResolution = 0; //Used to pretty print output
int imageWidth = 0; //Used to pretty print output

void setup()
{
  Serial.begin(115200);
  delay(1000);
  Serial.println("SparkFun VL53L5CX Imager Example");

  Wire.begin(); //This resets I2C bus to 100kHz
  Wire.setClock(400000); //Sensor has max I2C freq of 400kHz 
  //Wire.setClock(1000000); //Run sensor out of spec

  //myImager.setWireMaxPacketSize(128); //Increase default from 32 bytes to 128 - not supported on all platforms

  Serial.println("Initializing sensor board. This can take up to 10s. Please wait.");

  //Time how long it takes to transfer firmware to sensor
  long startTime = millis();
  bool startup = myImager.begin();
  long stopTime = millis();

  if (startup == false)
  {
    Serial.println(F("Sensor not found - check your wiring. Freezing"));
    while (1) ;
  }

  Serial.print("Firmware transfer time: ");
  float timeTaken = (stopTime - startTime) / 1000.0;
  Serial.print(timeTaken, 3);
  Serial.println("s");

  myImager.setResolution(8*8); //Enable all 64 pads

  imageResolution = myImager.getResolution(); //Query sensor for current resolution - either 4x4 or 8x8
  imageWidth = sqrt(imageResolution); //Calculate printing width

  myImager.startRanging();
}

void loop()
{
  //Poll sensor for new data
  if (myImager.isDataReady() == true)
  {
    if (myImager.getRangingData(&measurementData)) //Read distance data into array
    {
      //The ST library returns the data transposed from zone mapping shown in datasheet
      //Pretty-print data with increasing y, decreasing x to reflect reality
      for (int y = 0 ; y <= imageWidth * (imageWidth - 1) ; y += imageWidth)
      {
        for (int x = imageWidth - 1 ; x >= 0 ; x--)
        {
          Serial.print("\t");
          Serial.print(measurementData.distance_mm[x + y]);
        }
        Serial.println();
      }
      Serial.println();
    }
  }

  delay(5); //Small delay between polling
}


Open up your Serial Monitor, make sure the baud rate is set appropriately, and you should see something like the following:

Serial Monitor output

Click the image for a closer view

Example3_SetFrequency

Hook up your ToF imager to your Artemis Thing Plus via the Qwiic cables, and click "File>Examples>SparkFun VL53L5CX Arduino Library>Example3_SetFrequency".

Where to find the Examples in the arduino menu

We'll assume that you have selected the board (in this case the SparkFun Artemis Thing Plus) and the correct COM port at this point. If you have the code open, hit the upload button. Otherwise, copy and paste the following into the Arduino IDE, make sure to select the correct board and COM port, and then upload:

language:c
/*
  Read an 8x8 array of distances from the VL53L5CX
  By: Nathan Seidle
  SparkFun Electronics
  Date: October 26, 2021
  License: MIT. See license file for more information but you can
  basically do whatever you want with this code.

  This example shows how to increase output frequency.

  Default is 1Hz.
  Using 4x4, min frequency is 1Hz and max is 60Hz
  Using 8x8, min frequency is 1Hz and max is 15Hz

  Feel like supporting our work? Buy a board from SparkFun!
  https://www.sparkfun.com/products/18642

*/

#include <Wire.h>

#include <SparkFun_VL53L5CX_Library.h> //http://librarymanager/All#SparkFun_VL53L5CX

SparkFun_VL53L5CX myImager;
VL53L5CX_ResultsData measurementData; // Result data class structure, 1356 byes of RAM

int imageResolution = 0; //Used to pretty print output
int imageWidth = 0; //Used to pretty print output

void setup()
{
  Serial.begin(115200);
  delay(1000);
  Serial.println("SparkFun VL53L5CX Imager Example");

  Wire.begin(); //This resets I2C bus to 100kHz
  Wire.setClock(400000); //Sensor has max I2C freq of 400kHz

  Serial.println("Initializing sensor board. This can take up to 10s. Please wait.");
  if (myImager.begin() == false)
  {
    Serial.println(F("Sensor not found - check your wiring. Freezing"));
    while (1) ;
  }

  myImager.setResolution(8 * 8); //Enable all 64 pads

  imageResolution = myImager.getResolution(); //Query sensor for current resolution - either 4x4 or 8x8
  imageWidth = sqrt(imageResolution); //Calculate printing width

  //Using 4x4, min frequency is 1Hz and max is 60Hz
  //Using 8x8, min frequency is 1Hz and max is 15Hz
  bool response = myImager.setRangingFrequency(15);
  if (response == true)
  {
    int frequency = myImager.getRangingFrequency();
    if (frequency > 0)
    {
      Serial.print("Ranging frequency set to ");
      Serial.print(frequency);
      Serial.println(" Hz.");
    }
    else
      Serial.println(F("Error recovering ranging frequency."));
  }
  else
  {
    Serial.println(F("Cannot set ranging frequency requested. Freezing..."));
    while (1) ;
  }

  myImager.startRanging();
}

void loop()
{
  //Poll sensor for new data
  if (myImager.isDataReady() == true)
  {
    if (myImager.getRangingData(&measurementData)) //Read distance data into array
    {
      //The ST library returns the data transposed from zone mapping shown in datasheet
      //Pretty-print data with increasing y, decreasing x to reflect reality
      for (int y = 0 ; y <= imageWidth * (imageWidth - 1) ; y += imageWidth)
      {
        for (int x = imageWidth - 1 ; x >= 0 ; x--)
        {
          Serial.print("\t");
          Serial.print(measurementData.distance_mm[x + y]);
        }
        Serial.println();
      }
      Serial.println();
    }
  }

  delay(5); //Small delay between polling
}


Open up your Serial Monitor, make sure the baud rate is set appropriately, and you should see something like the following:

Serial Monitor output

Click the image for a closer view

Troubleshooting

Resources and Going Further

Now that you've successfully got your Qwiic ToF sensor up and running, 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:

Qwiic Real Time Clock Module (RV-1805) Hookup Guide

Find out what time it is, even after the power's been out on your project for a while with the Qwiic Real Time Clock (RTC) module.

RedBoard Qwiic Hookup Guide

This tutorial covers the basic functionality of the RedBoard Qwiic. This tutorial also covers how to get started blinking an LED and using the Qwiic system.

Keyboard Shortcut, Qwiic Keypad

A simple project using the Qwiic Keypad and the RedBoard Turbo to create your own custom hotkey-pad.

SparkFun Photodetector (MAX30101) Hookup Guide

The SparkFun Photodetector - MAX30101 (Qwiic) is the successor to the MAX30105 particle sensor, a highly sensitive optical sensor. This tutorial will get you started on retrieving the raw data from the MAX30101 sensor.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

MicroMod Environmental Function Board Hookup Guide

$
0
0

MicroMod Environmental Function Board Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2001

Introduction

The SparkFun MicroMod Environmental Function Board adds additional sensing options to the MicroMod Processor Boards. This function board includes three sensors to monitor air quality (SGP40), humidity & temperature (SHTC3), and CO2 concentrations (STC31) in your indoor environment. To make it even easier to use, all communication is over the MicroMod's I2C bus! In this tutorial, we will go over how to connect the board and read the sensors.

SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95

Required Materials

To follow along with this tutorial, you will need the following materials at a minimum. 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.

Reversible USB A to C Cable - 2m

Reversible USB A to C Cable - 2m

CAB-15424
$7.95
SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
Pocket Screwdriver Set

Pocket Screwdriver Set

TOL-12891
$3.95
5
microSD Card - 1GB (Class 4)

microSD Card - 1GB (Class 4)

COM-15107
$4.95
SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95

MicroMod Main Board

To hold the processor and function boards, you will need one Main board. Depending on your application, you may choose to have either one or two function boards.

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

MicroMod Function Board

To add additional functionality to your Processor Board, you'll want to include one or two function boards when connecting them to the Main Board. Besides the MicroMod Environmental Function Board which this tutorial is focused on, you may descide to add the WiFi Function Board to the mix. Make sure to adjust the cart and include the MicroMod Main Board - Double as opposed to the Single when using two Function Boards. Check out the SparkFun catalog for other function boards.

SparkFun MicroMod WiFi Function Board - ESP32

SparkFun MicroMod WiFi Function Board - ESP32

WRL-18430
$14.95
SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95

Tools

You will need a screw driver to secure the Processor and Function boards.

SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Suggested Reading

If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview.

MicroMod Logo
MicroMod Ecosystem

If you aren’t familiar with the following concepts, we also recommend checking out a few of these tutorials before continuing. Make sure to check the respective hookup guides for your processor board and function board to ensure that you are installing the correct USB-to-serial converter. You may also need to follow additional instructions that are not outlined in this tutorial to install the appropriate software.

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.

Installing Arduino IDE

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

How to Install CH340 Drivers

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic) Hookup Guide

A Hookup Guide to get started using the SHTC3 breakout.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Air Quality Sensor - SGP40 (Qwiic) Hookup Guide

Get started measuring indoor air quality with the SparkFun Air Quality Sensor - SGP40 (Qwiic) Hookup Guide.

Hardware Overview

This section goes over the important features on the MicroMod Environmental Function Board. Of course, we recommend checking out the Resources and Going Further for more information on each sensor.

Power

To power the board, you will need to apply power to a SparkFun Main Board. Power applied will connect to the Function Board's VIN pin, which will be regulated down for the rest of the board with the AP2112 3.3V/600mA voltage regulator.

Voltage Regulator

SGP40

The board includes the Sensirion SGP40 sensor IC which measures air quality. The reserved I2C address for the SGP40 is 0x59. For easy reference, the default address for the SGP40 is labeled on the board.

SGP40

SHTC3

The board includes the Sensirion SHTC3 sensor IC which measures humidity and temperature. The reserved I2C address for the SHTC3 is 0x70. For easy reference, the default address for the SHTC3 is labeled on the board.

SHTC3

STC31

The board includes the Sensirion STC31 sensor IC which measures CO2 concentrations in N2 and CO2 in air. The reserved I2C address for the STC31 is 0x29. For easy reference, the default address for the STC31 is labeled on the board.

STC31

EEPROM

The board includes an I2C EEPROM. Unfortunately, this is not available for the user and was meant to hold board specific information.

EEPROM

LED

There is one LED to indicate when there is power available. You can disable the LED with the PWR jumper

LED

Jumpers

The following jumpers are included to configure the board.

  • PWR - By default, the jumper with the label PWR is closed. This jumper connects the 3.3V line and LED. Cutting this jumper will disable the LED.
  • I2C Pull-up Resistors - By default, this three way jumper labeled I2C is closed and connects two pull-up resistors to the I2C data lines. If you have many devices on your I2C data lines, then you may consider cutting these two jumpers.
  • STC31 Address Selection - There are three jumpers available on the board to adjust the STC31's address. By default, the jumpers are open. The alternative addresses for the sensor are 0x2A, 0x2B, and 0x2C. To select the address, you will need to close the jumper by adding a solder blob to one of the solder jumpers.


alt text

MicroMod Function Board Pinout

Depending on your window size, you may need to use the horizontal scroll bar at the bottom of the table to view the additional pin functions. Note that the M.2 connector pins on opposing sides are offset from each other as indicated by the bottom pins where it says (Not Connected)*. There is no connection to pins that have a "-" under the primary function.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
FunctionBottom
Pin
   Top   
Pin
Function
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
Alternative FunctionPrimary FunctionBottom
Pin
   Top   
Pin
Primary FunctionAlternative Function
(Not Connected)75GND
VIN74733.3V
VIN7271Power EN
-7069-
-6665-
-6463-
-6261-
-6059-
-5857-
-5655-
-5453-
-5251-
-5049-
-4847-
-4645GND
-4443-
-4241-
-4039GND
-3837-
EEPROM_A03635-
EEPROM_A13433GND
EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423-
-2221I2C_SCL
-2019I2C_SDA
-1817-
-1615-
-1413-
-1211-
-109-
-87-
-65-
-43-
-21GND
Signal GroupSignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT/I2S_OUT/CAM_MCLKOAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN/I2S_IN/CAM_PCLKIAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC/I2S_WS/PDM_DATAI/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK/I2S_CLK/PDM_CLKOAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General/BusG0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-/CAM_HSYNCI/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+/CAM_VSYNCI/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

Board Dimensions

The board uses the standard MicroMod Function Board size which measures about 1.50"x2.56".

Board Dimensions

Hardware Hookup

If you have not already, make sure to check out the Getting Started with MicroMod: Hardware Hookup for information on inserting your Processor and Function Boards to the Main Board.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

After securing the Processor and Function Board to the Main Board, your setup should look like the image below. Connect a USB Type C Cable to begin programming your Processor Board. In this case, we used the MicroMod Main Board - Single, MicroMod Artemis Processor, and MicroMod Environmental Function Board.

Main Board, Processor, and Function Boards

Software Installation

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review the following tutorials.

Arduino Board Definitions

We'll assume that you installed the necessary board files and drivers for your Processor Board. In this case, we used the MicroMod Artemis Processor Board which uses the CH340 USB-to-serial converter. If you are using a Processor Board, make sure to check out its hookup guide for your Processor Board.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

MicroMod Artemis Processor Board Hookup Guide

October 21, 2020

Get started with the Artemis MicroMod Processor Board in this tutorial!

How to Install CH340 Drivers

August 6, 2019

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Arduino Library

The SparkFun SGP40, SHTC3, and STC3X Arduino libraries can be downloaded with the Arduino library manager by searching 'SparkFun SGP40,' 'SHTC3,' and 'STC3X'. Or you can grab the zip here from each respective GitHub repository (SGP40, SHTC3, STC3X) to manually install:

Arduino Example

Example 1: Reading SHTC3, STC31, and SGP40

Below is the combined example to read SHTC3, STC31, and SGP40.

language:c
/******************************************************************************

  WRITTEN BY: Ho Yun "Bobby" Chan
  @ SparkFun Electronics
  DATE: 10/19/2021
  GITHUB REPO: https://github.com/sparkfun/MicroMod_Environmental_Sensor_Function_Board
  DEVELOPMENT ENVIRONMENT SPECIFICS:
    Firmware developed using Arduino IDE v1.8.12

  ========== DESCRIPTION==========
  This example code combines example codes from the SHTC3, STC31, and SGP40 libraries.
  Most of the steps to obtain the measurements are the same as the example code.
  Generic object names were renamed (e.g. mySensor => mySGP40 and mySTC3x).

     Example 1: Basic Relative Humidity and Temperature Readings  w/ SHTC3; Written by Owen Lyke
     Example 2: PHT (SHTC3) Compensated CO2 Readings w/ STC31; Written by Paul Clark and based on earlier code by Nathan Seidle
     Example 1: Basic VOC Index w/ SGP40; Written by Paul Clark

  Open a Serial Monitor at 115200 baud to view the readings!

  Note: You may need to wait about ~5 minutes after starting up the code before VOC index
  has any values.

  ========== HARDWARE CONNECTIONS ==========
  MicroMod Artemis Processor Board => MicroMod Main Board => MicroMod Environmental Function Board (with SHTC3, STC31, and SGP40)

  Feel like supporting open source hardware?
  Buy a board from SparkFun!
       MicroMod MicroMod Artemis Processor   | https://www.sparkfun.com/products/16401
       MicroMod Main Board - Single          | https://www.sparkfun.com/products/18575
       MicroMod Environmental Function Board | https://www.sparkfun.com/products/18632

  You can also get the sensors individually.

       Qwiic SHTC3 | https://www.sparkfun.com/products/16467
       Qwiic STC31 | https://www.sparkfun.com/products/18385
       Qwiic SGP40 | https://www.sparkfun.com/products/17729

  LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)

******************************************************************************/



#include <Wire.h>

#include "SparkFun_SHTC3.h" //Click here to get the library: http://librarymanager/All#SparkFun_SHTC3
SHTC3 mySHTC3; // Create an object of the SHTC3 class

#include "SparkFun_STC3x_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_STC3x
STC3x mySTC3x; // Create an object of the mySTC3x class

#include "SparkFun_SGP40_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_SGP40
SGP40 mySGP40; //Create an object of the SGP40 class

float RH = 0.00; // Variable to keep track of SHTC3 temperature compensation for the STC31
float temperature = 0.00; // Variable to keep track of SHTC3 relative humidity compensation for the STC31






void setup() {

  Serial.begin(115200);
  //while (!Serial) ; // Wait for Serial Monitor/Plotter to open for Processors with Native USB (i.e. SAMD51)
  Serial.println(F("Initializing Combined Example w/ SGP40, SHTC3, and STC31."));
  Wire.begin();

  //mySTC3x.enableDebugging(); // Uncomment this line to get helpful debug messages on Serial
  //mySGP40.enableDebugging(); // Uncomment this line to print useful debug messages to Serial



  if (mySHTC3.begin() != SHTC3_Status_Nominal)
  {
    Serial.println(F("SHTC3 not detected. Please check wiring. Freezing..."));
    while (1)
      ; // Do nothing more
  }

  if (mySTC3x.begin() == false)
  {
    Serial.println(F("STC3x not detected. Please check wiring. Freezing..."));
    while (1)
      ; // Do nothing more
  }

  if (mySGP40.begin() == false)
  {
    Serial.println(F("SGP40 not detected. Check connections. Freezing..."));
    while (1)
      ; // Do nothing more
  }



  //We need to tell the STC3x what binary gas and full range we are using
  //Possible values are:
  //  STC3X_BINARY_GAS_CO2_N2_100   : Set binary gas to CO2 in N2.  Range: 0 to 100 vol%
  //  STC3X_BINARY_GAS_CO2_AIR_100  : Set binary gas to CO2 in Air. Range: 0 to 100 vol%
  //  STC3X_BINARY_GAS_CO2_N2_25    : Set binary gas to CO2 in N2.  Range: 0 to 25 vol%
  //  STC3X_BINARY_GAS_CO2_AIR_25   : Set binary gas to CO2 in Air. Range: 0 to 25 vol%
  if (mySTC3x.setBinaryGas(STC3X_BINARY_GAS_CO2_AIR_25) == false)
  {
    Serial.println(F("Could not set the binary gas! Freezing..."));
    while (1)
      ; // Do nothing more
  }



  //We can compensate for temperature and relative humidity using the readings from the SHTC3

  if (mySHTC3.update() != SHTC3_Status_Nominal) // Request a measurement
  {
    Serial.println(F("Could not read the RH and T from the SHTC3! Freezing..."));
    while (1)
      ; // Do nothing more
  }

  //In case the ‘Set temperature command’ has been used prior to the measurement command,
  //the temperature value given out by the STC31 will be that one of the ‘Set temperature command’.
  //When the ‘Set temperature command’ has not been used, the internal temperature value can be read out.
  temperature = mySHTC3.toDegC(); // "toDegC" returns the temperature as a floating point number in deg C
  Serial.print(F("Setting STC3x temperature to "));
  Serial.print(temperature, 2);
  Serial.print(F("C was "));
  if (mySTC3x.setTemperature(temperature) == false)
    Serial.print(F("not "));
  Serial.println(F("successful"));

  RH = mySHTC3.toPercent(); // "toPercent" returns the percent humidity as a floating point number
  Serial.print(F("Setting STC3x RH to "));
  Serial.print(RH, 2);
  Serial.print(F("% was "));
  if (mySTC3x.setRelativeHumidity(RH) == false)
    Serial.print(F("not "));
  Serial.println(F("successful"));

  //If we have a pressure sensor available, we can compensate for ambient pressure too.
  //As an example, let's set the pressure to 840 mbar (== SF Headquarters)
  uint16_t pressure = 840;
  Serial.print(F("Setting STC3x pressure to "));
  Serial.print(pressure);
  Serial.print(F("mbar was "));
  if (mySTC3x.setPressure(pressure) == false)
    Serial.print(F("not "));
  Serial.println(F("successful"));

  Serial.println(F("Note: Relative humidity and temperature compensation for the STC31 will be updated frequently in the main loop() function."));

} //end setup()






void loop() {

  //==============================
  //==========READ SHTC3==========
  //==============================
  //minimum update rate = ~100Hz

  SHTC3_Status_TypeDef result = mySHTC3.update();           // Call "update()" to command a measurement, wait for measurement to complete, and update the RH and T members of the object

  RH = mySHTC3.toPercent();                                 // "toPercent" returns the percent humidity as a floating point number
  Serial.print(F("RH = "));
  Serial.print(RH);

  Serial.print(F("%, T = "));
  Serial.print(mySHTC3.toDegF());                           // "toDegF" return the temperature as a flaoting point number in deg F
  Serial.print(F(" deg F, "));

  temperature = mySHTC3.toDegC();                           // "toDegC" returns the temperature as a floating point number in deg C
  Serial.print(temperature);
  Serial.print(F(" deg C"));

  if (mySHTC3.lastStatus == SHTC3_Status_Nominal)           // You can also assess the status of the last command by checking the ".lastStatus" member of the object
  {
    Serial.println("");                                         //Sample data good, no need to output a message
  }
  else {
    Serial.print(F(",     Update failed, error: "));        //notify user if there is an error
    errorDecoder(mySHTC3.lastStatus);
    Serial.println("");
  }



  //==============================
  //==========READ STC31==========
  //==============================
  //minimum update rate = 1Hz


  if (mySTC3x.setRelativeHumidity(RH) == false)
    Serial.print(F("Unable to set STC31 Relative Humidity with SHTC3."));

  if (mySTC3x.setTemperature(temperature) == false)
    Serial.println(F("Unable to set STC31 Temperature with SHTC3."));


  Serial.print(F("CO2(%): "));

  if (mySTC3x.measureGasConcentration())                   // measureGasConcentration will return true when fresh data is available
  {
    Serial.println(mySTC3x.getCO2(), 2);
  }
  else
  {
    Serial.print(mySTC3x.getCO2(), 2);
    Serial.println(F(",     (old STC3 sample reading, STC31 was not able to get fresh data yet)"));  //output this note to indicate  when we are not able to obtain a new measurement
  }



  //==============================
  //==========READ SGP40==========
  //==============================
  //minimum update rate = 1Hz

  Serial.print(F("VOC Index is: "));
  Serial.println(mySGP40.getVOCindex()); //Get the VOC Index using the default RH (50%) and T (25C)



  //================================
  //=========SPACE & DELAY==========
  //================================
  //Serial.println("");// Uncomment this line to add some space between readings for the Serial Monitor
  delay(1000); //Wait 1 second - the Sensirion VOC and CO2 algorithms expects a sample rate of 1Hz

}//end loop()





void errorDecoder(SHTC3_Status_TypeDef message)                             // The errorDecoder function prints "SHTC3_Status_TypeDef" results in a human-friendly way
{
  switch (message)
  {
    case SHTC3_Status_Nominal : Serial.print("Nominal"); break;
    case SHTC3_Status_Error : Serial.print("Error"); break;
    case SHTC3_Status_CRC_Fail : Serial.print("CRC Fail"); break;
    default : Serial.print("Unknown return code"); break;
  }
}

Example 2: Reading SHTC3, STC31, and SGP40 in CSV

Below is the same combined code but formatted for CSV.

language:c
/******************************************************************************

  WRITTEN BY: Ho Yun "Bobby" Chan
  @ SparkFun Electronics
  DATE: 10/19/2021
  GITHUB REPO: https://github.com/sparkfun/MicroMod_Environmental_Sensor_Function_Board
  DEVELOPMENT ENVIRONMENT SPECIFICS:
    Firmware developed using Arduino IDE v1.8.12

  ========== DESCRIPTION==========
  This example code combines example codes from the SHTC3, STC31, and SGP40 libraries.
  Most of the steps to obtain the measurements are the same as the example code.
  Generic object names were renamed (e.g. mySensor => mySGP40 and mySTC3x).

     Example 1: Basic Relative Humidity and Temperature Readings  w/ SHTC3; Written by Owen Lyke
     Example 2: PHT (SHTC3) Compensated CO2 Readings w/ STC31; Written by Paul Clark and based on earlier code by Nathan Seidle
     Example 1: Basic VOC Index w/ SGP40; Written by Paul Clark

  Open a Serial Monitor/Plotter at 115200 baud to view the readings!

  Note: You may need to wait about ~5 minutes after starting up the code before VOC index
  has any values.

  ========== HARDWARE CONNECTIONS ==========
  MicroMod Artemis Processor Board => MicroMod Main Board => MicroMod Environmental Function Board (with SHTC3, STC31, and SGP40)

  Feel like supporting open source hardware?
  Buy a board from SparkFun!
       MicroMod MicroMod Artemis Processor   | https://www.sparkfun.com/products/16401
       MicroMod Main Board - Single          | https://www.sparkfun.com/products/18575
       MicroMod Environmental Function Board | https://www.sparkfun.com/products/18632

  You can also get the sensors individually.
       SHTC3 | https://www.sparkfun.com/products/16467
       STC31 | https://www.sparkfun.com/products/18385
       SGP40 | https://www.sparkfun.com/products/17729

  LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)

******************************************************************************/



#include <Wire.h>

#include "SparkFun_SHTC3.h" //Click here to get the library: http://librarymanager/All#SparkFun_SHTC3
SHTC3 mySHTC3; // Create an object of the SHTC3 class

#include "SparkFun_STC3x_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_STC3x
STC3x mySTC3x; // Create an object of the STC3x class

#include "SparkFun_SGP40_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_SGP40
SGP40 mySGP40; //Create an object of the SGP40 class

float RH = 0.00; // Variable to keep track of SHTC3 temperature compensation for the STC31
float temperature = 0.00; // Variable to keep track of SHTC3 relative humidity compensation for the STC31

//Debug mode, comment one of these lines out using a syntax
//for a single line comment ("//"):
#define DEBUG 0     //0 = Output for Serial Plotter, CSV
//#define DEBUG 1     //1 = Output for Serial Monitor





void setup() {

  Serial.begin(115200);
  //while (!Serial) ; // Wait for Serial Monitor/Plotter to open for Processors with Native USB (i.e. SAMD51)


#if DEBUG
  Serial.println(F("Initializing Combined Example w/ SGP40, SHTC3, and STC31."));
#else
  Serial.println(F("RH,degF,degC,SHTC3_Valid,RH_Compensate_Valid,degC_Compensate_Valid,CO2%,STC31_Valid,VOC_Index"));
#endif

  Wire.begin();

  //mySTC3x.enableDebugging(); // Uncomment this line to get helpful debug messages on Serial
  //mySGP40.enableDebugging(); // Uncomment this line to print useful debug messages to Serial



  if (mySHTC3.begin() != SHTC3_Status_Nominal)
  {
#if DEBUG
    Serial.println(F("SHTC3 not detected. Please check wiring. Freezing..."));
#endif
    while (1)
      ; // Do nothing more
  }

  if (mySTC3x.begin() == false)
  {
#if DEBUG
    Serial.println(F("STC3x not detected. Please check wiring. Freezing..."));
#endif
    while (1)
      ; // Do nothing more
  }

  if (mySGP40.begin() == false)
  {
#if DEBUG
    Serial.println(F("SGP40 not detected. Check connections. Freezing..."));
#endif
    while (1)
      ; // Do nothing more
  }



  //We need to tell the STC3x what binary gas and full range we are using
  //Possible values are:
  //  STC3X_BINARY_GAS_CO2_N2_100   : Set binary gas to CO2 in N2.  Range: 0 to 100 vol%
  //  STC3X_BINARY_GAS_CO2_AIR_100  : Set binary gas to CO2 in Air. Range: 0 to 100 vol%
  //  STC3X_BINARY_GAS_CO2_N2_25    : Set binary gas to CO2 in N2.  Range: 0 to 25 vol%
  //  STC3X_BINARY_GAS_CO2_AIR_25   : Set binary gas to CO2 in Air. Range: 0 to 25 vol%
  if (mySTC3x.setBinaryGas(STC3X_BINARY_GAS_CO2_AIR_25) == false)
  {
#if DEBUG
    Serial.println(F("Could not set the binary gas! Freezing..."));
#endif
    while (1)
      ; // Do nothing more
  }



  //We can compensate for temperature and relative humidity using the readings from the SHTC3

  if (mySHTC3.update() != SHTC3_Status_Nominal) // Request a measurement
  {
#if DEBUG
    Serial.println(F("Could not read the RH and T from the SHTC3! Freezing..."));
#endif
    while (1)
      ; // Do nothing more
  }

  //In case the ‘Set temperature command’ has been used prior to the measurement command,
  //the temperature value given out by the STC31 will be that one of the ‘Set temperature command’.
  //When the ‘Set temperature command’ has not been used, the internal temperature value can be read out.
  temperature = mySHTC3.toDegC(); // "toDegC" returns the temperature as a floating point number in deg C
#if DEBUG
  Serial.print(F("Setting STC3x temperature to "));
  Serial.print(temperature, 2);
  Serial.print(",");
  Serial.print(F("C was "));
#endif

  if (mySTC3x.setTemperature(temperature) == false) {
#if DEBUG
    Serial.print(F("not "));
#endif
  }
#if DEBUG
  Serial.println(F("successful"));
#endif

  RH = mySHTC3.toPercent(); // "toPercent" returns the percent humidity as a floating point number

#if DEBUG
  Serial.print(F("Setting STC3x RH to "));
  Serial.print(RH, 2);
  Serial.print(",");
  Serial.print(F("% was "));
#endif

  if (mySTC3x.setRelativeHumidity(RH) == false) {
#if DEBUG
    Serial.print(F("not "));
#endif
  }
#if DEBUG
  Serial.println(F("successful"));
#endif



  //If we have a pressure sensor available, we can compensate for ambient pressure too.
  //As an example, let's set the pressure to 840 mbar (== SF Headquarters)
  uint16_t pressure = 840;

#if DEBUG
  Serial.print(F("Setting STC3x pressure to "));
  Serial.print(pressure);
  Serial.print(F("mbar was "));
#endif

  if (mySTC3x.setPressure(pressure) == false) {
#if DEBUG
    Serial.print(F("not "));
#endif
  }
#if DEBUG
  Serial.println(F("successful"));

  Serial.println(F("Note: Relative humidity and temperature compensation for the STC31 will be updated frequently in the main loop() function."));
#endif

} //end setup()





void loop() {


  //==============================
  //======DEBUG TURNED ON=========
  //==============================
#if DEBUG
  //==============================
  //==========READ SHTC3==========
  //==============================
  //minimum update rate = ~100Hz

  SHTC3_Status_TypeDef result = mySHTC3.update();           // Call "update()" to command a measurement, wait for measurement to complete, and update the RH and T members of the object

  RH = mySHTC3.toPercent();                                 // "toPercent" returns the percent humidity as a floating point number
  Serial.print(F("RH = "));
  Serial.print(RH);

  Serial.print(F("%, T = "));
  Serial.print(mySHTC3.toDegF());                           // "toDegF" return the temperature as a flaoting point number in deg F
  Serial.print(F(" deg F, "));

  temperature = mySHTC3.toDegC();                           // "toDegC" returns the temperature as a floating point number in deg C
  Serial.print(temperature);
  Serial.print(F(" deg C"));

  if (mySHTC3.lastStatus == SHTC3_Status_Nominal)           // You can also assess the status of the last command by checking the ".lastStatus" member of the object
  {
    Serial.println("");                                         //Sample data good, no need to output a message
  }
  else {
    Serial.print(F(",     Update failed, error: "));        //notify user if there is an error
    errorDecoder(mySHTC3.lastStatus);
    Serial.println("");
  }



  //==============================
  //==========READ STC31==========
  //==============================
  //minimum update rate = 1Hz


  if (mySTC3x.setRelativeHumidity(RH) == false)
    Serial.print(F("Unable to set STC31 Relative Humidity with SHTC3."));

  if (mySTC3x.setTemperature(temperature) == false)
    Serial.println(F("Unable to set STC31 Temperature with SHTC3."));


  Serial.print(F("CO2(%): "));

  if (mySTC3x.measureGasConcentration())                   // measureGasConcentration will return true when fresh data is available
  {
    Serial.println(mySTC3x.getCO2(), 2);
  }
  else
  {
    Serial.print(mySTC3x.getCO2(), 2);
    Serial.println(F(",     (old STC3 sample reading, STC31 was not able to get fresh data yet)"));  //output this note to indicate  when we are not able to obtain a new measurement
  }



  //==============================
  //==========READ SGP40==========
  //==============================
  //minimum update rate = 1Hz

  Serial.print(F("VOC Index is: "));
  Serial.println(mySGP40.getVOCindex()); //Get the VOC Index using the default RH (50%) and T (25C)





  //==============================
  //=====DEBUG TURNED OFF=========
  //==============================
#else
  //==============================
  //==========READ SHTC3==========
  //==============================
  //minimum update rate = ~100Hz

  SHTC3_Status_TypeDef result = mySHTC3.update();           // Call "update()" to command a measurement, wait for measurement to complete, and update the RH and T members of the object

  RH = mySHTC3.toPercent();
  Serial.print(RH);
  Serial.print(",");
  Serial.print(mySHTC3.toDegF());
  Serial.print(",");
  temperature = mySHTC3.toDegC();                           // "toDegC" returns the temperature as a floating point number in deg C
  Serial.print(temperature);
  Serial.print(",");

  if (mySHTC3.lastStatus == SHTC3_Status_Nominal)           // You can also assess the status of the last command by checking the ".lastStatus" member of the object
  {
    Serial.print("1");                                         //Sample data good, no need to output a message
    Serial.print(",");
  }
  else
  {
    Serial.print("0");                                         //Sample data bad, no need to output a message
    Serial.print(",");
  }



  //==============================
  //==========READ STC31==========
  //==============================
  //minimum update rate = 1Hz


  if (mySTC3x.setRelativeHumidity(RH) == false)
  {
    //Serial.print(F("Unable to set STC31 Relative Humidity with SHTC3."));
    Serial.print("0");
    Serial.print(",");
  }
  else
  {
    Serial.print("1");
    Serial.print(",");
  }

  if (mySTC3x.setTemperature(temperature) == false)
  {
    //Serial.println(F("Unable to set STC31 Temperature with SHTC3."));
    Serial.print("0");
    Serial.print(",");
  }
  else
  {
    Serial.print("1");
    Serial.print(",");
  }

  if (mySTC3x.measureGasConcentration())                   // measureGasConcentration will return true when fresh data is available
  {
    Serial.print(mySTC3x.getCO2(), 2);
    Serial.print(",");
    Serial.print("1");                                     //Fresh Data
    Serial.print(",");
  }
  else
  {
    Serial.print(mySTC3x.getCO2(), 2);
    Serial.print(",");
    Serial.print("0");                                     //Data not fresh
    Serial.print(",");
  }



  //==============================
  //==========READ SGP40==========
  //==============================
  //minimum update rate = 1Hz

  Serial.println(mySGP40.getVOCindex()); //Get the VOC Index using the default RH (50%) and T (25C)

#endif



  //================================
  //=========SPACE & DELAY==========
  //================================
  //Serial.println("");// Uncomment this line to add some space between readings for the Serial Monitor
  delay(1000); //Wait 1 second - the Sensirion VOC algorithm expects a sample rate of 1Hz

}//end loop()





void errorDecoder(SHTC3_Status_TypeDef message)                             // The errorDecoder function prints "SHTC3_Status_TypeDef" resultsin a human-friendly way
{
  switch (message)
  {
    case SHTC3_Status_Nominal : Serial.print("Nominal"); break;
    case SHTC3_Status_Error : Serial.print("Error"); break;
    case SHTC3_Status_CRC_Fail : Serial.print("CRC Fail"); break;
    default : Serial.print("Unknown return code"); break;
  }
}

Troubleshooting

Resources and Going Further

Now that you've successfully got your MicroMod Environmental Function Board up and running, 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 with MicroMod:

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!

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.

MicroMod RP2040 Processor Board Hookup Guide

This tutorial covers the basic functionality of the MicroMod RP2040 Processor Board and highlights the features of the dual-core ARM Cortex-M0+ processors development board. Get started with the first microcontroller from the Raspberry Pi Foundation!
New!

1W LoRa MicroMod Function Board

Everything you need to get started with the 1W LoRa MicroMod function board; a MicroMod function board that provides LoRa capabilities for your MicroMod project. Must be used in conjunction with a MicroMod main board and processor.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

1W LoRa MicroMod Function Board

$
0
0

1W LoRa MicroMod Function Board a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t1996

Introduction

Frequency Operation

This LoRa module can only be used in the 915MHzLoRaWAN frequency band (i.e. 902 to 928 MHz). It is not compatible with other frequency bands; double check the frequency band used in your region. Check out these resources from The Things Network for an unofficial summary of regional radio regulations and list of the regional frequency plans.

The 1W LoRa MicroMod Function Board adds LoRa capabilities to your MicroMod project. It is intended to be used in conjunction with a MicroMod processor board and a MicroMod main board, which provides the electrical interface between a processor board and the function board(s).

SparkFun MicroMod LoRa Function Board

SparkFun MicroMod LoRa Function Board

WRL-18573
$39.95

Match up the board's M.2 edge connector to the slot of the M.2 connector and secure the function board with the screws provided with the main board.

Utilizing the 915M30S LoRa module from EBYTE, which is a 1W (30dBm) transceiver based around the SX1276 from Semtech. There is a robust edge mount RP-SMA connector for large LoRa (915MHz) antennas; with modification, a U.FL connector is also available. We've successfully tested a 12 miles line-of-sight transmission with this module (user results may vary).

With the MicroMod standardization, users no longer need to cross-reference schematics with datasheets, while fumbling around with jumper wires. Simply, match up the function board's M.2 edge connector to the slot of the M.2 connector on the main board and secure the function board with screws. All connections are hardwired to compatible pins of the processor board and the pin connections are standardized for the processor boards.

Required Materials

To get started, users will need a few of the items listed below. (You may already have a some of these items; read through the guide and modify your cart accordingly.)

MicroMod Processor Board

A processor board is required for the MicroMod system to operate. Users can choose a processor board, based upon their needs, to attach to the MicroMod M.2 connector of the main board. Below, are few options:

SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod ESP32 Processor

SparkFun MicroMod ESP32 Processor

WRL-16781
$16.95
SparkFun MicroMod nRF52840 Processor

SparkFun MicroMod nRF52840 Processor

WRL-16984
$19.95
SparkFun MicroMod STM32 Processor

SparkFun MicroMod STM32 Processor

DEV-17713
$14.95

MicroMod Main Board

A main board provides the electrical connections between the function and processor boards to operate. Users can choose a main board based upon their needs. Below, are few options:

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

Required Hardware

A Phillips screw driver is necessary to attach the processor board and function board(s) to the main board. Additionally, a USB-C cable is needed to connect the main board to a computer. The LoRa function board also requires a LoRa antenna for the transceiver to operate.

USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3
SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Below, is a selection of our 915MHz frequency band RP-SMA antennas.

Pycom LoRa and Sigfox Antenna Kit - 915MHz

Pycom LoRa and Sigfox Antenna Kit - 915MHz

WRL-14676
$11.95
915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

WRL-14876
$7.95
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

Optional Hardware

A LoRa gateway provides internet connection for LoRaWAN network. Below are a few options from our LoRa product category.

Nebra Outdoor HNT Hotspot Miner (915MHz)

Nebra Outdoor HNT Hotspot Miner (915MHz)

WRL-17844
10
LoRa Raspberry Pi 4 Gateway with Enclosure

LoRa Raspberry Pi 4 Gateway with Enclosure

WRL-16447
3
Nebra Indoor HNT Hotspot Miner (915MHz)

Nebra Indoor HNT Hotspot Miner (915MHz)

WRL-17843
13

Users can also use other LoRa boards for peer-to-peer communication. Below are a few options from our LoRa product category.

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

WRL-15836
$31.50
SparkFun LoRa Thing Plus - expLoRaBLE

SparkFun LoRa Thing Plus - expLoRaBLE

WRL-17506
$49.95
1
Interface Cable RP-SMA to U.FL

Interface Cable RP-SMA to U.FL

WRL-00662
$4.95
1
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

To modify the jumpers, users will need soldering equipment and/or a knife.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$8.95
7
Chip Quik No-Clean Flux Pen  - 10mL

Chip Quik No-Clean Flux Pen - 10mL

TOL-14579
$7.95
4
Weller WLC100 Soldering Station

Weller WLC100 Soldering Station

TOL-14228
$67.95
2
Hobby Knife

Hobby Knife

TOL-09200
$2.95
2

Suggested Reading

The MicroMod ecosystem is a unique way to allow users to customize their project to their needs. Click on the banner below for more information.

MicroMod Logo


For users who aren't familiar with the following concepts, we also recommend reading the following tutorials before continuing.

Serial Communication

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

Serial Peripheral Interface (SPI)

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

Pulse Width Modulation

An introduction to the concept of Pulse Width Modulation.

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.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

Processor Interrupts with Arduino

What 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.

SparkFun expLoRaBLE Hookup Guide

Check out our latest LoRaWAN development board with Bluetooth capabilities! With this guide, we'll get you passing data to The Things Network in no time.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!
New!

MicroMod Main Board Hookup Guide

The MicroMod Main Board - Single and Double are specialized carrier boards that allow you to interface a Processor Board with a Function Board(s). The modular system allows you to add an additional feature(s) to a Processor Board with the help of a Function Board(s). In this tutorial, we will focus on the basic functionality of the Main Board - Single and Main Board - Double.

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.

Installing Arduino IDE

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

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Hardware Overview

Board Dimensions

The overall board dimensions are roughly 65 x 35 mm with an approximate 6 mm protrusion of the RP-SMA antenna connector.

board dimensions
The dimensions for the LoRa MicroMod Function Board. (Click to enlarge)

M.2 Edge Connector and Screw Slots

Like other function and processor boards, there is a polarized M.2 edge connector, which provides a standardized electrical connection. The attachment points for the screws prevent users from connecting a processor board into a function board slot and vice-versa.

function board attachment points
The Micromod M.2 edge connector and screw slots on the LoRa Function Board. (Click to enlarge)

Power

There is a power status LED to help make sure that your LoRa function board is getting (5V) power. Power is provided through the (MicroMod) M.2 edge connector. The LoRa module is meant to run on 5V with 3.3V logic levels. A jumper is available on the back of the board to remove power to the LED for low-power applications (see the Jumpers section below).

power led
Power LED on the LoRa MicroMod Function Board. (Click to enlarge)

E19-915M30S LoRa Module

Note: The range verification was performed in a clear and open area (direct line-of-sight) with a 5dBi antenna gain, height of 2.5m, and data rate 0.3 kbps. Users results may vary.

The Chengdu Ebyte E19-915M30S RF transceiver module is a 1W 915MHz LoRa module, based on the SX1276 from Semtech. It is FCC, CE, and RoHS certified and has been tested up to a range of 10km by the manufacturer. PLease refer to the datasheet for more details.

  • Global license free ISM 915MHz band
  • 1W maximum transmission power
    • Software multi-level adjustable
  • 256Byte FIFO data buffer

SX1276

The E19-915M30S transceiver is based on the SX1276 chip from Semtech. Please refer to the datasheet for more details.

Part NumberSX1276
Frequency Range137 - 1020 MHz
Spreading Factor6 - 12
Bandwidth7.8 - 500 kHz
Effective Bitrate.018 - 37.5 kbps
Est. Sensitivity-111 to -148 dBm
CharacteristicDescription
Operating Voltage3.3 - 5.5 V
Current Consumption 630 mA (TX)) 23 mA (RX)) 3 µA (Sleep)
Operating Temperature-40 - 85 °C
Operating Humidity[1]10 - 90%
Communication InterfaceSPI (0 - 10 Mbps)
Logic Level3.3 V
Frequency Range900 - 931 MHz
Transmit Power28.5 - 30 dBm (max)
ModulationLoRa, FSK, GFSK, MSK, GMSK, OOK
Data Rate FSK: 1.2 - 300 kbps
LoRa: 0.018 - 37.5 kbps
Antenna Impedance50 &ohm;

LoRa module
The E19-915M30S RF transceiver module on the LoRa MicroMod Function Board. (Click to enlarge)

Pin Connections

Below is a table of the pin connections available on the E19-915M30S RF transceiver module. However, not all the pins listed are utilized by the LoRa function board (see the Function Board Pinout Table section below).

Pin #Pin NameI/O DirectionPin Description
1GNDGround
2DIO5Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
3DIO4Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
4DIO3Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
5DIO2Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
6DIO1Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
7DIO0Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
8RSTInputReset
9GNDGround
10GNDGround
11VCCInputPower supply: 4.75~5.5V (Ceramic filter capacitoris advised to add)
12SCKInputSPI - Clock Signal
13MISOOutputSPI - Data from Peripheral Device
14MOSIInputSPI - Data to Peripheral Device
15NSSInputSPI - Chip Select
16TXENInputRadio frequency switch control, make sure the TXEN pin is in high level, RXEN pin is in low level when transmitting.
17RXENInputRadio frequency switch control, make sure the RXEN pin is in high level, TXEN pin is in low level when receiving.
18GNDGround
19ANTAntenna
20GNDGround
21GNDGround
22GNDGround

MicroMod Edge Connector

The MicroMod M.2 edge connector provides a standardized interface for the pin connection of a function board.

function board edge connector
The Micromod M.2 edge connector on the LoRa Function Board. (Click to enlarge)

Function Board Pinout Table

The tables below outline the pin on the M2. edge connector and their functions.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
FunctionsBottom
Pin
   Top   
Pin
Functions
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
LoRa Func. Board PinFunctionBottom
Pin
   Top   
Pin
FunctionsLoRa Func. Board Pin
(Not Connected)-75GND
VIN74733.3V3.3V IN
VCC INVIN7271Power ENPower EN
-7069-
-6665-
-6463-
-6261F7
-6059F6LoRa DIO2
-5857F5LoRa DIO1
-5655F4LoRa RST
-5453F3LoRa RX EN
-5251F2PWMLoRa TX EN
-5049F1SPI_CS0LoRa NSS (CS)
-4847F0INTLoRa DIO0
-4645GND
-4443-
-4241-
EEPROM WP-4039GND
A03837USBHOST_D-
EEPROM A0EEPROM_A03635USBHOST_D+
EEPROM A1EEPROM_A13433GND
EEPROM A2EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423I2C_INT
2221I2C_SCLEEPROM SCL
2019I2C_SDAEEPROM SDA
UART_CTS1817
UART_RTS1615UART_RX
1413UART_TX
1211GND
109
87SPI_CIPOLoRa SDO
65SPI_COPILoRa SDI
43SPI_SCKLoRa SCK
21GND
Signal
Group
SignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT
I2S_OUT/CAM_MCLK
OAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN
I2S_IN/CAM_PCLK
IAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC
I2S_WS/PDM_DATA
I/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK
I2S_CLK/PDM_CLK
OAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General
Bus
G0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-
CAM_HSYNC
I/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+
CAM_VSYNC
I/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

EEPROM

There is an I2C serial EEPROM on the LoRa function board. It has been reserved for future use, but users have access to it. A jumper is available on the back of the board to write protect the EEPROM (see the Jumpers section below).

EEPROM
EEPROM on the LoRa MicroMod Function Board. (Click to enlarge)

RP-SMA Antenna Connector

Warning: Users should attach the antenna before powering their LoRa function board. Transmitting without an antenna connected may potentially damage the transceiver module.

The LoRa function board features a sturdy RP-SMA antenna connector for users to attach an antenna of their choice. While this antenna connector is fairly robust, users should not expect to leverage a lot of weight off of it.

The edge-type antenna connector allows for the threads to protrude just beyond the edge of the board. Along with the dimensions of the LoRa function board, this feature is designed so that the connection also extends past the edge of the main board that the function board interfaces with; and is therefore, well suited to be used with an enclosure.

Antenna Connector
RP-SMA antenna connector on the LoRa MicroMod Function Board. (Click to enlarge)

Note: Users who wish to use the u.FL connector can modify the position of this 0&ohm; resistor. Due to the size and position of the resistor, we only recommended for highly experience soldering experts attempt this modification. More novice users could potentially damage their LoRa function board if they attempt this modification.

antenna jumper
Antenna select jumper on the E19-915M30S RF transceiver module. (Click to enlarge)

Jumpers

There are three jumpers available on the LoRa function board.

LED Power

For more low power projects, the PWR jumper can be cut to remove power from the red power LED.

LED power jumper
LED power jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Current Measurement

For users who would like to measure the current going to LoRa function board, the MEAS jumper can be cut and used for measurements. This jumper is only connected to the 5V power, which is used by only the E19-915M30S RF transceiver module and power LED.

Current measurement jumper
Current measurement jumper on the LoRa MicroMod Function Board. (Click to enlarge)

EEPROM Write Protection

To permanently write protect the EEPROM on the LoRa function board, users can bridge the WP jumper.

EEPROM WP jumper
EEPROM WP jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Software Overview

Getting Started with MicroMod

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide. Also, make sure that the correct board definitions are installed in the Arduino IDE, for the associated processor board.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Programming

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the connected processor board. Depending on the processor board, users may need to install drivers (if they have not done so already). For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Arduino Library

Note: The example for this tutorial assumes users have the latest version of the Arduino IDE installed. 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:

Installing an Arduino Library

January 11, 2013

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.

SparkFun External EEPROM Arduino Library

We've written a library to easily get setup and read/write data on the EEPROM. You can install this library through the Arduino Library Manager. Search for SparkFun External EEPROM Arduino Library and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

For more details on this Arduino library and its use, please refer to the Serial EEPROM hookup guide:

Reading and Writing Serial EEPROMs

August 11, 2017

EEPROM is a great way to add extra memory to your microcontroller project. Wait 'til you see how easy it is to use!

RadioLib Arduino Library

This RadioLib library provides support for peer-to-peer RF communication with the 1W LoRa MicroMod Function Board. Users can install this library through the Arduino Library Manager. Search for RadioLib and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

Note: Peer-to-peer refers to direct RF communication using a specific modulation protocol (similar to a 2-way walkie talkie); and is not to be confused with a mesh network or LoRaWAN network integration.

For more details on this Arduino library, check out the Arduino reference page, the API refernce page, and GitHub repository. Additional specifics of the library that users may be interested in can be found in the links below:

Hadware Assembly

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Processor Board and Main Board

To get started users will need a compatible processor and main board. Insert the MicroMod processor board into the M.2 socket for the processor board at an angle, with its edge connector aligned to the matching slots.

Note: The dimensions of the processor board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw insert is spaced to only match the screw key of MicroMod processor boards.

When inserted properly, the processor board will rest at an angle:

MicroMod processor board inserted into the carrier board
Inserting a processor board into the M.2 socket. (Click to enlarge)

To secure the processor board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod processor board attached to the Qwiic carrier board
A processor board attached to the MicroMod Qwiic Carrier Board. (Click to enlarge)

Function Board and Main Board

Warning: The LoRa module is susceptible to electrostatic discharge. Therefore, it is recommended that users a static discharge strap, like the one included in the iFixit Pro Tech Toolkit.


Static discharge strap in the upper righthand corner. (Click to enlarge)

Users should also address any humidity and temperature concerns, when utilizing the LoRa function board.

Note: The dimensions of the function board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw inserts are spaced to only match the screw key of MicroMod function board.

Similarly to the processor board, insert the MicroMod function board into the M.2 socket for the function board at an angle, with its edge connector aligned to the matching slots.

When inserted properly, the function board will rest at an angle:

MicroMod function board inserted into the main board
Inserting a function board into the M.2 socket. (Click to enlarge)

To secure the function board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod function board attached to the main board
A function board attached to the MicroMod Main Board. (Click to enlarge)

Don't forget to attach the antenna for the LoRa function board. Transmitting or powering the LoRa module without an attached antenna has the potential to permanently damage the transceiver.

Fully assembled main board with processor board and function board
Fully assembled main board with processor board and function board. (Click to enlarge)

Main Board Example - Pin Connection Table

This table summarizes the pins utilized on the LoRa function board's MicroMod edge connector and their connections to the main board's processor pins; based on the slot that the LoRa function board is inserted to.

Function Board
Pin Name
MicroMod
Pin Number
I/O
Direction
Description Main Board's
Processor Pin
Slot 0Slot 1
VCC72Input Power supply: 4.75~5.5V
  • Power LED
  • Transceiver's Power
-
3.3V73Input Power supply: 3.3V
  • EEPROM's Power
  • Logc-level conversion
-
GND11-Ground-
Power Enable71InputControls the 3.3V power6866
SCK3InputSPI - Clock signal for transceiverSCK (57)
CIPO7OutputSPI - Data from transceiverCIPO (59)
COPI5InputSPI - Data to transceiverCOPI (61)
NSS49 (F1)InputSPI - Chip select for transceiverCS0 (55)CS1 (70)
RST55 (F4)InputResets transceiverG1 (42)G6 (71)
DIO047 (F0) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).D0 (10)D1 (18)
DIO157 (F5) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G2 (44)G7 (69)
DIO259 (F6) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G3 (46)G8 (62)
TXEN51 (F2)InputTransceiver's RF control switch: The TXEN pin is in high level, RXEN pin is in low level when transmitting.PWM0 (32)PWM1 (47)
RXEN53 (F3)InputTransceiver's RF control switch: The RXEN pin is in high level, TXEN pin is in low level when receiving.G0 (40)G5 (73)
SCL21InputI2C - Clock signal for EEPROMSCL (14)
SDA19 Input
Output
I2C - Data signal for EEPROMSDA (12)
EEPROM WP40InputControls the write protection pin for the EEPROM. Pull low to enable.?
EEPROM A06InputControls EEPROM's I2C address configuration.-
EEPROM A14InputControls EEPROM's I2C address configuration.-
EEPROM A22InputControls EEPROM's I2C address configuration.-

Programming

To program the processor board utilized on the Main Board; connect the board to a computer with a USB-C cable. Depending on the processor board, users may need to install drivers (if they have not done so already).

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the selected processor board. For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Examples

Peer-to-Peer Communication

Note: The example codes assume that the LoRa function board is inserted into the Fucntion Zero slot of the main board.

The example codes below, allow users to communicate between two LoRa function boards. Simply download, extract the files, and upload the code the main board with associated processor and function boards.

Additional examples have also been provided for users who may have an expLoRable (LoRa Thing Plus) board.

The example codes were tested under the following parameters:
  • Arduino IDE version: 1.8.16
    • If not using the Teensy - Windows App Store version 1.8.51.0
  • RadioLib Library version: 4.6.0
  • MicroMod Processor Boards and Arduino Cores:
    ProcessorBoard Definition
    RP2040Arduino Mbed OS RP2040 Boards version: 2.5.2
    ESP32esp32 version: 2.0.0
    STM32SparkFun STM32 Boards version: 2.0.0
    ArtemisSparkFun Apollo3 Boards version: 2.1.1
    SAMD51SparkFun SAMD Boards (dependency Arduino SAMD Boards version 1.8.1) version: 1.8.5
    • Requires - Arduino SAMD Boards (32-bit ARM Cortex-M0+) version: 1.8.11
    nRF52840[DEPRECATED - Please install standalone packages] Arduino Mbed OS Boards version: 1.3.1
    TeensyTeensyduino version: 1.55

Once uploaded, users can open the serial monitor to view the progress of the data transmission or reception. When using the RP2040 processor board, the example code will wait until the Serial Monitor is opened to execute the code and transmit/receive data.

peer-to-peer data transmission example
An example of the data transmission between an expLoRaBLE board and the LoRa MicroMod Function Board in the Serial Monitor. (Click to enlarge)

Code Breakdown

In order to get the built-in example for the RadioLib library working, a few changes needed to be made. Below, is a short explanation of the modifications made to the example code that we provide (see above), to include compatibility with all the available processor boards.

CS Pin Definition

The SPI library for the Arduino IDE, by default expects the chip select pin to be defined as PIN_SPI_SS. However, this pin definition is different for the ESP32 and Artemis (Apollo3) Arduino cores. Therefore, the code below was inserted to allow the code to compile for all the various processor boards.

language:c
// Redefine CS Pin Name
// SPI_CS0:     ESP32
// SS:          ESP32, nRF, RP2040
// SPI_CS:      Artemis
// PIN_SPI_SS:  STM32, SAMD51, nRF, RP2040

#ifndef PIN_SPI_SS
    // For Artemis
    #ifdef SS
        #define PIN_SPI_SS SPI_CS
    #endif
    // For ESP32
    #ifdef SPI_CS0
        #define PIN_SPI_SS SS
    #endif
#endif
MicroMod Pin Names

Unfortunately, for the RP2040 MicroMod processor board hasn't been included in the MbedOS Arduino core; current progress is on hold(please refer to this issue in the GitHub repository). However, with the modifications below, the RP2040 Pico board definition can be used.

By using the RP2040 Pico board definition, the generic MicroMod processor board's pin names obviously can't be used. Therefore, all the pins must be declared by their GPIO pin numbers. In addition, the default pin connections for the SPI bus on the RP2040 MicroMod processor board differs from the RP2040 Pico. To accommodate for the different pin connections, a custom SPI object was created and passed into the library.

language:c
// SX1276 pin connections:
//       | SLOT 0 | SLOT 1 |
//==========================
// cs    |   CS0  |   CS1  |
// dio0  |   D0   |   D1   |
// dio1  |   G2   |   G7   |
// dio2  |   G3   |   G8   |
// rst   |   G1   |   G6   |
// tx_en |  PWM0  |  PWM1  |
// rx_en |   G0   |   G5   |

#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // MM RP2040 Processor Board (Using RP2040 Pico board definition)
    int pin_cs = 21;
    int pin_dio0 = 6;
    int pin_tx_enable = 13;
    int pin_rx_enable = 16;
    int pin_nrst = 17;
    int pin_dio1 = 18;

    // Redefine SPI pins
    int miso = 20;
    int mosi = 23;
    int sck = 22;

    // Custom SPI object
    MbedSPI SPI_mm(miso, mosi, sck);

    SX1276 radio = new Module(pin_cs, pin_dio0, pin_nrst, pin_dio1, SPI_mm);

#else

Similarly to the RP2040, the Teensy MicroMod processor board definition doesn't include the generic MicroMod processor board pin names yet (we are currently working on this update). Therefore, all the pins must be declared by their pin numbers.

language:c
    #if defined(ARDUINO_TEENSY_MICROMOD)
        // MM Teensy Processor Board
        int pin_cs = 10;
        int pin_dio0 = 4;
        int pin_tx_enable = 3;
        int pin_rx_enable = 40;
        int pin_nrst = 41;
        int pin_dio1 = 42;

    #else
RP2040 Special Consideration

As mentioned above, a custom SPI object was created and passed into the library for the RP2040 MicroMod processor board. However, the library doesn't initialize the SPI bus when it is passed in. Therefore, the setup() loop includes a modification to start the SPI bus operation.

In our testing, the RP2040 MicroMod processor board had issues with the printouts on the serial port. Adding a while() statement to wait for the serial port to be accessed by the Serial Monitor, resolved the issue.

language:c
#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // Wait for serial monitor/port to open
    while (!Serial){
        ; // wait for serial port
    }

    // Start SPI bus
    SPI_mm.begin();
#endif
Enabling the STM32 Serial Port

When uploading to the provided example code (see above) to the STM32 MicroMod processor board, users will need to enable the serial port on the processor board. Otherwise, when the Serial Monitor is opened, nothing will appear. The following settings must be used in the in the Tools drop down menu:

STM32 serial port configuration
The STM32 MicroMod processor board settings in the Tools drop-down menu to enable the microcontroller's serial port. (Click to enlarge)

Resources and Going Further

For more information on the SparkFun 1W LoRa Function Board, check out the links below:

Hardware Documentation:

MicroMod Documentation:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

MicroMod Weather Carrier Board Hookup Guide

A quick guide to help to create your own MicroMod weather station using the MicroMod Weather Carrier Board and Processor of your choice.

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!

MicroMod SAMD51 Processor Board Hookup Guide

This tutorial covers the basic functionality of the MicroMod SAMD51 and highlights the features of the ARM Cortex-M4F development board.

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.

MicroMod nRF52840 Processor Hookup Guide

Get started with the MicroMod nRF52840 Processor following this guide.

Qwiic Carrier Board Hookup Guide

The Qwiic carrier board is the latest way to rapid prototype with the included M.2 socket to swap processor boards and Qwiic connectors to easily connect I2C devices.

MicroMod Update Tool Hookup Guide

Follow this guide to learn how to use the MicroMod Update Tool to interact directly with the UART on the MicroMod Asset Tracker's SARA-R5. Using this board you can talk directly to the module using u-blox's m-center software as well as update the firmware using EasyFlash.
New!

MicroMod WiFi Function Board - ESP32 Hookup Guide

The MicroMod ESP32 Function Board adds additional wireless options to MicroMod Processor Boards that do not have that capability. This special function board acts as a coprocessor that takes advantage of Espressif's ESP32 WROOM to add WiFi and Bluetooth® to your applications.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

MicroMod Main Board Hookup Guide

$
0
0

MicroMod Main Board Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t1994

Introduction

The MicroMod Main Board - Single and Double are specialized carrier boards that allow you to interface a Processor Board with a Function Board(s). The modular system allows you to add an additional feature(s) to a Processor Board with the help of a Function Board(s).

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

Required Materials

To follow along with this tutorial, you will need the following materials at a minimum. 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.

Reversible USB A to C Cable - 2m

Reversible USB A to C Cable - 2m

CAB-15424
$7.95
SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
Pocket Screwdriver Set

Pocket Screwdriver Set

TOL-12891
$3.95
5
microSD Card - 1GB (Class 4)

microSD Card - 1GB (Class 4)

COM-15107
$4.95
SparkFun MicroMod WiFi Function Board - ESP32

SparkFun MicroMod WiFi Function Board - ESP32

WRL-18430
$14.95
SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95

MicroMod Main Board

To hold the processor and function boards, you will need one Main board. Depending on your application, you may choose to have either one or two function boards.

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

MicroMod Processor Board

There are a variety of MicroMod Processor Boards available to choose from. You will probably want to avoid having the same Processor and Function Board since there is an ESP32 on both types of boards.

SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$19.95
2
SparkFun MicroMod ESP32 Processor

SparkFun MicroMod ESP32 Processor

WRL-16781
$16.95
SparkFun MicroMod STM32 Processor

SparkFun MicroMod STM32 Processor

DEV-17713
$14.95
SparkFun MicroMod RP2040 Processor

SparkFun MicroMod RP2040 Processor

DEV-17720
$11.95

MicroMod Function Board

To add additional functionality to your Processor Board, you'll want to include one or two function boards when connecting them to the Main Board. Make sure to check out the catalog for other function boards.

SparkFun MicroMod WiFi Function Board - ESP32

SparkFun MicroMod WiFi Function Board - ESP32

WRL-18430
$14.95
SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95

Tools

You will need a screw driver to secure the Processor and Function boards. To set the charge rate, you will need a precision screw driver (or a tiny, rounded object). The pocket screwdriver set is an excellent option. For users using a microSD card and want to easily read the contents of the memory card, you will need a microSD card adapter or USB reader.

microSD USB Reader

microSD USB Reader

COM-13004
$4.95
10
Pocket Screwdriver Set

Pocket Screwdriver Set

TOL-12891
$3.95
5
SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Suggested Reading

If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview. We recommend reading here for an overview if you decide to take advantage of the Qwiic connector.

MicroMod LogoQwiic Connect System
MicroMod EcosystemQwiic Connect System

If you aren’t familiar with the following concepts, we also recommend checking out a few of these tutorials before continuing. Make sure to check the respective hookup guides for your processor board and function board to ensure that you are installing the correct USB-to-serial converter. You may also need to follow additional instructions that are not outlined in this tutorial to install the appropriate software.

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.

Installing Arduino IDE

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

How to Install CH340 Drivers

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Hardware Overview

The overall functionality of the Single and Double Main Boards are the same. We'll use the Single Main Board more in this section to highlight the features since this is also included in the Double Main Board. We'll switch to the Double Main Board when necessary to highlight the features that are only included in the Double Main Board.

The only differences are that the Double Main Board includes:

  • two jumper shunts
  • ability to add a second MicroMod Function Board to the mix
  • board's width
Main Board - Single MeasurementsMain Board - Double Measurements
(Zoomed Out)

Power

There are two ways to power the Main Boards, Processor Board, and Function Board(s).

  • USB
  • Single Cell LiPo Battery

It is fine to connect a power source to the USB connector and LiPo battery's JST connector at the same time. The MicroMod Main Board has power-control circuitry to automatically select the best power source.

Power USB

One option of powering the board is through the USB Type C connector. You will need a USB Type C cable to power the board with 5V. Power connected to the board's USB C connector will go through a resettable PTC fuse (rated at 2A max) and then the AP7361C 3.3V voltage regulator (rated at 1A max). The little green component close to the USB connector is the resettable PTC fuse while the square IC is the voltage regulator. The voltage regulator accepts voltages between ~3.3V to 6.0V.

USB Connector, PTC Fuse, and AP7361C Voltage Regulator

The USB Type C connector is also used to upload code to your Processor Board, send serial data to a terminal window, or charge the LiPo battery. Of course for portable power, you could connect a USB battery as an alternative to using a LiPo battery.

Power applied to the connector will light up the VIN and 3V3 LED. If you decide to bypass the PTC fuse, simply add a solder blob to the jumper labeled as PTC. There is also a jumper labeled as MEAS to measure the current consumption at the output of the 3.3V voltage regulator for your project.

Power LiPo

The other option is to connect a single cell LiPo battery (i.e. nominal 3.7V, 4.2V fully charged) to the 2-pin JST connector as shown below. A MCP73831 charge IC is included on the boards to safely charge the LiPo batteries via USB Type C connector. A switch is included to set the charge rate. The charge rate is probably set to ~166mA with both switches flipped to the ON position. This may vary depending on the position of the switch when it was pulled from the reel. Flip the switch to adjust the charge rate to either 100mA or 500mA using a precision flat head screw driver or tweezers.

LiPo Charge IC, Charge Rate Switch, and 2-Pin JST Connector

The voltage from the LiPo battery is regulated down to 3.3V as it goes through the AP7361C 3.3V voltage regulator (rated at 1A max).

MicroMod Processor Board

The MicroMod ecosystem allows you to easily swap out processors depending on your application. The location of the M.2 connector labeled as Processor is where you would connect and secure a MicroMod Processor Board.

Processor Board Socket

MicroMod Function Board

Beside the MicroMod Processor's socket is another M.2 connector for MicroMod Function Boards, which allow you to add additional functionality to your Processor Board. The Single Main Board includes one socket for a single Function Board while the Double Main Board includes two sockets for up two Function Boards.

Main Board - Single Function Board SocketsMain Board - Double Function Board Sockets
Main Board - Single Function Board SocketMain Board - Double Function Board Sockets

Reset and Boot Buttons

Each board includes a reset and boot button. There is an additional reset button PTH next to the reset button. Hitting the reset button to restart your Processor Board. Hitting the boot button will put the Processor Board into a special boot mode. Depending on the processor board, this boot pin may not be connected.

Reset and Boot Buttons

SWD Pins

For advanced users, we proke out the 2x5 SWD programming pins. Note that this is not populated so you will need a compatible header and compatible JTAG programmer to connect.

SWD Pins

MicroSD Socket

The board includes a microSD socket if your application requires you to log and save data to a memory card. The primary SPI pins (SDO, SDI, SCK, CS0) from your Processor and Function Board are connected to the microSD Socket.

MicroSD Card Socket

LEDs

There are three LEDs on the board:

  • VIN - The VIN LED lights up to indicate when power available from the USB connector.
  • 3V3 - The 3V3 LED lights up to indicate when there is a 3.3V available after power is regulated down from the USB connector or LiPo battery.
  • CHG - The on-board yellow CHG LED can be used to get an indication of the charge status of your battery. Below is a table of other status indicators depending on the state of the charge IC.

Charge StateLED status
No BatteryFloating (should be OFF, but may flicker)
ShutdownFloating (should be OFF, but may flicker)
ChargingON
Charge CompleteOFF

LEDs

Jumpers

The following five jumpers are included on both the Single and Double Main Boards.

  • MEAS - By default, the jumper is closed and located on the top side of the board. This jumper is used to measure your system's current consumption. You can cut this jumper's trace and connect the PTHs to a ammeter/multimeter to probe the output from the 3.3V voltage regulator. Check out our How to Use a Multimeter tutorial for more information on measuring current.
  • PTC - By default, the jumper is open and located on the bottom of the board. For advanced users that know what you are doing, add a solder blob to the jumper to bypass the resettable PTC fuse to pull more than 2A from the USB source.
  • 3.3V EN - By default, this jumper is open and located on the bottom of the board. Closing this jumper enables processor control of the 3.3V bus.
  • VIN LED - By default, this jumper is closed and located on the bottom of the board. Cut this trace to disable the LED that is connected to the input of the USB
  • 3.3V LED - By default, this jumper is closed and located on the bottom of the board. Cut this trace to disable the LED that is connected to the output of the 3.3V voltage regulator.
Top View Jumpers
Main Board - Single
Top View Jumpers
Main Board - Single
Bottom View Jumpers

Included only on the Double Main Board are two 1x3 male headers with 2-pin jumper shunts to enable the 3.3V voltage regulator for any Function Board connected to Function Zero and Function One using alternative Processor GPIO pins. Since certain processors have limited GPIO and may not be broken out on certain locations, alternative pins have been provided on the board. The ALT PWR EN0 jumper allows users to control the 3.3V voltage regulator on any Function Board that is connected to Function Zero. When the jumper shunt is on the left side toward the 2-pin JST connector, the jumper shunt connects the PWR EN0 to the Processor Board's GPIO G5 pin. Moving the jumper shunt to the other side connects the Processor Board's GPIO G5 pin to Function Board One's GPIO G3 pin.

Main Board - Double Jumpers

The ALT PWR EN1 jumper allows users control power from the 3.3V voltage regulator for any Function Board that is connected to Function One when the jumper shunt is connecting PWR EN1 and Processor Board's GPIO G6 pin. Moving the jumper shunt to the other side connects the Processor Board's GPIO G6 pin to Function Board One's GPIO G4 pin.

Qwiic and I2C

The board includes a vertical and horizontal Qwiic connector. These are connected to the primary I2C bus and 3.3V power on both the Processor and Function Board connectors allowing you to easily add a Qwiic-enabled device to your application.

Qwiic Connectors

Note that there are two mounting holes for Qwiic-enabled boards that have a standard 1.0"x1.0" size board. The image below highlighted with a black square is where you would place the board.

Qwiic Mounting Holes

MicroMod Pinout

Depending on your window size, you may need to use the horizontal scroll bar at the bottom of the table to view the additional pin functions. Note that the M.2 connector pins on opposing sides are offset from each other as indicated by the bottom pins where it says (Not Connected)*. There is no connection to pins that have a "-" under the primary function.

AUDIOUARTGPIO/BUSI2CSDIOSPIDedicated
Processor PinsFunction Zero PinsMain Board - Single Miscellaneous Pins
GNDGNDGND
3.3V-3.3V
USB_D+_Processor-USB_D+
3.3V_EN-3.3V_EN
USB_D-_Processor-USB_D-
RESET# (I - Open Drain)-RESET# (I - Open Drain)
GNDGNDGND
USB_VIN-USB_VIN
D0_ProcessorF0-
BOOT (I - Open Drain)-BOOT (I - Open Drain)
I2C_SDA_ProcessorI2C_SDAI2C_SDA (Qwiic)
UART_RTS_ProcessorUART_RTS-
I2C_SCL_ProcessorI2C_SCLI2C_SCL (Qwiic)
UART_CTS_ProcessorUART_CTS-
I2C_INT_ProcessorI2C_INT-
UART_TX_ProcessorUART_RX-
D1_Processor-SD Card CS
(microSD Card)
UART_RX_ProcessorUART_TX-
SWDCK_Processor-SWDCK (2x5 Header)
SWDIO_Processor-SWDCK (2x5 Header)
PWM0_ProcessorPWM0-
GNDGNDGND
A0_ProcessorA0-
USBHOST_D+_ProcessorUSBHOST_D+-
GNDGNDGND
USBHOST_D-_ProcessorUSBHOST_D--
A1_ProcessorPWR_EN0-
GNDGNDGND
G0_ProcessorF3-
CAN_RX_ProcessorCAN_TX-
G1_ProcessorF4-
CAN_TX_ProcessorCAN_RX-
G2_ProcessorF5-
GNDGNDGND
G3_ProcessorF6-
G4_ProcessorF7-
BATT_VIN / 3 (I - ADC) (0 to 3.3V)-BATT_VIN / 3 (I - ADC) (0 to 3.3V)
SPI_CS0_ProcessorF1-
SPI_SCK_ProcessorSPI_SCKSPI_SCK
(microSD Card)
SPI_DI_ProcessorSPI_DOSPI_DO
(microSD Card)
SPI_DO_ProcessorSPI_DISPI_DI
(microSD Card)
SDIO_DATA2_ProcessorPWR_EN0-
Processor PinsFunction Zero PinsFunction One PinsMain Board - Double Miscellaneous Pins
GNDGNDGNDGND
3.3V--3.3V
USB_D+_Processor--USB_D+
3.3V_EN--3.3V_EN
USB_D-_Processor--USB_D-
RESET# (I - Open Drain)--RESET# (I - Open Drain)
GNDGNDGNDGND
----
USB_VIN--USB_VIN
D0_ProcessorF0--
BOOT (I - Open Drain)--BOOT (I - Open Drain)
I2C_SDA_ProcessorI2C_SDAI2C_SDAI2C_SDA (Qwiic)
UART1_RTS_ProcessorUART_RTS(No Flow Control)-
I2C_SCL_ProcessorI2C_SCLI2C_SCLI2C_SCL (Qwiic)
UART_CTS_ProcessorUART_CTS(No Flow Control)-
I2C_INT_ProcessorI2C_INTI2C_INT-
UART1_TX_ProcessorUART_RX--
D1_Processor-F0-
UART1_RX_ProcessorUART_TX--
UART2_RX_Processor-UART_TX-
SWDCK_Processor--SWDCK (2x5 Header)
UART2_TX_Processor-UART_RX-
SWDIO_Processor--SWDCK (2x5 Header)
PWM0_ProcessorPWM--
GNDGNDGNDGND
A0_ProcessorA0--
USBHOST_D+_ProcessorUSBHOST_D+(No USB Host)-
GNDGNDGNDGND
USBHOST_D-_ProcessorUSBHOST_D-(No USB Host)-
A1_Processor-A0-
GNDGNDGNDGND
G0_ProcessorF3--
CAN_RX_ProcessorCAN_TX(No CAN BUS)-
G1_ProcessorF4--
CAN_TX_ProcessorCAN_RX(No CAN BUS)-
G2_ProcessorF5--
GNDGNDGNDGND
G3_ProcessorF6--
PWM1_Processor-PWM-
G4_ProcessorF7-SD Card CS
(microSD Card)
BATT_VIN / 3 (I - ADC) (0 to 3.3V)--BATT_VIN / 3 (I - ADC) (0 to 3.3V)
----
----
----
----
----
SPI_CS0_ProcessorF1--
----
SPI_SCK_ProcessorSPI_SCKSPI_SCKSPI_SCK
(microSD Card)
----
SPI_DI_ProcessorSPI_DOSPI_DOSPI_DO
(microSD Card)
SDIO_CLK_Processor-F7-
SPI_DO_ProcessorSPI_DISPI_DISPI_DI
(microSD Card)
SDIO_CMD_Processor-F6-
----
----
----
SDIO_DATA1_Processor-PWR_EN1-
----
SDIO_DATA2_ProcessorPWR_EN0--
G7_Processor-F5-
SPI_CS1_Processor-SPI_CS1-
G6_Processor-F4-
----
Alternative
Function
Primary
Function
Bottom
Pin
   Top   
Pin
Primary
Function
Alternative
Function
(Not Connected)75GND
VIN74733.3V
VIN7271Power EN
-7069-
-6665-
-6463-
-6261F7
-6059F6
-5857F5
-5655F4
-5453F3
-5251F2PWM
-5049F1SPI_CS0
-4847F0INT
-4645GND
-4443CAN_TX
-4241CAN_RX
-4039GND
A03837USBHOST_D-
EEPROM_A03635USBHOST_D+
EEPROM_A13433GND
EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423I2C_INT
-2221I2C_SCL
-2019I2C_SDA
UART_CTS1817-
UART_RTS1615UART_RX
-1413UART_TX
-1211-
-109-
-87SPI_SDO
-65SPI_SDI
-43SPI_SCK
-21GND
Alternative FunctionAlternative FunctionAlternative FunctionPrimary FunctionBottom
Pin
   Top   
Pin
Primary FunctionAlternative FunctionAlternative FunctionAlternative Function
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
Signal GroupSignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT/I2S_OUT/CAM_MCLKOAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN/I2S_IN/CAM_PCLKIAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC/I2S_WS/PDM_DATAI/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK/I2S_CLK/PDM_CLKOAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General/BusG0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-/CAM_HSYNCI/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+/CAM_VSYNCI/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

Board Dimensions

The board dimension of the MicroMod Main Board - Single is 2.90" x 3.40" while the MicroMod Main Board - Double is 2.90" x 4.90". Both boards include 5x mounting holes. Four are located on the edge of each board. The fifth mounting hole is located 0.80" away from another mounting hole to mount Qwiic-enabled boards that have the standard 1.0"x1.0" size board.

MicroMod Main Board - SingleMicroMod Main Board - Double

Hardware Hookup

If you have not already, make sure to check out the Getting Started with MicroMod: Hardware Hookup for information on inserting your Processor and Function Boards to the Main Board.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

USB

To program and power the Main Board, you will need to insert the USB-C cable into the USB connector. We will leave the other end disconnected when connecting a Processor or Function board to the Main Board.

When the boards are secure, insert the other end to a computer. When you are finished programming the processor, you can use a USB battery via the USB connector or LiPo battery via the JST connector to power the board.

Processor Board

Align the Processor Board's key into its M.2 connector's socket. Insert the board at an angle (~25°), push down, and tighten the screw. In this case, we had the MicroMod Artemis Processor Board secured in the M.2 connector socket. Depending on your application, you may have a different Processor Board.

Function Boards

Align the Function Board's key into its M.2 connector's socket. Insert the board at an angle (~25°), push down, and tighten one of the screw to hold the board down. Attach the second screw on the other side of the board. Once the board is aligned, tighten both screws fully to secure the board. In this case, we had the Environmental Function Board secured in the M.2 connector socket. Depending on your application, you may have a different Function Board.

Main - Single, Processor, and Function Board

If you decide to have two function boards attached to the Main Board - Double, we recommend tightening the screw between the two Function Boards first to hold them down before attaching the remaining screws on either side of the Function Boards. In this case, we had the WiFi Function Board and the Environmental Function Board secured in the M.2 connector socket. Depending on your application, you may have different function boards.

Main - Double, Processor, and Function Boards

Single Cell LiPo Battery

A precision flat head (or a tiny, rounded object) is needed to set the charge rate for your single cell LiPo battery. When the switch is flipped to the ON position on the 500mA side, the charge rate will be 500mA. When the switch is flipped to the ON position on the 100mA side, the charge rate will be 100mA. When the switch is flipped to the ON position on both the 100mA and 500mA sides, the charge rate will be 166mA.

Setting the LiPo Charge Rate on the DIP Switch

For mobile applications, attach a single cell LiPo battery to the 2-pin JST connector. Attach a USB cable to a USB port or charger when the battery is low to begin charging.

LiPo Battery Connected

To remove the LiPo battery, you can pull the white JST connector away from the socket while also wiggling the connector side to side using your thumb and index finger.

Qwiic-Enabled Devices

To Qwiic-ly connect I2C devices, simply insert a Qwiic cable between one of the MicroMod Main Board's Qwiic ports and your Qwiic device.

Qwiic-Enabled Board Connected

If you need to mount a Qwiic-enabled board to the MicroMod Main Board, you can grab some standoffs and mount a standard Qwiic 1.0"x1.0" sized board using the two mounting holes near the USB Type C connector. Place the standoff between the boards and tighten the screws to mount. The image below used standoffs with built-in threads.

Qwiic-Enabled Board Mounted

MicroSD Card

With power removed from the board, insert a microSD card (with the pins facing toward the board) into the socket. You'll hear a nice click indicating that the microSD card is locked in place.

MicroSD Card Inserting into the MicroSD Card Socket

To remove, make sure power is off and press the microSD card into the socket to eject. You'll hear a nice click indicating that the card is ready to be removed from the socket.

Software Installation

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review the following tutorials.

Arduino Board Definitions

We'll assume that you installed the necessary board files for your Processor Board. In this case, we used the MicroMod Artemis Processor Board. If you are using a different board file, make sure to check out the hookup guide for your Processor Board.

MicroMod Artemis Processor Board Hookup Guide

October 21, 2020

Get started with the Artemis MicroMod Processor Board in this tutorial!

Examples

Let's go over a few basic examples to get started with the MicroMod Main Board Single and Double. We'll toggle the 3.3V voltage regulator and log data to a microSD card on both boards.

Example 1: MicroMod Main Board - Single Enable Function Board

If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button and set the serial monitor to 115200 baud.

language:c
/******************************************************************************

  WRITTEN BY: Ho Yun "Bobby" Chan
  @ SparkFun Electronics
  DATE: 10/19/2021
  GITHUB REPO: https://github.com/sparkfun/SparkFun_MicroMod_Main_Board_Single
  DEVELOPMENT ENVIRONMENT SPECIFICS:
    Firmware developed using Arduino IDE v1.8.12

  ========== DESCRIPTION==========
  This example code toggles the Function Board's AP2112 3.3V voltage 
  regulator's enable pin. The Function Boards built-in power LED should blink.
  This example is based on Arduino's built-in Blink Example:

      https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink

  Note that this example code uses the MicroMod Main Board - Single. The MicroMod
  Main Board - Double routes the PWR_EN# pins slightly different for the
  two function boards. 

  ========== HARDWARE CONNECTIONS ==========
  MicroMod Artemis Processor Board => MicroMod Main Board - Single => Function Board

  Feel like supporting open source hardware?
  Buy a board from SparkFun!
       MicroMod Artemis Processor Board - https://www.sparkfun.com/products/16401
       MicroMod Main Board - Single - https://www.sparkfun.com/products/18575
       MicroMod Environmental Function Board - https://www.sparkfun.com/products/18632

  LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)

******************************************************************************/

/*Define the power enable pins for the processor board with either SDIO_DATA2 or A1.
  Depending on the processor board, the Arduino pin may be different. 

  Note: Certain Processor Boards like the Artemis have SDIO_Data2 and A1 available
        to control the Function Board's voltage regulator. SAMD51, ESP32, and STM32
        Processor Board pins do not have SDIO Data 2, so users will need to reference
        the Processor Pin A1. Below are a few examples. */


//ARTEMIS
#define PWR_EN0 4   //Function Board 0's "PWR_EN0" pin <= MicroMod SDIO_DATA2 => Artemis Processor Board (D4)
//Alternative option that does the same thing. Make sure to just choose one for PWR_EN0
//#define PWR_EN0 35   //Function Board 0's "PWR_EN0" pin <= MicroMod A1 => Artemis Processor Board (A35)

//TEENSY
//#define PWR_EN0 15   //Function Board 0's "PWR_EN0" pin <= MicroMod A1 => Teensy Processor Board (A1)

//SAMD51
//#define PWR_EN0 18   //Function Board 0's "PWR_EN0" pin <= MicroMod A1 => SAMD51 Processor Board (18)



void setup() {
  // initialize the digital pin as an output.
    pinMode(PWR_EN0, OUTPUT);
}



void loop() {
  digitalWrite(PWR_EN0, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
  delay(5000);                 // wait for a few seconds to do something with the function boards

  digitalWrite(PWR_EN0, LOW);  // turn the 3.3V regulator off by making the voltage LOW
  delay(5000);                 // wait for a few seconds before turning function boards back on

}

After uploading, take a look at your Function Board's PWR LED. The LED will be on for about 5 seconds and then turn off for another 5 seconds. It will continue to repeat until power is removed from the MicroMod Main Board - Single.

Example 2: MicroMod Main Board - Double Enable Function Boards

If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button and set the serial monitor to 115200 baud.

language:c
/******************************************************************************

  WRITTEN BY: Ho Yun "Bobby" Chan
  @ SparkFun Electronics
  DATE: 10/19/2021
  GITHUB REPO: https://github.com/sparkfun/SparkFun_MicroMod_Main_Board_Double
  DEVELOPMENT ENVIRONMENT SPECIFICS:
    Firmware developed using Arduino IDE v1.8.12

  ========== DESCRIPTION==========
  This example code toggles the Function Board's AP2112 3.3V voltage
  regulator's enable pin. The Function Boards built-in power LED should blink.
   This example is based on Arduino's built-in Blink Example:

      https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink

  Note that this example code uses the MicroMod Main Board - Double. The MicroMod
  Main Board - Single routes the PWR_EN0 pin slightly different for the
  function board. 

  ========== HARDWARE CONNECTIONS ==========
  MicroMod Artemis Processor Board => MicroMod Main Board - Double => Function Boards

  Feel like supporting open source hardware?
  Buy a board from SparkFun!
       MicroMod Artemis Processor Board - https://www.sparkfun.com/products/16401
       MicroMod Main Board - Double - https://www.sparkfun.com/products/18576
       MicroMod Environmental Function Board - https://www.sparkfun.com/products/18632

  LICENSE: This code is released under the MIT License (http://opensource.org/licenses/MIT)

******************************************************************************/

/*Define the power enable pins for the processor board with SDIO_DATA2.
  Depending on the processor board, the Arduino pin may be different. 

  Note: Certain Processor Boards like the Artemis have more than one pin available 
        to control the Function Board's voltage regulator (e.g. SDIO_DATA2 and G5).
        SAMD51, ESP32, and STM32 Processor Board pins do not have SDIO Data 2, so
        users will need to reference the Processor Pin G5. Below are a few examples. */

//ARTEMIS
#define PWR_EN0 4    //Function Board 0's "PWR_EN0" pin <= MicroMod SDIO_DATA2 => Artemis Processor Board (D4)  
#define PWR_EN1 26   //Function Board 1's "PWR_EN1" pin <= MicroMod SDIO_DATA1 => Artemis Processor Board (D26)

//Alternative option that does the same thing. Make sure to just choose one for PWR_EN0 and PWR_EN1
//#define PWR_EN0 29   //Function Board 0's "PWR_EN0" pin <= MicroMod G5 => Artemis Processor Board (A29)
//#define PWR_EN1 14   //Function Board 1's "PWR_EN0" pin <= MicroMod G6 => Artemis Processor Board (D14)


//TEENSY
//#define PWR_EN0 39   //Function Board 0's "PWR_EN0" pin <= MicroMod SDIO_DATA2 => Teensy Processor Board (D39)
//#define PWR_EN1 34   //Function Board 1's "PWR_EN1" pin <= MicroMod SDIO_DATA1 => Teensy Processor Board (D34)

//Alternative option that does the same thing. Make sure to just choose one for PWR_EN0 and PWR_EN1
//#define PWR_EN0 45   //Function Board 0's "PWR_EN0" pin <= MicroMod G5 => Teensy Processor Board (45)
//#define PWR_EN1 6   //Function Board 1's "PWR_EN1" pin <= MicroMod G6 => Teensy Processor Board (6)

//Note: The SAMD51, ESP32, and STM32 Processor Board Pins do not have SDIO Data 2 and SDIO Data 1.

//SAMD51
//#define PWR_EN0 7   //Function Board 0's "PWR_EN0" pin <= MicroMod G5 => SAMD51 Processor Board (D7)
//#define PWR_EN1 8   //Function Board 1's"PWR_EN1" pin <= MicroMod G6 => SAMD51 Processor Board (D8)

//ESP32
//#define PWR_EN0  32   //Function Board 0's "PWR_EN0" pin <= MicroMod G5 => ESP32 Processor Board (32)
//#define PWR_EN1  33   //Function Board 1's"PWR_EN1" pin <= MicroMod G6 => ESP32 Processor Board (33)



void setup() {
  // initialize the digital pins as an output.
  pinMode(PWR_EN0, OUTPUT); 
  pinMode(PWR_EN1, OUTPUT);

}



void loop() {

  digitalWrite(PWR_EN0, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
  digitalWrite(PWR_EN1, HIGH); // turn the 3.3V regulator on (HIGH is the voltage level)
  delay(5000);                 // wait for a few seconds to do something with the function boards 

  digitalWrite(PWR_EN0, LOW);  // turn the 3.3V regulator off by making the voltage LOW
  digitalWrite(PWR_EN1, LOW);  // turn the 3.3V regulator off by making the voltage LOW
  delay(5000);                 // wait for a few seconds before turning function boards back on

}

After uploading, take a look at the PWR LEDs on the Function Boards. The LEDs will be on for about 5 seconds and then turn off for another 5 seconds. It will continue to repeat until power is removed from the MicroMod Main Board - Double.

Example 3: Reading and Writing to a MicroSD Card

The example below uses the built-in SD Arduino library. The only difference in the code is the CS pin for the microSD card, which you will need to adjust for your processor board (in this case we use the Artemis Processor Board). Make sure to reference your Processor Board's CS pin for either the Main Board - Single (D1) or Main Board - Double (G4).

If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button and set the serial monitor to 9600 baud.

language:c
/*
  SD Card Read/Write

  This example shows how to read and write data to and from an SD card file
  The circuit:

  SD card attached to SPI bus as follows:

   SD Card  - MicroMod Artemis Processor Board
   -----------------------------------
   COPI/SDO - pin 38
   CIPO/SDI - pin 43
   CLK      - pin 42
   CS       - pin 1 (Main Board - Single) or 28 (Main Board - Double)

  created   Nov 2010
  by David A. Mellis
  modified 9 Apr 2012
  by Tom Igoe

  This example code is in the public domain.

*/

#include <SPI.h>
#include <SD.h>

//ARTEMIS
//const int SD_CS_PIN = 1; // The microSD Card CS pin is D1 for the MicroMod Main Board - Single and Artemis Processor (D1). Adjust for your processor if necessary.
const int SD_CS_PIN = 28; // The microSD Card's CS pin is G4 for the MicroMod Main Board - Double and Artemis Processor (D28). Adjust for your processor if necessary.

File myFile;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.print("Initializing SD card...");

  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("test.txt", FILE_WRITE);

  // if the file opened okay, write to it:
  if (myFile) {
    Serial.print("Writing to test.txt...");
    myFile.println("testing 1, 2, 3.");
    // close the file:
    myFile.close();
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }

  // re-open the file for reading:
  myFile = SD.open("test.txt");
  if (myFile) {
    Serial.println("test.txt:");

    // read from the file until there's nothing else in it:
    while (myFile.available()) {
      Serial.write(myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
}

void loop() {
  // nothing happens after setup
}

If all goes well, you should see the following output if this is the first time writing to the card!

language:bash
Initializing SD card...initialization done.
Writing to test.txt...done.
test.txt:
testing 1, 2, 3.

If you are looking to go the extra mile to see if data was saved, close the Serial Monitor and remove power from the MicroMod Main Board. Eject your microSD card from the socket and insert into a microSD card adapter. Then insert the microSD card into your computer's card reader or USB port. Open the test.txt file in a text editor. You should see an output similar to what you saw in the Serial Monitor after the file was opened as shown below.

language:bash
testing 1, 2, 3.

Besides verifying the data in the file, this step is also useful if you adjust the code to continuously log data in a CSV format. After logging data, you could the open text document in a spreadsheet and graph the values!

More Examples!

Sweet! Now that we know that we can read and write to the microSD card, try exploring the other examples in either the SD or SdFat Arduino libraries. Or check out the following MicroMod tutorials that have a built-in microSD card socket for ideas on data logging. Better yet, try adding a sensor and write some code to log some data!

MicroMod Weather Carrier Board Hookup Guide

A quick guide to help to create your own MicroMod weather station using the MicroMod Weather Carrier Board and Processor of your choice.

MicroMod Data Logging Carrier Board Hookup Guide

Get started with some customizable MicroMod data logging with the Data Logging Carrier Board.

MicroMod Asset Tracker Carrier Board Hookup Guide

Get started with the SparkFun MicroMod Asset Tracker Carrier Board following this Hookup Guide. The Asset Tracker uses the u-blox SARA-R510M8S LTE-M / NB-IoT module to provide a host of data communication options.

Looking for more examples with a Function Board? Below are a few examples from our tutorials that are tagged with MicroMod.

New!

1W LoRa MicroMod Function Board

Everything you need to get started with the 1W LoRa MicroMod function board; a MicroMod function board that provides LoRa capabilities for your MicroMod project. Must be used in conjunction with a MicroMod main board and processor.
New!

MicroMod WiFi Function Board - ESP32 Hookup Guide

The MicroMod ESP32 Function Board adds additional wireless options to MicroMod Processor Boards that do not have that capability. This special function board acts as a coprocessor that takes advantage of Espressif's ESP32 WROOM to add WiFi and Bluetooth® to your applications.
New!

MicroMod Environmental Function Board Hookup Guide

The SparkFun MicroMod Environmental Function Board adds additional sensing options to the MicroMod Processor Boards. This function board includes three sensors to monitor air quality (SGP40), humidity & temperature (SHTC3), and CO2 concentrations (STC31) in your indoor environment. To make it even easier to use, all communication is over the MicroMod's I2C bus! In this tutorial, we will go over how to connect the board and read the sensors.

Better yet, try connecting a Qwiic-enabled device to the Main Board's Qwiic connector. Below are a few examples from our tutorials that are tagged with Qwiic.

Qwiic 12-Bit ADC Hookup Guide

Need to add more analog inputs for your project? Check out the Qwiic 12-bit ADC.

Hookup Guide for the SparkFun RedBoard Artemis Nano

Get started with the powerful RedBoard Artemis Nano

Qwiic SHIM for Raspberry Pi Hookup Guide

Ever wanted to prototype I2C components on a Pi? Now you can!

Temperature Sensor Comparison

A comparison of analog and digital temperature sensors. Which is better?
insert image here 




check when tutorials go live since macro will not link WIP tutorials...
reading EEPROM? Kyle is still working...

Troubleshooting

Resources and Going Further

Now that you've successfully got your MicroMod Main Board with a Processor Board, it's time to incorporate it into your own project! For more information, check out the resources below:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

MicroMod All The Pins (ATP) Carrier Board

Access All The Pins (ATP) of the MicroMod Processor Board with the Carrier Board!

SparkFun MicroMod Input and Display Carrier Board Hookup Guide

A short Hookup Guide to get started with the SparkFun MicroMod Input and Display Carrier Board

MicroMod Machine Learning Carrier Board Hookup Guide

Get hacking with this tutorial on our Machine Learning Carrier Board!

MicroMod nRF52840 Processor Hookup Guide

Get started with the MicroMod nRF52840 Processor following this guide.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

MicroMod WiFi Function Board - ESP32 Hookup Guide

$
0
0

MicroMod WiFi Function Board - ESP32 Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t1998

Introduction

The SparkFun MicroMod ESP32 Function Board adds additional wireless options to MicroMod Processor Boards that do not have that capability. This special function board acts as a coprocessor that takes advantage of Espressif's ESP32 WROOM to add WiFi and Bluetooth® to your applications.

SparkFun MicroMod WiFi Function Board - ESP32

SparkFun MicroMod WiFi Function Board - ESP32

WRL-18430
$14.95

Required Materials

To follow along with this tutorial, you will need the following materials at a minimum. 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.

Reversible USB A to C Cable - 2m

Reversible USB A to C Cable - 2m

CAB-15424
$7.95
SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod WiFi Function Board - ESP32

SparkFun MicroMod WiFi Function Board - ESP32

WRL-18430
$14.95
SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95

MicroMod Main Board

To hold the processor board and function board, you will need one Main board. Depending on your application, you may choose to have one or two additional function boards.

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

MicroMod Processor Board

There are a variety of MicroMod Processor Boards available to choose from. You will probably want to avoid having the same Processor and Function Board since there is an ESP32 on both types of boards.

SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$19.95
2
SparkFun MicroMod STM32 Processor

SparkFun MicroMod STM32 Processor

DEV-17713
$14.95
SparkFun MicroMod RP2040 Processor

SparkFun MicroMod RP2040 Processor

DEV-17720
$11.95

MicroMod Function Board

To add additional functionality to your Processor Board, you'll want to include one or two function boards when connecting them to the Main Board.

SparkFun MicroMod WiFi Function Board - ESP32

SparkFun MicroMod WiFi Function Board - ESP32

WRL-18430
$14.95
SparkFun MicroMod Environmental Function Board

SparkFun MicroMod Environmental Function Board

SEN-18632
$149.95

Tools

You will need a screw driver to secure the Processor and Function boards.

SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Suggested Reading

If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview.

MicroMod Logo
MicroMod Ecosystem

If you aren’t familiar with the following concepts, we also recommend checking out a few of these tutorials before continuing. Make sure to check the respective hookup guides for your processor board and function board to ensure that you are installing the correct USB-to-serial converter. You may also need to follow additional instructions that are not outlined in this tutorial to install the appropriate software.

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.

Installing Arduino IDE

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

How to Install CH340 Drivers

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Hardware Overview

ESP32

The MicroMod WiFi Function Board includes the ESP32-WROOM module with AT command firmware. The module can be accessed through the serial UART pins.

ESP32 WROOM Module

USB

The board includes a USB Type C connector on the board to update ESP32's firmware. You will need a Main Board and a second USB cable to update the firmware.

USB C Connector

Power

To power the board, you will need to apply power to a SparkFun Main Board. Power applied will connect to the Function Board's VIN pin, which will be regulated down for the rest of the board with the AP2112 3.3V/600mA voltage regulator. Users can control the 3.3V voltage regulator using a Processor Board's I/O pin. For more information, check out the MicroMod Main Board Examples to toggle the pin.

Voltage Regulator

CP2102

The board is populated with the CP2102 USB-to-Serial converter to update firmware on the ESP32 through its USB Type C connector. This allows the board to show up as a device on the serial (or COM) port of the computer. You will need a Main Board and a second USB cable to update the firmware.

USB-to-Serial Converter

Reset and Boot Buttons

The reset button allows users to reset the program running on the ESP32 module without unplugging the board. To boot button allows users to manually flash new firmware to the ESP32.

Reset and Boot Buttons

Transistor

The IC next to the USB-to-Serial converter includes two transistors. This is used by the USB-to-Serial Converter to auto-reset the ESP32 when updating its firmware.

Transistors

EEPROM

The board includes an I2C EEPROM. Unfortunately, this is not available for the user and was meant to hold board specific information.

EEPROM

LED

There is only one LED available which is the PWR LED. The LED lights up to indicate when available for the ESP32 and CP2102 from the 3.3V voltage regulator. You can disable it by cutting the jumper on the back of the board.

PWR LED

Jumpers

The following jumpers are included to configure the board.

  • PWR - By default, the jumper with the label PWR is closed. This jumper connects the 3.3V line and LED. Cutting this jumper will disable the LED.
  • I2C Pull-up Resistors - By default, this three way jumper labeled I2C is closed and connects two pull-up resistors to the I2C data lines. If you have many devices on your I2C data lines, then you may consider cutting these two jumpers.
I2C Pull-up Resistor JumperPWR LED Jumper
I2C Pull-up Resistor JumpersPWR LED Jumper

Hardware Pinout

Depending on your window size, you may need to use the horizontal scroll bar at the bottom of the table to view the additional pin functions. Note that the M.2 connector pins on opposing sides are offset from each other as indicated by the bottom pins where it says (Not Connected)*. There is no connection to pins that have a "-" under the primary function.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
FunctionBottom
Pin
   Top   
Pin
Function
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
Alternative
Function
Primary FunctionBottom
Pin
   Top   
Pin
Primary FunctionAlternative Function
(Not Connected)75GND
VIN74733.3V
VIN7271Power EN
-7069-
-6665-
-6463-
-6261-
-6059-
-5857-
-5655-
-5453-
-5251-
-5049-
-4847-
-4645GND
-4443-
-4241-
-4039GND
-3837-
EEPROM_A03635-
EEPROM_A13433GND
EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423-
-2221I2C_SCL
-2019I2C_SDA
-1817-
-1615UART_RX
-1413UART_TX
-1211-
-109-
-87-
-65-
-43-
-21GND
Signal GroupSignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT/I2S_OUT/CAM_MCLKOAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN/I2S_IN/CAM_PCLKIAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC/I2S_WS/PDM_DATAI/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK/I2S_CLK/PDM_CLKOAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General/BusG0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-/CAM_HSYNCI/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+/CAM_VSYNCI/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

Board Dimensions

The board uses the standard MicroMod Function Board size which measures about 1.50"x2.56".

Board Dimensions

Hardware Hookup

If you have not already, make sure to check out the Getting Started with MicroMod: Hardware Hookup for information on inserting your Processor and Function Boards to the Main Board.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Adding a Function Board to the Main Board

We'll assume that you have inserted a Processor Board into the Main Board already. The process is the same for adding a Function Board. The only difference is that you will be adding two screws to hold the Function board down.

Align the Function Board's key into its M.2 connector's socket. Insert the board at an angle (~25°), push down, and tighten one of the screw to hold the board down. Attach the second screw on the other side of the board. Once the board is aligned, tighten both screws fully to secure the board. In this case, we had the WiFi Function Board secured in the M.2 connector socket. Depending on your application, you may have a different Function Board.

Main - Double, Processor, and Function Board

If you decide to have two function boards attached to the Main Board - Double, we recommend tightening the screw between the two Function Boards first to hold them down before attaching the remaining screws on either side of the Function Boards. In this case, we had the WiFi Function Board and the Environmental Function Board secured in the M.2 connector socket. Depending on your application, you may have different function boards.

Main - Double, Processor, and Function Boards

ESP32 Firmware Update

To update the firmware you will need to connect the USB C cable to the MicroMod WiFi Function Board (ESP32) to a computer's COM port. An additional Main Board with a second USB C cable is also needed to power the Main Board and MicroMod WiFi Function Board.

ESP32 Firmware Update

Software Installation

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review the following tutorials.

Arduino Board Definitions

We'll assume that you installed the necessary board files for your Processor Board. In this case, we used the MicroMod Artemis Processor Board.

MicroMod Artemis Processor Board Hookup Guide

October 21, 2020

Get started with the Artemis MicroMod Processor Board in this tutorial!

CP2102 Drivers

For users looking to update the AT Command Firmware, you will need to install the Silicon Labs CP210X Driver for the WiFi Function Board - ESP32. The latest can be found from Silicon Labs: USB to UART Bridge VCP Driver.

Note: If applicable, make sure you are using the proper driver files for your CPU architecture. This is usually indicated by a folder or file name with "x86" for 32-bit processors or "x64" for 64-bit processors.

Arduino Example

Example 1: Connecting to WiFi

This example shows you how to send AT commands from your Processor Board to scan and connect to a WiFi Router. Note that this example runs once in the setup() function.

If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Make sure to modify the SSID (YOUR_NETWORK_HERE) and password (YOUR_PASSWORD_HERE) for your wireless router. Hit the upload button and set the serial monitor to 115200 baud.

language:c
const char* newLineCarriageReturn = "\r\n";                                                     // Used at beginning of code to clear out anything in buffer
const char* toSend = "AT+GMR\r\n";                                                              // Check version information.
const char* enableSys = "AT+SYSLOG=1\r\n";                                                      // Enable AT error code prompt
const char* wifiMode = "AT+CWMODE=3\r\n";                                                       // Set the WiFi mode of ESP devices
const char* whatWifi = "AT+CWLAP\r\n";                                                          // List available APs
const char* connectTo = "AT+CWJAP=\"YOUR_NETWORK_HERE\",\"YOUR_PASSWORD_HERE\"\r\n";            // Connect an ESP station to a targeted AP, where YOUR_NETWORK_HERE is your network SSID, and YOUR_PASSWORD_HERE.
const char* wifiInfo = "AT+CWSTATE?\r\n";                                                       // Query the Wi-Fi state and Wi-Fi information
const char* atReset = "AT+RST\r\n";                                                             // Restart module
const char* whatStandard = "AT+CWAPPROTO?\r\n";                                                 // Sets the 802.11 b/g/n protocol standard of SoftAP mode
//const char* sendLight = "AT+HTTPCLIENT=1,3,192.168.1.116/TEMP86";                             // Send HTTP Client Request

//String composedMess = "";
//uint8_t powerEnableZero = A1;
//uint8_t powerEnableOne = 34;

void setup() {

  //  pinMode(powerEnableOne, OUTPUT);
  // pinMode(powerEnableZero, OUTPUT);

  Serial.begin(115200);  //Arduino Serial Monitor
  Serial1.begin(115200); //Hardware Serial Port connected to ESP32


  //Let user know that we are ready to begin sending AT commands
  Serial.println("We up.");

  Serial1.write(newLineCarriageReturn);
  delay(1000);//wait for ESP32

  Serial1.write(toSend);
  delay(1000);//wait for ESP32

  //check on ESP32 response
  while (Serial1.available()) {
    Serial.print(char(Serial1.read()));
  }

  Serial1.write(enableSys);
  delay(1000);//wait for ESP32

  //check on ESP32 response
  while (Serial1.available()) {
    Serial.print(char(Serial1.read()));
  }

  Serial1.write(wifiMode);
  delay(2000);//wait for ESP32

  //check on ESP32 response
  while (Serial1.available()) {
    Serial.print(char(Serial1.read()));
  }

  Serial1.write(whatWifi);
  delay(5000);//wait for ESP32

  //check on ESP32 response
  while (Serial1.available()) {
    Serial.print(char(Serial1.read()));
  }

  Serial1.write(connectTo);
  delay(5000);//wait for ESP32

  //check on ESP32 response
  while (Serial1.available()) {
    Serial.print(char(Serial1.read()));
  }

  Serial1.write(wifiInfo);
  delay(5000);//wait for ESP32

  //check on ESP32 response
  while (Serial1.available()) {
    Serial.print(char(Serial1.read()));
  }

  Serial.println("Done.");
  while (1);
  delay(2000);
}

void loop()
{
  //  digitalWrite(powerEnableZero, LOW);
  //  digitalWrite(powerEnableOne, LOW);
  while (1);

}

If all goes well, your ESP32 be configured for each AT command. At one point, the ESP32 will see what other wireless routers (if there are any) are in range before connecting to your WiFi router and providing a status on the connection to your network.

Example 2: Serial Passthrough

This example allows you to use your Processor Board as a serial passthrough to send characters to and from the ESP32 and the USB-to-serial converter. This is useful for testing different AT commands from the Arduino Serial Monitor or terminal window.

If you have not already, select your Board (in this case the MicroMod Artemis), and associated COM port. Copy and paste the code below in your Arduino IDE. Hit the upload button and set the serial monitor to 115200 baud.

language:c
char val; //init global var for serial characters being sent from ESP32

void setup()
{

  Serial.begin(115200); //Set up Serial Monitor
  Serial1.begin(115200); //Set up hardware UART to pipe data from the ESP32

}

void loop()
{

  if (Serial.available())
  {
    //If data comes in from Serial Monitor:
    //1.) echo the character back to the Serial Monitor
    //2.) send it to Hardware UART.

    val  = Serial.read(); //save character from Arduino's buffer to a variable

    //Serial.print(val); //display serial data back on the Arduino's Serial Monitor, disabled this line if using a Terminal Window
    Serial1.write(val); //send serial data to Processor Board's Hardware UART
  }

  if (Serial1.available())
  { // If data comes in from ESP32 connected to hardware UART,
    //display it on the Serial Monitor or Terminal Window
    Serial.write(Serial1.read());//display serial data received from 
  }

}

Firmware Update

If you decide to update the firmware, make sure to have the ESP32 connected to the Main Board. Then insert a USB cable to the Main Board and the WiFi Function Board.

ESP32 Firmware Update

When updating firmware for the ESP32, you will need to make sure you select the port that the WiFi Function Board is connected to. It should be the port that is connected to the CP2102. In this case, it was COM11.

CP2101 in the Device Manager

Head over to Espressif's user guide for instructions, tools, and the latest firmware to update the ESP32.

Troubleshooting

Resources and Going Further

Now that you've successfully got your MicroMod ESP Function Board up and running, it's time to incorporate it into your own project! For more information, check out the resources below:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

MicroMod Weather Carrier Board Hookup Guide

A quick guide to help to create your own MicroMod weather station using the MicroMod Weather Carrier Board and Processor of your choice.

MicroMod ESP32 Processor Board Hookup Guide

A short hookup guide to get started with the SparkFun MicroMod ESP32 Processor Board.

SparkFun MicroMod Input and Display Carrier Board Hookup Guide

A short Hookup Guide to get started with the SparkFun MicroMod Input and Display Carrier Board

MicroMod nRF52840 Processor Hookup Guide

Get started with the MicroMod nRF52840 Processor following this guide.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado


MicroMod WiFi Function Board - DA16200 Hookup Guide

$
0
0

MicroMod WiFi Function Board - DA16200 Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2061

Introduction

Want to add all the IoT functionality of the DA16200 to the adaptability of the MicroMod system? Then you're in luck! The SparkFun MicroMod DA16200 Function Board adds a fully integrated WiFi module with a 40MHz crystal oscillator, 32.768KHz RTC clock, RF Lumped RF filter, 4MB flash memory, and an on-board chip antenna to any MicroMod project. With the addition of JTAG connectors for deep dive programming, you've got everything you need to get your MicroMod setup ready for your next IoT project.

SparkFun MicroMod WiFi Function Board - DA16200

SparkFun MicroMod WiFi Function Board - DA16200

WRL-18594
$29.95

Required Materials

To follow along with this tutorial, you will need the following materials at a minimum. 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.

Reversible USB A to C Cable - 2m

Reversible USB A to C Cable - 2m

CAB-15424
$7.95
SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod WiFi Function Board - DA16200

SparkFun MicroMod WiFi Function Board - DA16200

WRL-18594
$29.95

MicroMod Main Board

To hold the processor board and function board, you will need one Main board. Depending on your application, you may choose to have one or two additional function boards.

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

MicroMod Processor Board

There are a variety of MicroMod Processor Boards available to choose from.

SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$19.95
2
SparkFun MicroMod ESP32 Processor

SparkFun MicroMod ESP32 Processor

WRL-16781
$16.95
SparkFun MicroMod nRF52840 Processor

SparkFun MicroMod nRF52840 Processor

WRL-16984
$19.95

Tools

You will need a screw driver to secure the Processor and Function boards.

SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Suggested Reading

If you aren’t familiar with the following concepts, we recommend checking out these tutorials before continuing.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

MicroMod Artemis Processor Board Hookup Guide

Get started with the Artemis MicroMod Processor Board in this tutorial!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!

Hardware Overview

DA16200

The MicroMod WiFi Function Board includes the DA16200 module from Dialog with AT command firmware. This chip is a fully integrated Wi-Fi® module with ultra-low power consumption, 40 MHz crystal oscillator, 32.768 KHz RTC clock, RF Lumped RF filter, 4 M-byte flash memory, and an onboard chip antenna. For more information, refer to the datasheet.

Wifi module is highlighted

Power

To power the board, you will need to apply power to a SparkFun Main Board; either a Single or a Double. Power applied will connect to the Function Board's VIN pin, which will be regulated down for the rest of the board with the AP2112 3.3V/600mA voltage regulator.

USB C of the Main board with USBC cable plugged in is highlighted

AP2112

Operating voltage for the DA16200 is 3.3 V. The AP2112 can handle a voltage range of 2.5-6V with a 600mA output and ensures appropriate voltage to the WiFi unit.

Voltage regulator is highlighted

CH340

The board is populated with the CH340E USB-to-Serial converter to update firmware on the DA16200 through its USB Type C connector. You will need a Main Board (for power) and a second USB cable to update the firmware.

CH340 and USB C are highlighted on the function board

Reset Button

The reset button allows users to reset the program running on the Artemis module without unplugging the board.

Factory Reset Button is highlighted

WPS Button

The Wi-Fi Protected Setup Button allows you to easily and quickly connect to a WiFi network.

WPS Button is highlighted

EEPROM

The board includes an I2C EEPROM. To enable writing to the EEPROM, pull WP low, either through the EEPROM_WP pin or by closing JP3.

EEProm is highlighted

JTAG

An unpopulated JTAG footprint is available for more advanced users who need breakpoint level debugging. We recommend checking out our JTAG section for the compatible male header and a compatible JTAG programmer and debugger.

JTAG pins are highlighted

LED

There is only one LED available which is the Power LED. The LED lights up to indicate availability for the DA16200 from the 3.3V voltage regulator. You can disable it by cutting the jumper on the back of the board (see Jumpers below).

Power LED is just below the WiFi module on the right side of the board

Jumpers

The following jumpers are included to configure the board.

  • PWR - By default, the jumper with the label PWR is closed. This jumper connects the 3.3V line and LED. Cutting this jumper will disable the LED.

Power LED Jumper is on the back of the board on the opposite side from the M2 connector
  • I2C Pull-up Resistors - By default, this three way jumper labeled I2C is closed and connects two pull-up resistors to the I2C data lines. If you have many devices on your I2C data lines, then you may consider cutting these two jumpers.

I2C jumper is on the front of the board to the left of the WPS button
  • WP - By default, write protect for the EEPROM is on. To disable write protection, close this jumper.

Write protect jumper is on the back of the board just next to the M2 Connector

Hardware Pinout

The M.2 connector on the MicroMod WiFi Function Board - DA16200 is routed according to the pinout chart below:

Highlighted function board M.2 connector

Depending on your window size, you may need to use the horizontal scroll bar at the bottom of the table to view the additional pin functions. Note that the M.2 connector pins on opposing sides are offset from each other as indicated by the bottom pins where it says (Not Connected)*. There is no connection to pins that have a "-" under the primary function.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
DescriptionFunctionBottom
Pin
   Top   
Pin
FunctionDescription
(Not Connected)75GND
-74733.3VPower Supply: 3.3-6V
-7271Power ENPower Supply: 3.3-6V
-7069-
-6665-
-6463-
-6261-
-6059-
-5857RTC_WAKE1This pin is an input pin for receiving an external event signal from an external device like a sensor. The RTC block detects an external event signal via this pin and wakes up DA16200 from Sleep mode 2 or Sleep mode 3.
-5655RTC_WAKE2This pin is an input pin for receiving an external event signal from an external device like a sensor. The RTC block detects an external event signal via this pin and wakes up DA16200 from Sleep mode 2 or Sleep mode 3.
-5453RTC_PWR_KEYEnable to kick off a predefined power-up sequence and eventually all the necessary power is supplied to all the sub-blocks including the main digital block in DA16200. When disabled, all blocks are powered off and this mode is defined as Sleep mode 1.
-5251GPIOA11
-5049CS
-4847GPIOA10
-4645GND
-4443-
-4241-
Controls the write protection pin for the EEPROM. Pull low to enable.EEPROM_WP4039GND
-3837-
Controls EEPROM's I2C address configuration.EEPROM_A03635-
Controls EEPROM's I2C address configuration.EEPROM_A13433GND
Controls EEPROM's I2C address configuration.EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423-
-2221I2C_SCLI2C - Clock signal for EEPROM
-2019I2C_SDAI2C - Data signal for EEPROM
-1817-
-1615U1_RXI
-1413U1_TXO
-1211-
-109-
-87CIPO
-65COPI
-43SCK
-21GND

Board Dimensions

The board uses the standard MicroMod Function Board size which measures about 1.50"x2.56".

Board Dimensions

Hardware Hookup

Adding a Processor Board to the Main Board

Align the top key of the MicroMod Artemis Processor Board to the Processor screw terminal of your Main Board and angle the board into the socket. Insert the board at an angle into the M.2 connector.

Note: There is no way to insert the processor backward since the key prevents it from mating with the M.2 connector and as an extra safeguard to prevent inserting a processor that matches the key, the mounting screw is offset so you will not be able to secure an improperly connected processor board.

The Processor Board will stick up at an angle, as seen here:

Main board with Processor Board sticking up at an angle

Once the board is in the socket, gently push the MicroMod Processor Board down and tighten the screw with a Phillip's head.

Main board with Processor Board screwed in

Adding a Function Board to the Main Board

As with the Processor Board, align the top key of the MicroMod WiFi Function Board to the screw terminal of your Main Board on the Function Board side and angle the board into the socket. Insert the board at an angle into the M.2 connector.

Main board with Function Board sticking up at an angle

Once the board is in the socket, gently push the MicroMod Function Board down and tighten the screws with a Phillip's head.

Main board with Function Board screwed in

Once both boards are secure, your assembled MicroMod system should look similar to the image below!

Assembled main board with both processor and function boards securely fastened

DA16200 Firmware Update

To update the firmware you will need to connect the USB C cable to the MicroMod WiFi Function Board (DA16200) to a computer's COM port. An additional Main Board with a second USB C cable is also needed to power the Main Board and MicroMod WiFi Function Board.

USBC outlet on function board

Software Installation

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE.

Arduino Board Definitions

We'll assume that you installed the necessary board files for your Processor Board. In this case, we used the MicroMod Artemis Processor Board.

MicroMod Artemis Processor Board Hookup Guide

October 21, 2020

Get started with the Artemis MicroMod Processor Board in this tutorial!

CH340 Driver

You may need to install CH340 driver for the USB-to-serial converter. Check out our section on "How to Install CH340 Drivers" for help with the installation.

Note: If applicable, make sure you are using the proper driver files for your CPU architecture. This is usually indicated by a folder or file name with "x86" for 32-bit processors or "x64" for 64-bit processors.

Main Board Example - Pin Connection Table

For the following examples, we are using the Artemis Processor Board. For DA16200 specific pins, here is the mapping to use in Arduino sketches:

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
Function Board
Pin Name
I/O
Direction
Main Board's
Processor Pin
Slot 0Slot 1
VCCInput-
3.3VInput-
GND--
RTC_WAKE1InputG2G7
RTC_WAKE2OutputG1G6
RTC_PWR_KEYInputG0G5
GPIOA11PWM0PWM1
CSCS0CS1
GPIOA10D0D1

Example 1: Basic Connection

Copy and paste the code below into a fresh Arduino sketch.

language:c
/******************************************************************************
  Example_01 Basic Connection

  Connect to the DA16200 Module
  Print help commands

  Development environment specifics:
  IDE: Arduino 1.8.13
  Hardware Platform: MicroMod Artemis Processor, Single MicroMod Main Board

  Hardware Connections:
  Connect the MicroMod Processor Board to the Processor M2 Connector of the Main Board
  Connect the MicroMod DA16200 Function Board to the Function M2 Connector of the Main Board

  G0      --> RTC_PWR_KEY
  4       --> PWR_EN
  3.3V    --> 3.3V
  GND     --> GND

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/    
#define PWR_EN 4
#define RTC_PWR_KEY 16

void setup() {
  pinMode(PWR_EN,OUTPUT);
  digitalWrite(PWR_EN,LOW);

  pinMode(RTC_PWR_KEY,OUTPUT);
  digitalWrite(RTC_PWR_KEY,LOW);

  Serial.begin(9600);
  Serial1.begin(115200); //Set SoftwareSerial baud

  while(!Serial){

  }
  delay(1000);



  //Enable DA16200 Module RTC power block
  pinMode(PWR_EN,OUTPUT);
  digitalWrite(PWR_EN,LOW);

  pinMode(RTC_PWR_KEY,OUTPUT);
  digitalWrite(RTC_PWR_KEY,LOW);

  Serial.println("DA16200 AT Command example sending/receiving commands\n");
  while(!Serial){

  }

  pinMode(PWR_EN,INPUT);

  pinMode(RTC_PWR_KEY,OUTPUT);
  digitalWrite(RTC_PWR_KEY,HIGH);

  delay(2000);


  //Listen for ready message ("+INIT:DONE")
  byte count = 0;
  String msg = "";

  while(count<20)
  {
    delay(100);
    while(Serial1.available())
    {
      msg += char(Serial1.read());
    }
    if(msg.length() > 5) break;
    count++;
    delay(100);
  }
  msg = msg.substring(3,msg.length());

  if(msg.length()>5)
  {
    Serial.println("Expecting: \"INIT:DONE,(0 or 1)");
    Serial.println("Received: " + msg);
  }
  else
  {
    Serial.println("Failed to receive initialization message\n");

    Serial.println("Make sure the baud rate for Serial1 matches the baud rate\n" \
                   "saved to the DA16200. You can also perform a factory reset by\n" \
                   "pressing and holding the GPIOA7 button for ~5s, which will\n" \
                   "reset the baud rate back to 115200");
  }
    Serial.println("\nTry entering \"?\" or \"help\" to print out the list of AT commands\n" \
                 "\nIf the received text is unreadable, try changing the baud rate to\n" \
                 "9600 with the command \"ATB=9600\" in the terminal. Next, update the\n" \
                 "example code by setting SOFTWARE_SERIAL_BAUD to 9600 baud and trying again.\n");
}

void loop() {
    while(Serial.available())
    {
      Serial1.print(char(Serial.read()));
    }

    while(Serial1.available())
    {
      Serial.print(char(Serial1.read()));
    }
}

Set your Board and Serial Port, and then upload the sketch to your Arduino. Then open the serial monitor. Make sure your baud rate is set to 9600. You'll begin to see output.

Basic connection just makes sure you get a response from the DA16200 module

Example 2: Connecting to WiFi

Let's check out the WiFi with a simple example to grab the time.

Copy and paste the code below into a fresh Arduino sketch.

language:c
/******************************************************************************
  Example_02 WiFi Communcation

  Connect WiFi using the provided network credentials
  Talk to NTP server to set the current date/time
  Update the time to the correct time zone
  Print the current time approx. once every second

  Development environment specifics:
  IDE: Arduino 1.8.13
  Hardware Platform: MicroMod Artemis Processor, Single MicroMod Main Board

  Hardware Connections:
  Connect the MicroMod Processor Board to the Processor M2 Connector of the Main Board
  Connect the MicroMod DA16200 Function Board to the Function M2 Connector of the Main Board

  G0      --> RTC_PWR_KEY
  4       --> PWR_EN
  3.3V    --> 3.3V
  GND     --> GND

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#define PWR_EN 4
#define RTC_PWR_KEY 16

#define SOFTWARE_SERIAL_BAUD 115200
//#define SOFTWARE_SERIAL_BAUD 9600

String wifiSSID = "SSID";
String wifiPass = "PASSWORD";

int timezoneOffset = 0; //The hours offset from UTC (Mountain time is -6 for daylight savings, and -7 for standard)

void setup() {
  Serial.begin(9600);
  Serial1.begin(SOFTWARE_SERIAL_BAUD); //Set SoftwareSerial baud

  //Enable DA16200 Module RTC power block
  pinMode(RTC_PWR_KEY,OUTPUT);
  digitalWrite(RTC_PWR_KEY,HIGH);

  Serial.println("DA16200 AT Command Example: Connecting to WiFi\n");

  //Listen for ready message ("+INIT:DONE")
  byte count = 0;
  String msg = "";
  while(count<20)
  {
    while(Serial1.available())
    {
      msg += char(Serial1.read());
    }
    if(msg.length() > 5) break;
    count++;
    delay(100);
  }
  msg = msg.substring(3,msg.length()); //Remove NULL,CR,LF characters from response

  if(msg.length()>5)
  {
    Serial.println("Expecting: \"INIT:DONE,(0 or 1)");
    Serial.println("Received: " + msg);
  }
  else
  {
    Serial.println("Failed to receive initialization message.\n" \
                   "Make sure you're using the correct baud rate.\n");
    while(1);
  }

  //Configure module for STA mode
  Serial.println("Sending:AT+WFMODE=0");
  Serial1.println("AT+WFMODE=0");

  //Wait for "OK" response
  while(1)
  {
    msg = "";
    while(Serial1.available())
    {
      msg += char(Serial1.read());
      delay(1);
    }
    Serial.print(msg);
    if(msg.length() > 1) break;
  }

  //Apply a software reset to finish changing the mode
  Serial.println("Sending:AT+RESTART");
  Serial1.println("AT+RESTART");

  //Wait for "OK" response
  while(1)
  {
    msg = "";
    while(Serial1.available())
    {
      msg += char(Serial1.read());
      delay(1);
    }
    Serial.print(msg);
    if(msg.length() > 1) break;
  }

  //Listen for ready message ("+INIT:DONE") after the reset is finished
  count = 0;
  msg = "";
  while(count<20)
  {
    while(Serial1.available())
    {
      msg += char(Serial1.read());
    }
    if(msg.length() > 5) break;
    count++;
    delay(100);
  }

  Serial.println(count);
  Serial.println(msg);
  msg = msg.substring(3,msg.length()); //Remove NULL,CR,LF characters from response

  if(msg.length()>5)
  {
    Serial.println("Expecting: \"INIT:DONE,(0 or 1)");
    Serial.println("Received: " + msg);
  }
  else
  {
    Serial.println("Failed to receive initialization message.\n" \
                   "Continuing anyway...\n");
  }

  //Connect to WiFi using the provided credentials
  Serial.println("Sending:AT+WFJAPA=" + wifiSSID + "," + wifiPass);
  Serial1.println("AT+WFJAPA=" + wifiSSID + "," + wifiPass);

  Serial.println("Waiting for connection response...");
  while(1)
  {
    msg = "";
    while(Serial1.available())
    {
      msg += char(Serial1.read());
      delay(1);
    }

    if(msg.length() > 10) 
    {
      Serial.print("Response:");
      Serial.println(msg);
      break;
    }
  }

  msg = msg.substring(3,msg.length()); //Remove NULL,CR,LF characters from response

  //If connection to AP is successful, response will be WFJAP:1,SSID,IP_ADDRESS, or WJAP:0 if failed
  if(msg.startsWith("WFJAP:1"))
  {
      //Talk to NTP server to get the current time, along with how often to get time sync
      Serial.println("Sending:AT+NWSNTP=1,pool.ntp.org,86400");
      Serial1.println("AT+NWSNTP=1,pool.ntp.org,86400");

      //Wait for "OK" response
      while(1)
      {
        String msg = "";
        while(Serial1.available())
        {
          msg += char(Serial1.read());
          delay(1);
        }
        Serial.print(msg);
        if(msg.length() > 1) break;
      }

      //Provides the correct UTC offset for the current time
      Serial.println("Sending:AT+TZONE="+String(timezoneOffset*3600));
      Serial1.println("AT+TZONE="+String(timezoneOffset*3600));

      //Wait for "OK" response
      while(1)
      {
        String msg = "";
        while(Serial1.available())
        {
          msg += char(Serial1.read());
          delay(1);
        }
        Serial.print(msg);
        if(msg.length() > 1) break;
      }  
  }
  else
  {
    Serial.println("Connection unsucessful :(\n\n" \
                   "Make sure the WiFi credentials are correct, and the module is in the station mode");
    while(1);
  }
}

void loop() {
  //Get the current time
  Serial.println("Sending:AT+TIME");
  Serial1.println("AT+TIME");

  while(Serial1.available())
  {
    Serial.print(char(Serial1.read()));
    delay(1);
  }

  delay(1000);
}

Set your Board and Serial Port, and then upload the sketch to your Arduino. Then open the serial monitor. Make sure your baud rate is set to 9600. You'll begin to see output.

Getting time output on serial monitor

Firmware Update

If for any reason you want to re-flash the AT Firmware from Dialog Semiconductor, you can download it below:

Troubleshooting

Resources and Going Further

Now that you've successfully got your MicroMod ESP Function Board up and running, it's time to incorporate it into your own project! For more information, check out the resources below:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

MicroMod Artemis Processor Board Hookup Guide

Get started with the Artemis MicroMod Processor Board in this tutorial!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!

MicroMod Data Logging Carrier Board Hookup Guide

Get started with some customizable MicroMod data logging with the Data Logging Carrier Board.

MicroMod Machine Learning Carrier Board Hookup Guide

Get hacking with this tutorial on our Machine Learning Carrier Board!

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

smôl Power Board AAA Hookup Guide

$
0
0

smôl Power Board AAA Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2059

Introduction

smôl is a new board format and, as the name suggests, they're really small!

smôl Power Board AAA

smôl Power Board AAA

SPX-18621
$17.95

The smôl Power Board AAA is an intelligent power board for smôl. It is designed to provide 3.3V power for your smôl stack from one or two AAA or AA alkaline (non-rechargeable) batteries. If you need a rechargeable solution, check out the smôl Power Board LiPo.

Each smôl board measures just 1.60" by 0.42" (40.6mm by 10.7mm). We made the boards just wide enough so we could squeeze USB-C and 16-way Flexible Printed Circuit (FPC) connectors on there. Some of the boards have components on both top and bottom layers which again helps keep the boards small.

smôl boards are designed to stack one on top of the other, using 16-way 0.5mm-pitch FPCs to provide the interconnect from one board to the next. Each board has an IN FPC connector on the bottom layer and an OUT FPC connector on the top layer. The boards stack in a zig-zag daisy chain; signals and power are passed from one board to the next up and down the chain through the FPCs.

Required Materials

As a minimum, you're going to need a battery holder or JST-PH cable to go with your power board:

micro:bit Battery Holder - 2xAAA (JST-PH)

micro:bit Battery Holder - 2xAAA (JST-PH)

PRT-15101
$1.95
JST Jumper 2 Wire Assembly

JST Jumper 2 Wire Assembly

PRT-09914
$0.95
3
Battery Holder - 2xAA (JST-PH)

Battery Holder - 2xAA (JST-PH)

PRT-14299
$1.50
Barrel Jack to 2-pin JST

Barrel Jack to 2-pin JST

TOL-08734
$2.95
1

The Power Board AAA is part of the smôl ecosystem. Why not pair it with one of the smôl Processor Boards and a Peripheral Board?

smôl ESP32

smôl ESP32

SPX-18619
$17.95
smôl ARTIC R2

smôl ARTIC R2

SPX-18618
$199.95
smôl ZOE-M8Q

smôl ZOE-M8Q

SPX-18623
$39.95

Don't forget that you will need Flexible Printed Circuits to connect your smôl boards together. You're going to need one FPC per board. Our 36mm FPC is the perfect length if you want the smôl boards to stack neatly, one on top of the other.

smôl 36mm 16-way Flexible Printed Circuit

smôl 36mm 16-way Flexible Printed Circuit

CAB-18731
$0.95















Need to do some prototyping with smôl? Or want to connect your smôl stack to a Qwiic board? The smôl Header is perfect for that:

smôl Header

smôl Header

SPX-18620
$2.95













Suggested Reading

This is the hookup guide for the smôl Power Board AAA. Click the button below if you want to find out more about smôl itself.

We recommend taking a look through the following tutorials if you are not familiar with the concepts covered in them:

Battery Technologies

The basics behind the batteries used in portable electronic devices: LiPo, NiMH, coin cells, and alkaline.

I2C

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

Hardware Overview

In this section we'll cover what this board does and what is included on the smôl Power Board AAA.

What Does This Board Do?

What does this board do? Excellent question! Let's answer that right now.

The main job of the Power Board is to provide power for your smôl ecosystem. smôl is designed to be both small in size and small on current draw. The Power Board plays a critical role in reducing the current draw of smôl as much as possible. This board has a TPS61200 switching regulator on it and is designed to boost the voltage from one or two AAA or AA alkaline cells up to 3.3V. But it also comes with an ATtiny43 AVR microcontroller on it. This is an intelligent power board for the smôl ecosystem!

When you want your project to go into a low power or deep sleep state, it is standard practice to put your processor into the lowest power state it offers. But you may find that the current draw is still something like 100µA to 500µA depending on which processor you are using. Then there is the quiescent current drawn by the voltage regulator. The quiescent current is the current drawn by the regulator when it is on but has no load attached. Again, it varies from regulator to regulator but you may find this adds another 55µA to your current draw. Those little currents add up and reduce your battery life considerably.

With smôl, we took a new approach. The Power Board takes control and provides the 3.3V power for the whole smôl stack. When instructed to by the Processor Board, the on-board ATtiny microcontroller will turn off that power completely and then put itself into a low power sleep state for a pre-defined interval. Sleep intervals from a few 10's of milliseconds to several days are possible. We have used the fantastic Otii Arc Power Analyzer to help us reduce the sleep current to just 12µA. Yes, you read that right, 12 microamps! smôl makes it possible for your battery life to be measured in months not days!

Battery Connector

By far the biggest component on the board is the JST-PH connector for the battery.

Pictured is the Battery Connector
Battery Connector Polarity: Please make sure that you use one of our recommended battery holders or cables. Some battery holders use the same JST connector as ours but have the opposite polarity. Connecting one of these to your smôl power board will destroy it as the board has no reverse polarity protection. If you are going to use your own battery holder or cable, it is up to you to ensure it has the correct polarity. In the above photo, the positive pin is on the right.

ATtiny43U AVR Microcontroller

The smôl Power Board AAA is an intelligent power board. The on-board ATtiny43U microcontroller can monitor the battery voltage and other parameters. When the Processor Board requests it to, the ATtiny43 will turn off the smôl 3.3V power completely and place itself into deep sleep for a pre-defined interval. This is what makes it possible to reduce the sleep current to just 12µA.

Pictured is the ATtiny43 microcontroller

The ATtiny43U may seem a strange choice, but actually it is the perfect choice for this board. We use it because it has a built-in boost converter and can operate directly from voltages as low as 0.7V. It does not need a separate voltage regulator.

Our SparkFun smôl Power Board Arduino Library does all of the heavy lifting for you, making it easy to communicate with the ATtiny through simple function calls.

A Note About Temperature Sensing

The ATtiny43 has a built-in temperature sensor, which can be accessed via the SparkFun smôl Power Board Arduino Library. However, the quoted typical accuracy of the sensor is &pm;10°C. Yes, plus or minus ten degrees C. The sensor measurement requires external calibration to be useful.

Voltage Regulator

The smôl Power Board AAA has a TPS61200 switching regulator on-board. That's the same regulator we use on our LiPower - Boost Converter. It can deliver approximately 550mA when boosting 1.5V up to 3.3V, and approximately 1500mA when boosting 3.0V up to 3.3V. It can be switched off completely by the ATtiny43U microcontroller, avoiding the 55µA quiescent current draw.

Pictured is the TPS61200 switching regulator
The TPS61200 can operate in Buck mode too and regulate higher voltages down to 3.3V. However, we do not recommend operating the board in this mode as the ATtiny43U's VCC supply will also be at that same higher voltage, leading to unexpected behavior and complications. Never exceed 5.5V or you will damage the ATtiny43U.
Ye cannae change the laws of physics! The current draw from a single AAA or AA cell will be approximately three times what smôl is drawing at 3.3V. When powering the smôl ARTIC R2 satellite communication board you are likely to have to use two AA cells for best results.

FPC Connections

Like all of our smôl boards, the Power Board AAA is equipped with two 16-way 0.5mm-pitch Flexible Printed Circuit connectors. FPCs are used to link the smôl boards together in a daisy-chain.

The pin-out for the smôl Power Board AAA is as follows:

Connector Pin No.Signal NameFunctionNotes
1PROC_PWR_ENProcessor Power EnableThe power board pulls this signal low to disable the voltage regulator on the power board
23V33.3V Power Rail
3GNDPower Ground / 0V
4SCLKSPI ClockNot used
5COPISPI Controller Out Peripheral InNot used
6CIPOSPI Controller In Peripheral OutNot used
7CS0SPI Chip Select 0Not used
8CS1SPI Chip Select 1Not used
9CS2SPI Chip Select 2Not used
10GPIO0General Purpose Input / Output 0Not used
11GPIO1General Purpose Input / Output 1Not used
12SDAI2C DataUsed for ATtiny43U communication
13SCLI2C ClockUsed for ATtiny43U communication
14GNDPower Ground / 0V
153V33.3V Power Rail
16V_USBUSB Power Rail (5V)USB power is used to recharge the battery

The IN and OUT pin connections are identical on the smôl Power Board AAA. (That's not always true on smôl Peripheral Boards. Check the appropriate Peripheral Board Hookup Guide for full details.)

The order in which you connect smôl boards is important. However, because the Power Board AAA only uses I2C communication, it can be placed anywhere in the stack. Please see the smôl Hookup Guide for more details.

smôl Specifics

Interface:

  • Interface: I2C
    • ATtiny43U Default Address: 0x50

PROC_PWR_EN:

  • PROC_PWR_EN:
    • The power board pulls PROC_PWR_EN low to disable the regulator on the processor board

Arduino Example: Battery Voltage

If you are using the smôl ESP32 Processor Board, you are going to want to install the CP210x USB Driver and Arduino Boards Package for the ESP32 first. Please see the smôl ESP32 Hookup Guide for more details.

The smôl Power Boards have their own Arduino Library to make communicating with the board as simple as calling a function. You can install the library through the Arduino IDE Library Manager by searching for SparkFun smol power. Alternatively, you can grab the library from GitHub or can download it as a zip file by clicking the button below:

You are also going to need to install the SparkFun MAX1704x Fuel Gauge Arduino Library. The smôl Power Board AAA does not have a fuel gauge on it, but the library does need it to provide support for the smôl Power Board LiPo. Again, you can install this library through the Arduino IDE Library Manager by searching for SparkFun MAX1704x. Alternatively, you can grab the library from GitHub or can download it as a zip file by clicking the button below:

The Power Board library contains a set of tried-and-tested examples which will work with both the smôl Power Board AAA and the smôl Power Board LiPo. There is only one line of code to change when switching from one to the other.

The following code is a simplified version of Example2_BatteryVoltage. Upload the code onto your processor board and open the Serial Monitor or a terminal emulator at 115200 baud to see the output.

language:c
#include <Wire.h>

#include <SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library.h> // Click here to get the library: http://librarymanager/All#SparkFun_MAX1704x_Fuel_Gauge_Arduino_Library
#include <SparkFun_smol_Power_Board.h> //Click here to get the library:  http://librarymanager/All#SparkFun_smol_Power_Board

smolPowerAAA myPowerBoard;

void setup()
{
  Serial.begin(115200);
  while (!Serial)
    ; // Wait for the user to open the Serial console
  Serial.println(F("smôl Power Board example"));
  Serial.println();

  Wire.begin();

  if (myPowerBoard.begin() == false) // Begin communication with the power board using the default I2C address (0x50) and the Wire port
  {
    Serial.println(F("Could not communicate with the power board. Please check the I2C connections. Freezing..."));
    while (1)
      ;
  }

  // Select VCC as the voltage reference - see the full example for more details
  myPowerBoard.setADCVoltageReference(SFE_SMOL_POWER_USE_ADC_REF_VCC);

  float voltage = myPowerBoard.getBatteryVoltage(); // Read the battery voltage from the ATtiny43U
  Serial.print(F("The battery voltage reads as: "));
  Serial.println(voltage);

  if (voltage == -99.0)
  {
    Serial.println(F("A voltage of -99.0V indicates an error."));
  }
}

void loop()
{
  //Nothing to do here
}

Troubleshooting

If your smôl stack is not communicating, it is probably in deep sleep. When the Power Board is commanded into deep sleep by the Processor Board, the only way it will wake it up again is when the sleep interval expires. You cannot wake or reset the system via the USB interface.

Removing and re-inserting the battery connection will reset the power board and wake it up again.

We did not include a reset button on the smôl Power Board to keep the board as small as possible. However, you can reset it via the ISP programming test points on the bottom of the board. Briefly connect RESET to GND to reset the board.

Pictured are the RESET and GND test points on the bottom of the board
Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the smôl Power Board AAA, check out the following links:

smôl Power Board AAA Documentation:

Boost Regulator:

Microcontroller:

smôl Documentation:


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

smôl ZOE-M8Q Hookup Guide

$
0
0

smôl ZOE-M8Q Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2055

Introduction

smôl is a new board format and, as the name suggests, they're really small!

smôl ZOE-M8Q

smôl ZOE-M8Q

SPX-18623
$39.95

The smôl ZOE-M8Q is a GNSS (Global Navigation Satellite System) receiver board based on the excellent u-blox ZOE-M8Q.

Each smôl board measures just 1.60" by 0.42" (40.6mm by 10.7mm). We made the boards just wide enough so we could squeeze USB-C and 16-way Flexible Printed Circuit (FPC) connectors on there. Some of the boards have components on both top and bottom layers which again helps keep the boards small.

smôl boards are designed to stack one on top of the other, using 16-way 0.5mm-pitch FPCs to provide the interconnect from one board to the next. Each board has an IN FPC connector on the bottom layer and an OUT FPC connector on the top layer. The boards stack in a zig-zag daisy chain; signals and power are passed from one board to the next up and down the chain through the FPCs.

Required Materials

As a minimum, you're going to need a u.FL GNSS antenna:

Molex Flexible GNSS Antenna - U.FL (Adhesive)

Molex Flexible GNSS Antenna - U.FL (Adhesive)

GPS-15246
$3.95
1















The ZOE-M8Q Peripheral Board is part of the smôl ecosystem. Why not pair it with one of the smôl Processor Boards?

smôl ESP32

smôl ESP32

SPX-18619
$17.95













To be able to reduce the sleep current below 10µA, you're going to want to pair the ESP32 with one of our intelligent smôl Power Boards:

smôl Power Board LiPo

smôl Power Board LiPo

SPX-18622
$17.95
smôl Power Board AAA

smôl Power Board AAA

SPX-18621
$17.95

Don't forget that you will need Flexible Printed Circuits to connect your smôl boards together. You're going to need one FPC per board. Our 36mm FPC is the perfect length if you want the smôl boards to stack neatly, one on top of the other.

smôl 36mm 16-way Flexible Printed Circuit

smôl 36mm 16-way Flexible Printed Circuit

CAB-18731
$0.95















Need to do some prototyping with smôl? Or want to connect the smôl ZOE-M8Q to another Qwiic board? The smôl Header is perfect for that:

smôl Header

smôl Header

SPX-18620
$2.95













Suggested Reading

This is the hookup guide for the smôl ZOE-M8Q Peripheral Board. Click the button below if you want to find out more about smôl itself.

We recommend taking a look through the following tutorials if you are not familiar with the concepts covered in them:

I2C

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

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Hardware Overview

In this section we'll cover what's included on the smôl ZOE-M8Q Peripheral Board.

GNSS Capabilities

The u-blox ZOE-M8Q is able to connect to up to three different GNSS constellations at a time making it very accurate for its size.

smôl ZOE-M8Q and support components

Below are the listed capabilities of the GNSS unit:

GNSSGPS and GLONASSGPSGLONASSBeiDouGalileo
Horizontal Position Accuracy2.5m2.5m4m3m3m
Max Navigation Update RateROM10Hz18Hz18Hz18Hz18Hz
Flash5Hz10Hz10Hz10Hz10Hz
Time-To-First-FixCold Start26s29s30s34s45s
Hot Start1s1s1s1s1s
SensitivityTracking and Navigation-167dBm-166dBm-166dBm-160dBm-159dBm
Reacquisition-160dBm-160dBm-156dBm-157dBm-153dBm
Cold Start-148dBm-148dBm-145dBm-143dBm-138dBm
Hot Start-157dBm-157dBm-156dBm-155dBm-151dBm
Velocity Accuracy0.05m/s
Heading Accuracy0.3 degrees

Power

Power for this board - and all smôl boards - should be 3.3V.

Battery

The small metal disk in the center of the board is a small lithium battery. This battery does not provide power to the IC like the 3.3V system does, but to relevant systems inside the IC that allow for a quick reconnection to satellites. The time to first fix will be about ~29 seconds, but after the product has a lock, that battery will allow for a one second time to first fix. This is known as a hot start and lasts for four hours after the board is powered down. The battery provides over a year's worth of power to the backup system and charges slowly when smôl 3.3V is powered.

smôl ZOE-M8Q backup battery

Jumpers

There is only one jumper on the top of this product, labelled V_ANT. By default, 3.3V power is provided on the u.FL connector for an active antenna. Cutting the V_ANT jumper disconnects the 3.3V power.

This is a picture of the board with the V_ANT jumper highlighted.

u.FL Connector

The u.FL connector on the board is where you will plug in your antenna. This is a compact connector for RF antennas, that has the same function as the traditional SMA connector. You may be more familiar and even own some antennas that use SMA connectors; never fear, we carry a U.FL to SMA cable adapter. Check out our tutorial on using U.FL connectors, if this is your first.

Pictured is the small u.FL connector

Power Switching

The smôl ZOE-M8Q includes an on-board power switch (MOSFET):

smôl ZOE-M8Q power switch

Power for the ZOE-M8Q is controlled via the smôl GPIO0 signal. Leave GPIO0 floating or pull high to disable power to the ZOE-M8Q (default state). Pull the smôl GPIO0 signal low to enable power for the ZOE-M8Q.

FPC Connections

Like all of our smôl boards, the ZOE-M8Q Peripheral Board is equipped with two 16-way 0.5mm-pitch Flexible Printed Circuit connectors. FPCs are used to link the smôl boards together in a daisy-chain.

The pin-out for the smôl ZOE-M8Q IN connector is as follows:

IN Connector Pin No.Signal NameFunctionNotes
1PROC_PWR_ENProcessor Power EnableNot used
23V33.3V Power Rail
3GNDPower Ground / 0V
4SCLKSPI ClockNot used
5COPISPI Controller Out Peripheral InNot used
6CIPOSPI Controller In Peripheral OutNot used
7CS0SPI Chip Select 0Not used
8CS1SPI Chip Select 1Not used
9CS2SPI Chip Select 2Not used
10GPIO0ZOE-M8Q Power ControlPull low to enable power for the ZOE-M8Q
11GPIO1General Purpose Input / Output 1Connected to Pin 10 (GPIO0) on the OUT connector
12SDAI2C DataUsed for ZOE-M8Q communication
13SCLI2C ClockUsed for ZOE-M8Q communication
14GNDPower Ground / 0V
153V33.3V Power Rail
16V_USBUSB Power Rail (5V)Not used

The pin-out for the smôl ZOE-M8Q OUT connector is as follows:

OUT Connector Pin No.Signal NameFunctionNotes
1PROC_PWR_ENProcessor Power EnableNot used
23V33.3V Power Rail
3GNDPower Ground / 0V
4SCLKSPI ClockNot used
5COPISPI Controller Out Peripheral InNot used
6CIPOSPI Controller In Peripheral OutNot used
7CS0SPI Chip Select 0Not used
8CS1SPI Chip Select 1Not used
9CS2SPI Chip Select 2Not used
10GPIO0General Purpose Input / Output 0Connected to Pin 11 (GPIO1) on the IN connector
11GPIO1Not connected
12SDAI2C DataUsed for ZOE-M8Q communication
13SCLI2C ClockUsed for ZOE-M8Q communication
14GNDPower Ground / 0V
153V33.3V Power Rail
16V_USBUSB Power Rail (5V)Not used

We use a technique called waterfalling on the GPIO signals. If you haven't used waterfalling before, please check out the smôl Hookup Guide.

smôl Specifics

Interface:

  • I2C
  • Default Address: 0x42 (unshifted)

GPIO:

  • GPIO0 controls the power for the ZOE-M8Q
    • Pull GPIO0 high or leave floating to disable power for the ZOE-M8Q (default state)
    • Pull GPIO0 low to enable power for the ZOE-M8Q

Please remember that the smôl GPIO pins use waterfalling. The Arduino digital pin number for GPIO0 will depend on which Processor Board you are using and where the ZOE-M8Q is placed in the smôl stack. Please consult the smôl Hookup Guide for more details.

Arduino Example: Get Position

If you are using the smôl ESP32 Processor Board, you are going to want to install the CP210x USB Driver and Arduino Boards Package for the ESP32 first. Please see the smôl ESP32 Hookup Guide for more details.

The smôl ZOE-M8Q GNSS peripheral board is fully compatible with the SparkFun u-blox GNSS Arduino Library. You can install the library through the Arduino IDE Library Manager by searching for SparkFun u-blox GNSS. Alternatively, you can grab the library from GitHub or can download it as a zip file by clicking the button below:

The following example is based on Example3_GetPosition from the u-blox GNSS library. The only difference is the two extra lines of code which pull GPIO0 low to enable power for the ZOE-M8Q. Upload the code onto your processor board and open the Serial Monitor or a terminal emulator at 115200 baud to see the output.

language:c
#include <Wire.h> //Needed for I2C to GNSS

#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //http://librarymanager/All#SparkFun_u-blox_GNSS
SFE_UBLOX_GNSS myGNSS;

void setup()
{
  delay(1000);

  Serial.begin(115200);
  Serial.println("SparkFun u-blox example for the smôl ZOE-M8Q");

  // GNSS power is disabled by default on the smôl ZOE-M8.
  // We need to pull GPIO0 low to enable the power.
  // On the smôl ESP32, GPIO0 is connected to digital pin 27.
  // smôl uses waterfalling:
  //  If you have an intermediate smôl board between the ESP32 and the ZOE-M8Q
  //  and that board also uses GPIO0, then the ZOE-M8Q's power enable will be connected
  //  to GPIO1 instead which is digital pin 26 on the smôl ESP32.
  pinMode(27, OUTPUT);
  digitalWrite(27, LOW); // Pull GPIO0 (digital pin 27) low to enable power for the ZOE-M8Q

  delay(1000); // Give the ZOE-M8Q some time to power up

  Wire.begin();

  //myGNSS.enableDebugging(); //Uncomment this line to enable helpful debug messages on Serial

  if (myGNSS.begin() == false) //Connect to the u-blox module using Wire port
  {
    Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing."));
    while (1);
  }

  myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
  myGNSS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR
}

void loop()
{
  //The module only responds when a new position is available

  Serial.print(myGNSS.getYear());
  Serial.print("/");
  Serial.print(myGNSS.getMonth());
  Serial.print("/");
  Serial.print(myGNSS.getDay());
  Serial.print("");
  Serial.print(myGNSS.getHour());
  Serial.print(":");
  Serial.print(myGNSS.getMinute());
  Serial.print(":");
  Serial.print(myGNSS.getSecond());

  Serial.print(F(" Lat: "));
  Serial.print(myGNSS.getLatitude());

  Serial.print(F(" Long: "));
  Serial.print(myGNSS.getLongitude());
  Serial.print(F(" (degrees * 10^-7)"));

  Serial.print(F(" Alt: "));
  Serial.print(myGNSS.getAltitudeMSL());
  Serial.print(F(" (mm)"));

  Serial.print(F(" SIV: "));
  Serial.print(myGNSS.getSIV());

  Serial.println();
}

Troubleshooting

If the smôl ZOE-M8Q does not appear to be working, have you remembered to pull its GPIO0 signal low to enable the power? By default, power for the ZOE-M8Q is disabled. Pulling GPIO0 low enables the power.

If you are connecting to the smôl ZOE-M8Q via the smôl Header - without a Processor Board - you will need to tie the correct GPIO signal to GND with a jumper wire.

The Molex Flexible GNSS Antenna - u.FL is designed to work without a ground plane. It works best when positioned at least 40mm away from a ground plane. You will get little or no signal if: you stick the antenna to a metal enclosure, or position the antenna close to your battery or circuit boards. Position the antenna in clear space for best results. Please refer to the antenna Application Specification for more details.

Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the smôl ZOE-M8Q Peripheral Board, check out the following links:

smôl ZOE-M8Q Documentation:

smôl Documentation:


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

smôl Header Hookup Guide

$
0
0

smôl Header Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2058

Introduction

smôl is a new board format and, as the name suggests, they're really small!

smôl Header

smôl Header

SPX-18620
$2.95

Need to do some prototyping with smôl? Or want to connect your smôl stack to a Qwiic board or your favorite SPI sensor? The smôl Header is the perfect solution!

Required Materials

If you want to connect a Qwiic board to your smôl stack, you're going to need some Qwiic cables:

SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

KIT-15081
$7.95
13
Qwiic Cable - 50mm

Qwiic Cable - 50mm

PRT-14426
$0.95
Flexible Qwiic Cable - Female Jumper (4-pin)

Flexible Qwiic Cable - Female Jumper (4-pin)

CAB-17261
$1.50
Qwiic Cable - Breadboard Jumper (4-pin)

Qwiic Cable - Breadboard Jumper (4-pin)

PRT-14425
$1.50

If you're prototyping with smôl, you may need:

Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.50
20
Breadboard - Classic

Breadboard - Classic

PRT-00112
$9.95
17
Jumper Wires Premium 6" M/M Pack of 10

Jumper Wires Premium 6" M/M Pack of 10

PRT-08431
$3.95
2
Breadboard - Mini Modular (Red)

Breadboard - Mini Modular (Red)

PRT-12044
$3.95

The Header is part of the smôl ecosystem. Why not pair it with one of the smôl Processor Boards?

smôl ESP32

smôl ESP32

SPX-18619
$17.95













To be able to reduce the sleep current below 10µA, you're going to want to pair the ESP32 with one of our intelligent smôl Power Boards:

smôl Power Board LiPo

smôl Power Board LiPo

SPX-18622
$17.95
smôl Power Board AAA

smôl Power Board AAA

SPX-18621
$17.95

Don't forget that you will need Flexible Printed Circuits to connect your smôl boards together. You're going to need one FPC per board. Our 36mm FPC is the perfect length if you want the smôl boards to stack neatly, one on top of the other.

smôl 36mm 16-way Flexible Printed Circuit

smôl 36mm 16-way Flexible Printed Circuit

CAB-18731
$0.95















Suggested Reading

This is the hookup guide for the smôl Header. Click the button below if you want to find out more about smôl itself.

We recommend taking a look through the following tutorials if you are not familiar with the concepts covered in them:

Serial Peripheral Interface (SPI)

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

I2C

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

Hardware Overview

smôl boards are designed to stack one on top of the other, using 16-way 0.5mm-pitch Flexible Printed Circuits (FPCs). We really like FPCs and we're using them on more and more of our products. But they can be a bit tricky when it comes to prototyping or if you want to connect other devices to your smôl stack. The smôl Header is here to help!

FPC Connections

Like all of our smôl boards, the Header is equipped with a 16-way 0.5mm-pitch Flexible Printed Circuit connector. The pin-out for the smôl Header connector is as follows:

Connector Pin No.Signal NameFunction
1PROC_PWR_ENProcessor Power Enable
23V33.3V Power Rail
3GNDPower Ground / 0V
4SCLKSPI Clock
5COPISPI Controller Out Peripheral In
6CIPOSPI Controller In Peripheral Out
7CS0SPI Chip Select 0
8CS1SPI Chip Select 1
9CS2SPI Chip Select 2
10GPIO0General Purpose Input / Output 0
11GPIO1General Purpose Input / Output 1
12SDAI2C Data
13SCLI2C Clock
14GNDPower Ground / 0V
153V33.3V Power Rail
16V_USBUSB Power Rail (5V)

Breakout Pins

You've got full access to all the smôl pins, so connecting your favorite SPI board to smôl is as easy as plug-and-play! The smôl Header breaks out all 16 smôl connections in good old 0.1" format. The hole pattern is the same as an old school 16-pin 0.3" Dual-In line Package (DIP). Perfect for soldering header pins to and then pushing into standard breadboard.

Pictured are the 16 header breakout pins

Pictured are the dimensions of the breakout pins

Qwiic Connector

We've included a Qwiic connector too, so you can attach your favorite Qwiic boards to your smôl stack qwiicly and easily.

Pictured is the header Qwiic connector

Qwiic (I2C) Pull-ups

The Header also includes pull-up resistors for the I2C SDA and SCL signals. You can disconnect the resistors if required by opening the dual split-pad jumper links.

Pictured are the two pull-up resistors and the split pad jumper links

If you haven't used jumpers before, please check out our tutorial.

How to Work with Jumper Pads and PCB Traces

Handling 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.

Troubleshooting


Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the smôl Header, check out the following links:

smôl Header Documentation:

smôl Documentation:


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

ARGOS ARTIC R2 Satellite Transceiver Shield Hookup Guide

$
0
0

ARGOS ARTIC R2 Satellite Transceiver Shield Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2121

Introduction

ARGOS Satellite Transceiver Shield - ARTIC R2

ARGOS Satellite Transceiver Shield - ARTIC R2

SPX-17236
$199.95

Looking for a satellite communication board for your next project? This could be the one!

We offer three ARGOS ARTIC R2 satellite transceiver products:

ARGOS Satellite Transceiver Shield - ARTIC R2

ARGOS Satellite Transceiver Shield - ARTIC R2

SPX-17236
$199.95
smôl ARTIC R2

smôl ARTIC R2

SPX-18618
$199.95
SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SPX-17984
$199.95

All three boards use the same ARTIC R2 satellite transceiver chip. All three have the same power amplifier, with the same maximum output power and adjustable gain. All three have the same receive sensitivity. All three have on-board flash memory containing the ARTIC R2 firmware and Platform ID. All three are supported by our comprehensive Arduino Library which includes a full set of tried-and-tested examples.

Pictured are the three Spark Fun satellite boards

This board, the ARGOS Satellite Transceiver Shield - ARTIC R2, is the biggest of the three and the easiest to get your fingers around! It has the same footprint as our Feather-compatible Thing Plus boards and is designed to stack directly on top of a Thing Plus for easy development. If you are looking for a board to allow you to get to know how ARGOS satellite communication works, or are just starting out on your product development, or want a board you can plug into breadboard, or are not worried about making your tracking system as compact as possible, then this is the board for you!

The IOTA - the Integrated Open source Transceiver for ARGOS - is ideal if you are ready to incorporate an ARGOS transceiver into your design. Its castellated pads can be reflowed or hand-soldered as required. It also has slots for an RF screening can, should your certification process require one. The antenna connection is available on both a castellated pad and a u.FL connector.

The smôl ARTIC R2 is the baby of the three, but it still packs the same punch as its larger siblings. If you are developing a compact dart for whale tracking, or a small backpack for avian tracking, or a very discrete satellite tracker, then the smôl ARTIC R2 is the one for you.

If you would like to know more about the ARGOS satellite network itself, head on over to our ARGOS (ARTIC R2) Satellite Communication Guide:

ARGOS & ARTIC R2

The ARGOS satellite system has been around for quite a while. It was created in 1978 by the French Space Agency (CNES), the National Aeronautics and Space Administration (NASA) and the National Oceanic and Atmospheric Administration (NOAA), originally as a scientific tool for collecting and relaying meteorological and oceanographic data around the world. Today, ARGOS is revolutionising satellite communication, adding a constellation of 25 nanosatellites to complement the 7 traditional satellites carrying ARGOS instrumentation. The first of these, ANGELS, is already in operation and SparkFun were among the first users to transmit data to ANGELS in October 2020. When the constellation is complete, there will be a maximum of 10-15 minutes between satellite passes.

The ARTIC R2 is an integrated, low-power, small-size ARGOS 2/3/4 single chip transceiver. ARTIC implements a message based wireless interface. For satellite uplink communication, ARTIC will encode, modulate and transmit provided user messages. For downlink communication, ARTIC will lock to the downstream, demodulate and decode and extract the satellite messages. The ARTIC can transmit signals in frequency bands around 400MHz and receive signals in the bands around 466MHz, in accordance with the ARGOS satellite system specifications.

Our ARTIC R2 Satellite Transceiver Shield has been tested and certified by Kinéis. Compared to other satellite communication systems, the ARTIC R2 has a much lower current draw and will work with a very simple, very lightweight quarter-wave wire antenna. The ARTIC R2 chipset on our board operates from 3.3V and the on-board flash memory enables fast boot times. If you don’t need the full transmit power, or want to conserve your battery life, you can transmit at reduced power too thanks to opto-isolated gain control.

Our Arduino Library makes it really easy to get up and running with ARGOS. We’ve provided a full set of examples which will let you: configure the ARTIC R2 chipset; predict the next satellite pass; receive allcast and individually-coded messages; transmit messages using ARGOS 2, 3 and 4 encoding.


The ARGOS satellite system is currently restricted to specific programs and applications. Please check that your project meets these requirements before buying hardware. CLS (France) and the Woods Hole Group (America) will be able to advise if your project meets the requirements. "To meet system use requirements, all programs using Argos have to be related in some way or other to environmental protection, awareness or study, or to protecting human life."

Hardware Overview

In this section we'll cover what's included on the ARGOS ARTIC R2 Satellite Transceiver Shield.

ARTIC R2

The heart of the ARGOS ARTIC R2 Satellite Transceiver Shield is, of course, the ARTIC R2 transceiver itself. This is a clever chip containing a Digital Signal Processor (DSP) which modulates transmit messages and demodulates received messages. The DSP can boot from on-board flash memory or from an external microcontroller via SPI. When transmitting, it produces a 1mW (0dBm) output signal which is fed to a separate power amplifier.

Pictured is the ARTIC R2 chip

Our Arduino Library does all of the heavy lifting for you. By default, the library will tell the ARTIC R2 DSP to boot from the on-board flash memory. However, by changing one line of code, you can instead boot via SPI with your microcontroller providing the firmware for the DSP.

RF Amplifier

During transmit, the RFPA0133 power amplifier boosts the 0dBm (1mW) signal from the ARTIC R2.

Pictured is the RFPA0133 amplifier chip

Using full gain, the amplifier boosts the signal to approximately 25.8dBm (380mW). If you are using ARGOS 2 or 3 modulation and are transmitting from a 'noisy' environment, like a city, then you are probably going to need to use full power to ensure your messages get through. However, if you are using ARGOS 4 modulation and/or are transmitting from a 'quiet' environment, like the tundra or the ocean, then you will be able to transmit at reduced power.

Gain Control

You can adjust the transmit gain through software and the on-board opto-isolated gain control circuit.

Pictured is the opto-isolated gain control

Our Arduino Library can reduce the gain for you. If you call:

language:c
myARTIC.attenuateTXgain(true);

from inside your code, the opto-isolator will pull the RFPA0133's G8 pin low, reducing the gain by approximately 5dB. This also has the advantage of reducing the transmit current by approximately 80mA.

Flash Memory

By default, the DSP inside the ARTIC R2 will boot from the on-board flash memory. (But, as mentioned above, you also have the option of booting via SPI.)

Pictured is the flash memory chip

During production testing at SparkFun, we program the flash memory with the ARTIC R2 firmware (ARTIC006) and a Platform ID allocated by CLS. You will need to register the Platform ID on your ARGOS account to activate it. The Arduino Library reads the Platform ID from memory and uses it in the transmissions.

The original batch of boards we manufactured do not have the Platform ID pre-programmed into flash memory. For these boards - and only these boards - you will need to use v1.0.9 of the Arduino Library, request a Platform ID from CLS and include that ID in your code. Please see the ARGOS ARTIC R2 Satellite Communication Guide for more details.

Antenna

The antenna connection for the ARTIC R2 is u.FL.

Pictured is the u dot f l antenna connector

Warning: Always connect a 401MHz antenna to your shield before connecting the power. Transmitting with no antenna attached will damage the RF power amplifier.

Check out our tutorial if you haven't used u.FL before:

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Power Circuit

The ARGOS ARTIC R2 Satellite Transceiver Shield can draw power from the standard Thing Plus / Feather VUSB and/or VBATT pins. The shield will preferentially draw 5V power from VUSB if connected, but can also be powered by a standard 3.6V LiPo battery via VBATT.

The power circuit comprises: an automatic switching circuit to select VUSB or VBATT; 3.3V, 3.0V and 1.8V regulators.

Pictured are the components of the power circuit

LEDs

The ARGOS ARTIC R2 Satellite Transceiver Shield has four LEDs which indicate if the board is powered and if it is transmitting or receiving.

Pictured are the four light emitting diodes

When lit, the LEDs indicate:

  • RF: RF amplifier is powered on
  • RX: ARTIC R2 is receiving
  • TX: ARTIC R2 is transmitting
  • PWR: ARTIC R2 shield power circuit is on

If you want to save power, you can disable the LEDs by cutting the jumper links on the back of the board:

Pictured are the four jumper links

If you haven't worked with jumpers before, please check out our tutorial.

How to Work with Jumper Pads and PCB Traces

Handling 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.

Breakout Pins

The table below describes the function of each of the ARGOS ARTIC R2 Satellite Transceiver Shield breakout pins:

Pictured are the ARTIC R2 Shield breakout pins
Pin NameFunctionDescriptionNotes
CIPOOutputSPI interface: Controller In Peripheral Out.Logic level is 3.3V.
COPIInputSPI interface: Controller Out Peripheral In.Logic level is 3.3V.
SCLKInputSPI interface clock signal.Logic level is 3.3V. Typically 1MHz. See the ARTIC R2 datasheet for the permitted clock speeds.
CSInputSPI interface chip select.Logic level is 3.3V.
GNDPower ground / 0V.
G8InputGain control.Logic level is 3.3V. Pull high to set the RFPA0133 transmit power to maximum. The transmit power will be reduced by approximately 5dB if this pin is pulled low or left open.
BOOTInputConnected to the ARTIC R2 BOOT pin.Logic level is 3.3V. Pulled high via a 100k resistor. When high, the ARTIC boots from the on-board flash memory. Pull low if the ARTIC firmware will be downloaded by the MCU via SPI.
INT1OutputConnected to the ARTIC INT1 pin.Logic level is 3.3V. Will be pulled high by the ARTIC to indicate (e.g.) an RX_VALID_MESSAGE.
INT2OutputConnected to the ARTIC INT2 pin.Logic level is 3.3V. Will be pulled high by the ARTIC to indicate (e.g.) an RX_BUFFER_OVERFLOW.
RESETBInputConnected to the ARTIC reset pin.Logic level is 3.3V. Pulled high via a 100k resistor. Pull low to reset the ARTIC.
PWR ENInputShield power circuit enable.Logic level is 3.3V. Pulled low via a 100k resistor. Pull high to enable power for the ARTIC R2.
RF ENInputRF Amplifier enable.Logic level is 3.3V. Pulled low via a 100k resistor. Pull high to enable power for the RF amplifier.
VUSBPowerPower input from (e.g.) USB.Typically 5V. 6.5V maximum.
VBATTPowerPower input from (e.g.) a LiPo battery.Typically 3.6V - 4.2V. 6.5V maximum.

Power can be provided via the VBATT pin or the VUSB pin, or both. The shield will preferentially draw power from USB if connected. On-board 3.3V and 1.8V regulators regulate USB or battery power for the ARTIC R2 and RF amplifier. See below for the typical VBATT current draw.

Hardware Hookup

The ARGOS ARTIC R2 Satellite Transceiver Shield is designed to be mounted directly on top of one of our Feather-compatible Thing Plus boards. You will find that the examples in the Arduino Library are written for the SparkFun Thing Plus - Artemis but they can be adapted for any board by changing the pin definitions in the code. If you are looking for a works-out-of-the-box solution then the SparkFun Thing Plus - Artemis is the one to go for.

If you are looking for a complete kit to get you started, here are the parts you will need:

Lithium Ion Battery - 2Ah

Lithium Ion Battery - 2Ah

PRT-13855
$12.95
7
Break Away Headers - Straight

Break Away Headers - Straight

PRT-00116
$1.50
20
ARGOS Satellite Transceiver Shield - ARTIC R2

ARGOS Satellite Transceiver Shield - ARTIC R2

SPX-17236
$199.95
SparkFun Thing Plus - Artemis

SparkFun Thing Plus - Artemis

WRL-15574
$20.95
Female Headers

Female Headers

PRT-00115
$1.50
7
USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3
ARGOS Omnidirectional Antenna - 401MHz

ARGOS Omnidirectional Antenna - 401MHz

WRL-17523
$6.95

If you want to add GNSS functionality to your kit, so you can transmit your location accurately and/or predict the next satellite pass based on your location, you will also need (e.g.):

SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)

SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic)

GPS-15210
$39.95
3
Qwiic Cable - 100mm

Qwiic Cable - 100mm

PRT-14427
$1.50

or:

SparkFun GPS Breakout - ZOE-M8Q (Qwiic)

SparkFun GPS Breakout - ZOE-M8Q (Qwiic)

GPS-15193
$49.95
6
Flexible Qwiic Cable - 50mm

Flexible Qwiic Cable - 50mm

PRT-17260
$0.95
Molex Flexible GNSS Antenna - U.FL (Adhesive)

Molex Flexible GNSS Antenna - U.FL (Adhesive)

GPS-15246
$3.95
1

Our favorite way to connect the ARGOS Shield to the Thing Plus Artemis is to use stacking headers. Solder lengths of our Female Headers onto the top of the Thing Plus Artemis. (This will allow you to connect jumper wires to the board if you want to.) Solder lengths of our male Break Away Headers - Straight to the underside of the ARGOS Shield. (This will allow you to mount the shield on breadboard too if you want to.) That's all the soldering done. If you haven't soldered before, you will find our tutorial useful:

How to Solder: Through-Hole Soldering

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

Mate the two boards together and voilà, you're just about ready to rock!

Connect your ARGOS antenna to the shield before you forget!


Warning: Always connect a 401MHz antenna to your shield before connecting the power. Transmitting with no antenna attached will damage the RF power amplifier.

If you connect your LiPo battery to the Thing Plus Artemis now, it will recharge while you have USB power connected.

You won't need the GNSS receiver to begin with, but if you want to hook it up now, go right ahead! For the ZOE-M8Q, the GNSS antenna clips onto the u.FL connector on the GNSS board. Check out our tutorial if you haven't used u.FL before:

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Connect the GNSS board to the Thing Plus using the Qwiic cable (which provides both power and I2C data).

Finally, the USB-C cable connects the Thing Plus to your computer. If you haven't used a CH340 USB interface before, you will want to install the driver first. The following section describes how to do that.

Jumper Wire Connections

If you have used the recommended Thing Plus Artemis and stacking headers, you don't need to worry about which signals to connect. It's all done for you. However, if you want to use a different Arduino board and connect your shield using jumper wires, here are the connections:

  • Power:
    • Connect GND to a GND (Ground) / 0V pin on your Arduino board
    • If you want your Arduino board to provide power to the ARGOS ARTIC R2 Shield, we recommend connecting the Shield's VUSB pin to the 5V pin on your Arduino board
  • SPI:
    • Connect CIPO, COPI and SCLK to the SPI pins on your Arduino board
    • Connect the CS (Chip Select) pin to a suitable I/O pin
  • I/O (Essential):
    • Connect the RESETB, BOOT, PWR EN, RF EN, INT1 and INT2 pins to suitable I/O pins on your Arduino board. Make a note of the pin numbers as you will need to enter them into the code.
  • I/O (Optional):
    • Connect the G8 gain control pin to another I/O pin on your Arduino board if you want to be able to control the transmit gain via software. If you leave this pin floating, the RF amplifier will transmit at reduced gain. Pull this pin up to 3.3V to transmit at maximum gain.

Warning: while the ARGOS ARTIC R2 Satellite Transceiver Shield can operate using 5V (USB) power, all of the SPI and I/O connections are 3.3V. Do not connect these signals directly to an Arduino board with 5V I/O such as the classic Arduino UNO or MEGA.

Note: Feather and Thing Plus Pins

On some Feather and Thing Plus boards, you may find that the pin below the ARGOS Shield's RF EN pin is digital pin 13 and also connected to the board's built-in LED. On some boards, the LED is flashed rapidly while the bootloader is running and code is being uploaded to the board. This will cause the Shield's RF power circuit to be turned on and off rapidly. While this is unlikely to damage the RF amplifier, it is best avoided. SAMD-based boards are the worst offenders.

Note: Molex GNSS Antenna

Our Molex GNSS Antenna is very lightweight and is self-adhesive. It is an ideal choice for miniature satellite tracker projects. However, the antenna works best when located at least 40mm away from a ground plane. Don't be tempted to stick the antenna to a ground plane, metallic case or even your LiPo battery. If you do, you will get little or no GNSS signal. Please consult the application specification for more details.

Software Setup

If you are new to Arduino and the IDE, this guide will get you up and running:

Installing Arduino IDE

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

If you haven't installed an Arduino Library before, this is the guide you need:

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.

If you haven't used the Artemis Thing Plus before, this guide will tell you everything you need to know:

Hookup Guide for the SparkFun Artemis Thing Plus

Get started with our SparkFun Artemis Thing Plus - our popular Thing Plus footprint with the powerful Artemis module for ultimate functionality.

You can find more specific information on how to install the Arduino Core for Artemis (Apollo3) in this guide. The section on Arduino Installation is the one to read in detail.

Artemis Development with Arduino

Get our powerful Artemis based boards (Artemis Nano, BlackBoard Artemis, and BlackBoard Artemis ATP) blinking in less than 5 minutes using the SparkFun Artemis Arduino Core!

The Artemis Thing Plus uses a CH340 interface chip to communicate on USB. If you haven't installed drivers for the CH340 previously, this guide will tell you everything you need to know:

How to Install CH340 Drivers

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Checklist

Pictured is the Arduino I D E board selection
  • Click on Tools\Manage Libraries... to open the library manager
  • In the search box, type SparkFun ARGOS ARTIC R2
  • Click the Install button to install the ARGOS ARTIC R2 library
    • If your shield came with an ARGOS Platform ID card showing which ID is pre-programmed into the shield's flash memory, you can install the latest version of the library
The original batch of ARTIC R2 Shields we manufactured do not have the Platform ID pre-programmed into flash memory. For these boards - and only these boards - you will need to use v1.0.9 of the Arduino Library, request a Platform ID from CLS and include that ID in your code. Please see the ARGOS ARTIC R2 Satellite Communication Guide for more details.

Pictured is the Arduino I D E library manager

Alternatively, you can grab the library directly from GitHub or can download it as a zip file by clicking the button below:

If you have a board from the first batch we manufactured, you can download a zip file of v1.0.9 of the library by clicking the link below:


Warning: Ensure you have a 401MHz antenna connected to your shield before connecting the USB cable. Transmitting with no antenna attached will damage the RF power amplifier.

  • Attach the Thing Plus to your computer using a USB-C cable
    • If you are using Windows, you should hear the usual USB-connection chime
  • Click on Tools\Port and select the COM port for the Artemis

Pictured is the Arduino I D E tools port menu

Arduino Example: Satellite Detection

The SparkFun ARGOS ARTIC R2 Arduino Library contains a full set of tried and tested examples which will run on the Artemis Thing Plus when connected to the ARTIC R2 Shield. The examples will run on other Arduino boards, but you will need to change the pin definitions in the code to match your board.

The code below is a stripped-down version of Example4_SatelliteDetection. Copy and paste the code into a new window in the Arduino IDE:

language:c
#include <SPI.h>
#include "SparkFun_ARGOS_ARTIC_R2_Arduino_Library.h" // http://librarymanager/All#SparkFun_ARGOS_ARTIC_R2
ARTIC_R2 myARTIC;

// Pin assignments for the SparkFun Thing Plus - Artemis
// (Change these if required)
int CS_Pin = 24;
int GAIN8_Pin = 3;
int BOOT_Pin = 4;
int INT1_Pin = 5;
int INT2_Pin = 6;
int RESET_Pin = 7;
int ARTIC_PWR_EN_Pin = 8;
int RF_PWR_EN_Pin = 9;

void setup()
{
  Serial.begin(115200);
  Serial.println(F("ARGOS ARTIC R2 Example"));

  Serial.println(F("ARTIC R2 is booting..."));

  SPI.begin();

  //myARTIC.enableDebugging(); // Uncomment this line to enable debug messages on Serial

  // Begin the ARTIC: enable power and boot from flash
  if (myARTIC.begin(CS_Pin, RESET_Pin, BOOT_Pin, ARTIC_PWR_EN_Pin, RF_PWR_EN_Pin, INT1_Pin, INT2_Pin, GAIN8_Pin) == false)
  {
    Serial.println("ARTIC R2 not detected. Freezing...");
    while (1)
      ; // Do nothing more
  }

  Serial.println(F("ARTIC R2 boot was successful."));

  // Read the Platform ID from flash memory
  uint32_t platformID = myARTIC.readPlatformID();
  if (platformID == 0)
  {
    Serial.println(F("You appear to have an early version of the SparkFun board."));
    Serial.println(F("For the transmit examples, you will need to use the Library Manager to select version 1.0.9 of this library."));
  }
  else
  {
    Serial.print(F("Your Platform ID is: 0x"));
    Serial.println(platformID, HEX);
  }

  myARTIC.setTCXOControl(1.8, true); // Set the TCXO voltage to 1.8V and autoDisable to 1

  myARTIC.setSatelliteDetectionTimeout(600); // Set the satellite detection timeout to 600 seconds

  Serial.println(F("Starting satellite detection..."));

  // Start satellite detection
  // The ARTIC will start looking for a satellite for the specified amount of time.
  myARTIC.sendMCUinstruction(INST_SATELLITE_DETECTION);
}

void loop()
{
  delay(1000);

  // Read the ARTIC R2 status register
  ARTIC_R2_Firmware_Status status;
  myARTIC.readStatusRegister(&status);

  // Check the interrupt 2 flag. This will go high if satellite detection times out
  if (status.STATUS_REGISTER_BITS.DSP2MCU_INT2)
  {
    Serial.println(F("INT2 pin is high. Satellite detection has timed out!"));
  }
  // Check the interrupt 1 flag. This will go high when a satellite is detected
  else if (status.STATUS_REGISTER_BITS.DSP2MCU_INT1)
  {
    Serial.println(F("INT1 pin is high. Satellite detected!"));
  }

  // Check the instruction progress
  // checkMCUinstructionProgress will return true if the instruction is complete
  ARTIC_R2_MCU_Instruction_Progress progress;
  boolean instructionComplete = myARTIC.checkMCUinstructionProgress(&progress);

  if (instructionComplete)
  {
    Serial.println(F("Satellite detection is complete! Freezing..."));
    while (1)
      ; // Do nothing more
  }
}

Save the file and click on the Upload button to upload the example onto the Artemis:

Pictured is the Arduino I D E upload button

Open Tools\Serial Monitor to see the serial messages from the Artemis.

Check that the baud rate is set to 115200:

Pictured is the Arduino I D E serial monitor

The two red power LEDs and the yellow RX LED on the Satellite Transceiver Shield will light up when the code is running.

Once the ARTIC R2 has booted, the code will read the pre-programmed Platform ID from flash memory. If it does not find one, you will see a message reminding you to install v1.0.9 of the ARTIC R2 library.

The ARTIC R2 will try to detect a satellite for up to 10 minutes. You may wish to log into the ARGOS website and predict when the next satellite pass will take place before running this example.

Current Draw

Knowing the current drawn by the ARTIC R2 Shield is of course very important when calculating your battery life.

We measured the ARTIC R2 Shield's current draw using the fantastic Otii Arc Power Analyzer. The Otii Arc was configured to output 3.6V and we connected it to the Shield's VBATT pin to replicate a LiPo battery.

  • Current Draw:
    • Sleep (PWR EN and RF EN low): 51µA
    • Idle (power LEDs enabled): 7.2mA (AVG)
    • Receive: 32.9mA
    • Transmit (full power, G8 pin high): 226mA
    • Transmit (reduced gain, G8 pin low): 170mA

Here is the data captured by Otii Arc when transmitting ARGOS 3 ZE data at full power:

Pictured is the current draw at full power

And here is the current draw when transmitting ARGOS 3 ZE data at reduced power:

Pictured is the current draw at reduced power

Certification

The ARGOS ARTIC R2 Satellite Transceiver Shield has been tested and certified by Kinéis, who are responsible for the operation of the ARGOS system. You can find copies of the ARGOS 2, 3 and 4 certificates below.

We are very grateful for the time and effort Kinéis have spent testing the SparkFun ARTIC R2 products.

Troubleshooting

Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about the ARGOS ARTIC R2 Satellite Transceiver Shield, check out the following links:

ARGOS ARTIC R2 Satellite Transceiver Shield Documentation:

ARGOS ARTIC R2 Documentation:


Thanks! The ARTIC R2 circuit is a remix of the reference design kindly provided by the Arribada Initiative and Icoteq Ltd.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

Red Hat Co.Lab Robotic hand kit curriculum guide

$
0
0

Red Hat Co.Lab Robotic hand kit curriculum guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2124

Introduction

In this kit, you’ll find everything you need to understand the basics of a continuous rotation (CR) servo and sensor.

The Red Hat® Robotic Hand kit will help you:

  1. Discover how breadboards work by experimenting with simple circuits using a CR servo.
  2. Design and construct a hand that can flex and release.

After you’ve built your robotic hand, check out the Red Hat Open Source Stories film, E-nable. This film shows us how we can design and create for those with differing abilities while growing our empathy for those who experience the world differently.

Red Hat Co.Lab Robotic Hand Kit

Red Hat Co.Lab Robotic Hand Kit

CUST-18483

Before You Start

Before you start assembling your kit, there are some things you can do ahead of time to ensure your project will be successful. The information below will tell you how much time you can expect to spend on each part, what tools and materials you'll need, and what you can do before you start your project.

Before getting started image

Recommended Age and Prerequisite Skills

This activity is best suited for ages 12-15. There are no specific skills required to complete the project except for the ability to tie a knot and use scissors. No prior knowledge of circuits is assumed.

Time Requirements

  • Part one: creating a “hand”--30 minutes
  • Part two: continuous rotation servo & string--45 minutes

Tools and Materials

  1. The Red Hat Co.Lab Robotic Hand kit
  2. The box: For making our hand
  3. Scissors: For modifying the cardboard for the experiment (cutting cardboard)

Identify the Parts

It’s helpful to know the parts you’ll use before building. Lay the parts out in front of you on a piece of paper. As you lay them out, pick them up and examine each one. How many pins does it have? What colors are on it? Is each leg of the component the same length? Can you guess what it does on the basis of how it looks or what it's called? Write these observations down next to each part as this will help you organize the pieces as you begin to explore and build.

While you’re laying out the parts for your project, make sure you have the other required materials that didn’t come with your kit (cardboard box and a pair of scissors).

By this point you have:

  1. Identified each part (and labeled it so it’s easier to find).
  2. Counted each part to make sure you have the correct number.
  3. Examined each part to make sure it's not broken.

Now that you’ve completed the setup, you can start to design and experiment.

Materials needed

Resources

Below are in-depth descriptions of the parts in this kit.

  • Circuits: The basics of how circuits work, as well as links to more information.
  • Breadboards: A thorough examination of the interior mechanics of the breadboard.
  • Continuous rotation servo: An explanation of CR servos.
  • Servos: A general explanation of servos.

What is a Circuit?

Every electrical project starts with a circuit. Don't know what a circuit is? We're here to help.

How to Use a Breadboard

Welcome to the wonderful world of breadboards. Here we will learn what a breadboard is and how to use one to build your very first circuit.

Continuous Rotation Servo Trigger Hookup Guide

How to use the SparkFun Continuous Rotation Servo Trigger with continuous rotation servos, without any programming!

Part 1: Creating a “Hand”

What does the hand do?

The human hand is a complex machine, made up of skin, bones, muscles, nerves, tendons, and ligaments. Our hands allow us to grip items in many ways and with various levels of power and dexterity. Replicating a hand is very hard to do because of its many components as well as its sense of touch. Imagine the differences between how you lift a pencil to write, how you might lift a heavy bag, and how you open a door. Each of these activities requires different motions, different fingers, and different levels of strength to accomplish the task. As part of the experiment, we’ll focus on how we can replicate the gripping motion of just a few fingers with a circuit and cardboard box.

How can we replicate a hand?

Start by removing some pieces from the cardboard box the kit came in. With the lid open, remove each of the side flaps that would normally tuck into the box when closed.

Removing first pieces of cardboard

Next, with the side of the box with the opening facing you (also the side with a half circle cut out near the top), cut a rectangle into the left-hand side. This is where you’ll insert the servo—you can use that part to measure the size of the slot to be created.

cut a rectangle into the left-hand side

On the opposite end of the rectangle, make three fingers by cutting out small gaps. These gaps should resemble very thin rectangles.

make three fingers

Using either a pen or the thinnest end of a screwdriver, poke holes in the center of each finger created. This is best accomplished by opening the lid and flipping it over so that you’re looking at the brown side of the cardboard box. Then, gently apply pressure creating the smallest possible hole in the cardboard.

poke holes in the center of each finger created

Next, replicate how fingers typically bend. This means slightly creasing each finger at approximately the same location. These will replicate the second finger knuckle and where the finger connects to the hand. Then, bend the whole lid just below the thin rectangles to replicate how a hand can fold.

replicate how fingers typically bend

Now you have the beginnings of the hand. Next, measure out three single clear wires. Each one should be about as long as the length of the box plus a half length. To do this, take the clear wire and spool out enough to run the length of the long part of the box and then enough to run back along that same half until you get to the half circle.

measure out three single clear wires

For each wire, thread one end through the finger hole you created so that the knot is on the bottom side. Thread the other end upward through the holes in the circle servo piece so that it knots on the top.

thread one end of the wire through the finger hole you created so that the knot is on the bottom side

Part 2: Breadboarding and the CR Servo

Here's a walkthrough showing the steps of Part 2.

What is a circuit?

A circuit is a closed loop that electricity can travel around. At its most basic, a circuit consists of three parts:

  • A voltage source: The power for the circuit.
  • A load: The thing that is being powered, like a servo, buzzer, or light. I The circuit path: The continuous path that the current follows as it travels around the circuit.

An example of a simple circuit would be a power source (like a battery), a load (like an LED), and the circuit path (the wires that connect them).

Making the Circuit

1. The power/voltage source

This kit comes with a wall adaptor that connects to the DC barrel jack. Unlike using 9V or AA batteries, this kit requires that we draw power directly from a wall outlet. We won’t plug the adapter into the wall until the last step. In the meantime, prep the barrel jack. The way to connect the barrel jack to the breadboard is with jumper wires, which are short in length and make connecting components quick and easy.

The jumper wires that come in your kit have small metal pins on either side. The colors of the jumper wires don’t correspond to anything in your kit. However, it is convention to use red cables for positive connectors (+) and black for negative connectors (-). The black plastic on the barrel connector is marked with a (+) and (-) sign to indicate positive and negative. Slide one side of the jumper wire into the positive (+) green barrel jack connector and match it to the corresponding positive (+) spot on the right side of the breadboard. Repeat this for the negative (-) connection.

Connect the jumper wires to their corresponding barrel jack connector terminals

2. The Load

For this step, use a CR circuit attached to a servo triggered by a push button. Pause and take a look at what each of these parts actually does.

The CR servo trigger is a small robotics board that simplifies the control of servo motors. When an external switch or signal changes state, the servo trigger is able to tell an attached servo to move from position A to position B. To use the servo trigger, connect a hobby servo and a switch, then use the on-board potentiometers to adjust the start/stop positions and the transition time. In this way, you can use a hobby servo in your projects without having to do any programming. It’s important to note that the CR servo trigger has three sets of pins that are attached to it. One set of three pins will be used to connect to the actual servo motor. One set of two pins will be used for connecting jumper wires to the button. This will start and stop the operation of the servo. The last set of two pins, pointing in the opposite direction as the other sets, will be used to directly insert the servo trigger into the breadboard power rails. Make sure you note these different pin configurations before following the instructions later in this guide.

The SparkFun Continuous Rotation Servo trigger

A servomechanism can refer to many different machines that have been around for a while. Servos are found in everything from heavy machinery, to power steering in vehicles, to robotics, and a wide variety of electronics. If you open up a standard hobby servo motor, you’ll usually find three core components, a DC motor, a controller circuit, and a potentiometer or similar feedback mechanism. The DC motor is attached to a gearbox and output/drive shaft to increase the speed and torque of the motor. The DC motor drives the output shaft. The controller circuit interprets signals sent by the controller, and the potentiometer acts as the feedback for the controller circuit to monitor the position of the output shaft. Nearly all hobby servos have a standard three-pin connector to power and control the servo. With a servo, you can power and control the direction, speed, and position of the output shaft with only three wires.

How a Servo works

A switch is a component that controls the openness or closedness of an electric circuit. It allows control over current flow in a circuit (without having to actually get in there and manually cut or splice the wires). Switches are critical components in any circuit that requires user interaction or control. A switch can only exist in one of two states: open or closed. In the off state, a switch looks like an open gap in the circuit. This, in effect, looks like an open circuit, preventing current from flowing. In the on state, a switch acts like a piece of conducting wire. This closes the circuit, turning the system on and allowing current to flow unimpeded through the rest of the system.

How a switch works

3. The Circuit Path

For a circuit to work, the path of the power can’t be interrupted—all pieces have to be in contact. Luckily, you have a breadboard that’s a helpful tool you can use to quickly plug in items and keep them connected. You can also create, fix small mistakes, and practice with the components.

What is a breadboard?

Start by taking a look at the breadboard that’s included in your kit:

First, notice there are two long columns of holes running down each side of the board, one with a red line beside it, and one with a black line. These are called the power rails, and all the holes in a single power rail are connected to each other. If power is connected to one hole in the column, it's connected to all the other holes in the column.

There are two holes in the plastic molding at the end of the wires coming from the wall plug. Insert a jumper wire into each of these holes and insert the other ends into the (+) power rail and the (-) power rail.

Attach the power jumper wires to the breadboard

Second, all the holes in a numbered row are connected to each other, but this connection is broken at the small trench or indent that runs down the center of the board. Each side could be its own separate circuit. Our project will jump over the trench using jumper wires and send power back and forth.

You can view a breadboard as a series of columns (labeled A-E and F-J) and rows (labeled 1-30). Remember, the divide in the middle means A5 isn’t connected to F5. When you get to the instructions below, you’ll use this row and column system to mark where connections should be made (A6, E3, H23, etc.).

Circuit drawing to replicate with hardware

Replicate this circuit show above (the steps are below). You’ll only use a few jumper wires but be especially careful to place them into the appropriate coordinate points on your breadboard. We won’t connect to the power adapter until the last step.

Create your circuit as follows:

  1. Locate the set of two pins that point in the opposing direction as the other pin connectors. Place the CR servo trigger circuit so that these pins align with the positive (+) and negative (-) power rails on the right side of the breadboard. Gently press into place.
  2. Connect the button so that the left side is seated into D10 and D12 with the right side seated into G10 and G12.
  3. Locate the two pins on the servo trigger pointing up. Connect the socket side of a jumper wire to the pin labeled IN and the pin side of the jumper wire to C10.
  4. Connect the socket side of a second jumper wire to the pin labeled GND and the pin side to H12.
  5. Connect the black three-pin connector from the servo to the remaining three-pin connectors on the servo trigger so that the black wire is connected to the pin labeled GND.
  6. Make sure the black and red wires from the barrel jack power supply are connected as discussed in the circuit section above.

Testing

Once you complete the steps above and plug the DC power supply into the wall, you can begin tinkering with your robotic hand. To test your build, simply click the button and watch the servo move. At this point, you’ll want to tinker with the white knobs on the continuous rotation servo trigger. On the circuit board, you will find three potentiometers: "A" sets the position the servo sits in while the switch is open, "B" sets the position the servo moves to when the switch is closed, and "T" sets the time it takes to get from A to B and back.

As you click the button, you’ll find that by twisting the white knob labeled “B” on the servo trigger changes the direction of the servo.

Completed roboatic hand assembly

Troubleshooting

Here are some things to look for if your project isn't working (and for some great illustrations and further explanations of these, see "Common mistakes" on the Science Buddies site.)

  1. Check your connections

    1. Double check the coordinates in the instructions to make sure the pins are completely inserted into the matching holes on the breadboard.
    2. Make sure components are fully seated in the breadboard. A component should go into the breadboard at least 4-5 mm (or a little less than the thickness of a pencil) when it's fully inserted.
    3. Check for shorts. When components get connected accidentally, this can cause a short circuit.
    4. Check the polarity of the capacitors and make sure they match the instructions.
  2. Check your power

    1. Make sure your batteries are fully inserted.
    2. Make sure your batteries work.

Full Kit Contents List

If you need to replace a part, here is a list of the individual components that make up the Red Hat Co.Lab Robotic Hand kit.


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

IOTA (ARTIC R2) Satellite Communication Module Hookup Guide

$
0
0

IOTA (ARTIC R2) Satellite Communication Module Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2122

Introduction

SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SPX-17984
$199.95

Looking for a satellite communication board for your next project? This could be the one!

We offer three ARGOS ARTIC R2 satellite transceiver products:

ARGOS Satellite Transceiver Shield - ARTIC R2

ARGOS Satellite Transceiver Shield - ARTIC R2

SPX-17236
$199.95
smôl ARTIC R2

smôl ARTIC R2

SPX-18618
$199.95
SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SPX-17984
$199.95

All three boards use the same ARTIC R2 satellite transceiver chip. All three have the same power amplifier, with the same maximum output power and adjustable gain. All three have the same receive sensitivity. All three have on-board flash memory containing the ARTIC R2 firmware and Platform ID. All three are supported by our comprehensive Arduino Library which includes a full set of tried-and-tested examples.

Pictured are the three Spark Fun satellite boards

This board, the IOTA - the Integrated Open source Transceiver for ARGOS - is ideal if you are ready to incorporate an ARGOS transceiver into your design. Its castellated pads can be reflowed or hand-soldered as required. It also has slots for an RF screening can, should your certification process require one. The antenna connection is available on both a castellated pad and a u.FL connector. You will find an Eagle symbol and footprint for IOTA in the SparkFun Eagle LibrariesRF Library.

The ARGOS Satellite Transceiver Shield - ARTIC R2, is the biggest of the three and the easiest to get your fingers around. It has the same footprint as our Feather-compatible Thing Plus boards and is designed to stack directly on top of a Thing Plus for easy development. If you are looking for a board to allow you to get to know how ARGOS satellite communication works, or are just starting out on your product development, or want a board you can plug into breadboard, or are not worried about making your tracking system as compact as possible, then this is the board for you.

The smôl ARTIC R2 is the baby of the three, but it still packs the same punch as its larger siblings. If you are developing a compact dart for whale tracking, or a small backpack for avian tracking, or a very discrete satellite tracker, then the smôl ARTIC R2 is the one for you.

If you would like to know more about the ARGOS satellite network itself, head on over to our ARGOS (ARTIC R2) Satellite Communication Guide:

ARGOS & ARTIC R2

The ARGOS satellite system has been around for quite a while. It was created in 1978 by the French Space Agency (CNES), the National Aeronautics and Space Administration (NASA) and the National Oceanic and Atmospheric Administration (NOAA), originally as a scientific tool for collecting and relaying meteorological and oceanographic data around the world. Today, ARGOS is revolutionising satellite communication, adding a constellation of 25 nanosatellites to complement the 7 traditional satellites carrying ARGOS instrumentation. The first of these, ANGELS, is already in operation and SparkFun were among the first users to transmit data to ANGELS in October 2020. When the constellation is complete, there will be a maximum of 10-15 minutes between satellite passes.

The ARTIC R2 is an integrated, low-power, small-size ARGOS 2/3/4 single chip transceiver. ARTIC implements a message based wireless interface. For satellite uplink communication, ARTIC will encode, modulate and transmit provided user messages. For downlink communication, ARTIC will lock to the downstream, demodulate and decode and extract the satellite messages. The ARTIC can transmit signals in frequency bands around 400MHz and receive signals in the bands around 466MHz, in accordance with the ARGOS satellite system specifications.

The IOTA has been tested and certified by Kinéis. Compared to other satellite communication systems, the ARTIC R2 has a much lower current draw and will work with a very simple, very lightweight quarter-wave wire antenna. The ARTIC R2 chipset on IOTA operates from 3.3V and the on-board flash memory enables fast boot times. If you don’t need the full transmit power, or want to conserve your battery life, you can transmit at reduced power too thanks to opto-isolated gain control.

Our Arduino Library makes it really easy to get up and running with ARGOS. We’ve provided a full set of examples which will let you: configure the ARTIC R2 chipset; predict the next satellite pass; receive allcast and individually-coded messages; transmit messages using ARGOS 2, 3 and 4 encoding.


The ARGOS satellite system is currently restricted to specific programs and applications. Please check that your project meets these requirements before buying hardware. CLS (France) and the Woods Hole Group (America) will be able to advise if your project meets the requirements. "To meet system use requirements, all programs using Argos have to be related in some way or other to environmental protection, awareness or study, or to protecting human life."

Hardware Overview

In this section we'll cover what's included on the IOTA (ARTIC R2) Satellite Communication Module.

ARTIC R2

The heart of IOTA is, of course, the ARTIC R2 transceiver itself. This is a clever chip containing a Digital Signal Processor (DSP) which modulates transmit messages and demodulates received messages. The DSP can boot from on-board flash memory or from an external microcontroller via SPI. When transmitting, it produces a 1mW (0dBm) output signal which is fed to a separate power amplifier.

Pictured is the ARTIC R2 chip

Our Arduino Library does all of the heavy lifting for you. By default, the library will tell the ARTIC R2 DSP to boot from the on-board flash memory. However, by changing one line of code, you can instead boot via SPI with your microcontroller providing the firmware for the DSP.

RF Amplifier

During transmit, the RFPA0133 power amplifier boosts the 0dBm (1mW) signal from the ARTIC R2.

Pictured is the RFPA0133 amplifier chip

Using full gain, the amplifier boosts the signal to approximately 25.7dBm (370mW). If you are using ARGOS 2 or 3 modulation and are transmitting from a 'noisy' environment, like a city, then you are probably going to need to use full power to ensure your messages get through. However, if you are using ARGOS 4 modulation and/or are transmitting from a 'quiet' environment, like the tundra or the ocean, then you will be able to transmit at reduced power.

Gain Control

You can adjust the transmit gain through software and the on-board opto-isolated gain control circuit.

Pictured is the opto-isolated gain control

Our Arduino Library can reduce the gain for you. If you call:

language:c
myARTIC.attenuateTXgain(true);

from inside your code, the opto-isolator will pull the RFPA0133's G8 pin low, reducing the gain by approximately 5dB. This also has the advantage of reducing the transmit current by approximately 80mA.

Flash Memory

By default, the DSP inside the ARTIC R2 will boot from the on-board flash memory. (But, as mentioned above, you also have the option of booting via SPI.)

Pictured is the flash memory chip

During production testing at SparkFun, we program the flash memory with the ARTIC R2 firmware (ARTIC006) and a Platform ID allocated by CLS. You will need to register the Platform ID on your ARGOS account to activate it. The Arduino Library reads the Platform ID from memory and uses it in the transmissions.

Antenna

On IOTA, you have a choice of antenna connection: u.FL; or a castellated pad.

Pictured are the two antenna connections

Warning: Always connect a 401MHz antenna to your IOTA before connecting the power. Transmitting with no antenna attached will damage the RF power amplifier.

Check out our tutorial if you haven't used u.FL before:

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Power Circuit

The IOTA requires a 3.3V &pm;0.1V DC power supply able to cope with the maximum transmit current of 230mA.

The power circuit comprises: in-rush and over-current protection; 3.0V and 1.8V regulators.

Pictured are the components of the power circuit

Screening Can

IOTA has slots and ground pads for an RF screening can, should your certification process require one.

You can find the design for the screening can on onshape. You can right-click on the onshape document tabs and select Export... to export the design in a variety of formats.

Pictured are the screening can slots and pads - click to go to the onshape design

Pictured is the design of the screening can - click to go to the onshape design

Castellated Pads

The IOTA has 24 castellated pads. It can be reflowed or hand-soldered onto a PCB depending on your needs.

You will find an Eagle symbol and footprint for IOTA in the SparkFun Eagle LibrariesRF Library.

The photo below shows the bottom of IOTA. Pad 1 is top right.

Pictured are the I O T A castellated pads

The table below describes the function of each of the IOTA's castellated pads. Looking at IOTA from the top, pad 1 is top left. Pad numbering is counter-clockwise.

Pictured is pad 1
Pad No.NameFunctionDescription
1G8INPUTPull up to 3.3V to set the RFPA0133 transmit power to maximum. The transmit power will be reduced by _approximately_ 5dB if this pin is pulled low or left open.
23.0V OutOUTPUTThis pad allows measurement of the module's internal 3.0V rail.
3BOOTINPUTConnected to the ARTIC BOOT pin. Pulled up to 3.3V via a 100k resistor. When high, the ARTIC boots from the external flash memory. Pull low if the ARTIC firmware will be downloaded by the MCU via SPI.
4INT1OUTPUTConnected to the ARTIC INT1 pin. Will be pulled up to 3.3V by the ARTIC to indicate (e.g.) an RX_VALID_MESSAGE.
5INT2OUTPUTConnected to the ARTIC INT2 pin. Will be pulled up to 3.3V by the ARTIC to indicate (e.g.) an RX_BUFFER_OVERFLOW.
6RESETBINPUTConnected to the ARTIC reset pin. Pulled up to 3.3V via a 100k resistor. Pull low to reset the ARTIC.
7CSINPUTSPI interface Chip Select. 3.3V. Active low.
8SCLKINPUTSPI interface clock signal. Typically 1MHz. 3.3V. See the ARTIC R2 datasheet for the permitted clock speeds.
9COPIINPUTSPI interface: Controller Out Peripheral In. 3.3V.
10CIPOOUTPUTSPI interface: Controller In Peripheral Out. 3.3V.
111.8V OutOUTPUTThis pad allows measurement of the module's internal 1.8V rail.
12GNDPower ground / 0V.
13GNDPower ground / 0V.
14VININPUT3.3V power supply for the module. Voltage must be: 3.3V +/- 0.1V. Current limit: 500mA.
15PWR ENINPUTPulled low via a 10k resistor. Pull up to 3.3V to enable power for the ARTIC R2.
16FLASH_PWRINPUT3.3V power supply for the internal flash memory. Connect to Pin 17 (3.3V Out).
173.3V OutOUTPUTConnected to the module's internal 3.3V rail (switched) and provides power for the internal flash memory. Connect to Pin 16 (FLASH PWR).
18FLSH SCLKClock signal for the internal SST25VF020B 2-Mbit SPI Serial Flash. Used when programming the internal flash memory. Leave unconnected.
19FLSH SISerial Data In for internal SST25VF020B 2-Mbit SPI Serial Flash. Used when programming the internal flash memory. Leave unconnected.
20FLSH SOSerial Data Out for internal SST25VF020B 2-Mbit SPI Serial Flash. Used when programming the internal flash memory. Leave unconnected.
21FLSH CENChip Enable for internal SST25VF020B 2-Mbit SPI Serial Flash. Used when programming the internal flash memory. Leave unconnected.
22GNDPower ground / 0V.
23ANTENNARFAntenna connection (50 Ohm). Connected internally to the center pin of the u.FL connector.
24GNDPower ground / 0V.

Arduino Example: Satellite Detection


Warning: Always connect a 401MHz antenna to your IOTA before connecting the power. Transmitting with no antenna attached will damage the RF power amplifier.

The SparkFun ARGOS ARTIC R2 Arduino Library contains a full set of tried and tested examples which will run on any Arduino board, but you will need to change the pin definitions in the code to match your board.

This guide assumes you already have the Arduino IDE and the ARGOS ARTIC R2 Library installed, and have selected the correct Arduino Board. If you need help with any of that, please check out the ARGOS ARTIC R2 Shield Hookup Guide.

The code below is a stripped-down version of Example4_SatelliteDetection. Copy and paste the code into a new window in the Arduino IDE:

language:c
#include <SPI.h>
#include "SparkFun_ARGOS_ARTIC_R2_Arduino_Library.h" // http://librarymanager/All#SparkFun_ARGOS_ARTIC_R2
ARTIC_R2 myARTIC;

// Pin assignments - change these if required
int CS_Pin = 24;
int GAIN8_Pin = 3;
int BOOT_Pin = 4;
int INT1_Pin = 5;
int INT2_Pin = 6;
int RESET_Pin = 7;
int IOTA_PWR_EN_Pin = 8;

void setup()
{
  Serial.begin(115200);
  Serial.println(F("ARGOS ARTIC R2 Example"));

  Serial.println(F("ARTIC R2 is booting..."));

  SPI.begin();

  //myARTIC.enableDebugging(); // Uncomment this line to enable debug messages on Serial

  // Begin the ARTIC: enable power and boot from flash
  if (myARTIC.beginIOTA(CS_Pin, RESET_Pin, BOOT_Pin, IOTA_PWR_EN_Pin, INT1_Pin, INT2_Pin, GAIN8_Pin) == false)
  {
    Serial.println("ARTIC R2 not detected. Freezing...");
    while (1)
      ; // Do nothing more
  }

  Serial.println(F("ARTIC R2 boot was successful."));

  // Read the Platform ID from flash memory
  uint32_t platformID = myARTIC.readPlatformID();
  if (platformID == 0)
  {
    Serial.println(F("You appear to have an early version of the SparkFun board."));
    Serial.println(F("For the transmit examples, you will need to use the Library Manager to select version 1.0.9 of this library."));
  }
  else
  {
    Serial.print(F("Your Platform ID is: 0x"));
    Serial.println(platformID, HEX);
  }

  myARTIC.setTCXOControl(1.8, true); // Set the TCXO voltage to 1.8V and autoDisable to 1

  myARTIC.setSatelliteDetectionTimeout(600); // Set the satellite detection timeout to 600 seconds

  Serial.println(F("Starting satellite detection..."));

  // Start satellite detection
  // The ARTIC will start looking for a satellite for the specified amount of time.
  myARTIC.sendMCUinstruction(INST_SATELLITE_DETECTION);
}

void loop()
{
  delay(1000);

  // Read the ARTIC R2 status register
  ARTIC_R2_Firmware_Status status;
  myARTIC.readStatusRegister(&status);

  // Check the interrupt 2 flag. This will go high if satellite detection times out
  if (status.STATUS_REGISTER_BITS.DSP2MCU_INT2)
  {
    Serial.println(F("INT2 pin is high. Satellite detection has timed out!"));
  }
  // Check the interrupt 1 flag. This will go high when a satellite is detected
  else if (status.STATUS_REGISTER_BITS.DSP2MCU_INT1)
  {
    Serial.println(F("INT1 pin is high. Satellite detected!"));
  }

  // Check the instruction progress
  // checkMCUinstructionProgress will return true if the instruction is complete
  ARTIC_R2_MCU_Instruction_Progress progress;
  boolean instructionComplete = myARTIC.checkMCUinstructionProgress(&progress);

  if (instructionComplete)
  {
    Serial.println(F("Satellite detection is complete! Freezing..."));
    while (1)
      ; // Do nothing more
  }
}

Save the file and click on the Upload button to upload the example onto your Arduino board. Open Tools\Serial Monitor to see the serial messages. Check that the baud rate is set to 115200:

Pictured is the Arduino I D E serial monitor

Once the ARTIC R2 has booted, the code will read the pre-programmed Platform ID from flash memory. If it does not find one, you will see a message reminding you to install v1.0.9 of the ARTIC R2 library.

The ARTIC R2 will try to detect a satellite for up to 10 minutes. You may wish to log into the ARGOS website and predict when the next satellite pass will take place before running this example.

Current Draw

Knowing the current drawn by the IOTA is of course very important when calculating your battery life.

We measured the ARTIC R2 Shield's current draw using the fantastic Otii Arc Power Analyzer. IOTA is functionally identical to the Shield and the current draw is the same. The Otii Arc was configured to output 3.6V and we connected it to the Shield's VBATT pin to replicate a LiPo battery.

  • Current Draw:
    • Sleep (PWR EN and RF EN low): 51µA
    • Idle (power LEDs enabled): 7.2mA (AVG)
    • Receive: 32.9mA
    • Transmit (full power, G8 pin high): 226mA
    • Transmit (reduced gain, G8 pin low): 170mA

Here is the data captured by Otii Arc when transmitting ARGOS 3 ZE data at full power:

Pictured is the current draw at full power

And here is the current draw when transmitting ARGOS 3 ZE data at reduced power:

Pictured is the current draw at reduced power

Certification

IOTA has been tested and certified by Kinéis, who are responsible for the operation of the ARGOS system. You can find copies of the test certificates below.

We are very grateful for the time and effort Kinéis have spent testing the SparkFun ARTIC R2 products.

Troubleshooting

Not working as expected and need help?SparkX products are rapidly produced to bring you the most cutting edge technology as it becomes available. These products are tested but come with no guarantees. Live technical support is not available for SparkX products. Head on over to our forum for support or to ask a question and we will get back to you as soon as we can.

Resources and Going Further

For more information about IOTA, check out the following links:

IOTA Documentation:

ARGOS ARTIC R2 Documentation:


Thanks! The ARTIC R2 circuit is a remix of the reference design kindly provided by the Arribada Initiative and Icoteq Ltd.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado


1W LoRa MicroMod Function Board Hookup Guide

$
0
0

1W LoRa MicroMod Function Board Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t1996

Introduction

Frequency Operation

This LoRa module can only be used in the 915MHzLoRaWAN frequency band (i.e. 902 to 928 MHz). It is not compatible with other frequency bands; double check the frequency band used in your region. Check out these resources from The Things Network for an unofficial summary of regional radio regulations and list of the regional frequency plans.

The 1W LoRa MicroMod Function Board adds LoRa capabilities to your MicroMod project. It is intended to be used in conjunction with a MicroMod processor board and a MicroMod main board, which provides the electrical interface between a processor board and the function board(s).

SparkFun MicroMod LoRa Function Board

SparkFun MicroMod LoRa Function Board

WRL-18573
$39.95

Match up the board's M.2 edge connector to the slot of the M.2 connector and secure the function board with the screws provided with the main board.

Utilizing the 915M30S LoRa module from EBYTE, which is a 1W (30dBm) transceiver based around the SX1276 from Semtech. There is a robust edge mount RP-SMA connector for large LoRa (915MHz) antennas; with modification, a U.FL connector is also available. We've successfully tested a 12 miles line-of-sight transmission with this module (user results may vary).

With the MicroMod standardization, users no longer need to cross-reference schematics with datasheets, while fumbling around with jumper wires. Simply, match up the function board's M.2 edge connector to the slot of the M.2 connector on the main board and secure the function board with screws. All connections are hardwired to compatible pins of the processor board and the pin connections are standardized for the processor boards.

Required Materials

To get started, users will need a few of the items listed below. (You may already have a some of these items; read through the guide and modify your cart accordingly.)

MicroMod Processor Board

A processor board is required for the MicroMod system to operate. Users can choose a processor board, based upon their needs, to attach to the MicroMod M.2 connector of the main board. Below, are few options:

SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95
SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$19.95
2
SparkFun MicroMod nRF52840 Processor

SparkFun MicroMod nRF52840 Processor

WRL-16984
$19.95
SparkFun MicroMod RP2040 Processor

SparkFun MicroMod RP2040 Processor

DEV-17720
$11.95

MicroMod Main Board

A main board provides the electrical connections between the function and processor boards to operate. Users can choose a main board based upon their needs. Below, are few options:

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

Required Hardware

A Phillips screw driver is necessary to attach the processor board and function board(s) to the main board. Additionally, a USB-C cable is needed to connect the main board to a computer. The LoRa function board also requires a LoRa antenna for the transceiver to operate.

USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3
SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Below, is a selection of our 915MHz frequency band RP-SMA antennas.

Pycom LoRa and Sigfox Antenna Kit - 915MHz

Pycom LoRa and Sigfox Antenna Kit - 915MHz

WRL-14676
$11.95
915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

WRL-14876
$7.95
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

Optional Hardware

A LoRa gateway provides internet connection for LoRaWAN network. Below are a few options from our LoRa product category.

Nebra Outdoor HNT Hotspot Miner (915MHz)

Nebra Outdoor HNT Hotspot Miner (915MHz)

WRL-17844
10
LoRa Raspberry Pi 4 Gateway with Enclosure

LoRa Raspberry Pi 4 Gateway with Enclosure

WRL-16447
3
Nebra Indoor HNT Hotspot Miner (915MHz)

Nebra Indoor HNT Hotspot Miner (915MHz)

WRL-17843
13

Users can also use other LoRa boards for peer-to-peer communication. Below are a few options from our LoRa product category.

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

WRL-15836
$31.50
SparkFun LoRa Thing Plus - expLoRaBLE

SparkFun LoRa Thing Plus - expLoRaBLE

WRL-17506
$49.95
2
Interface Cable RP-SMA to U.FL

Interface Cable RP-SMA to U.FL

WRL-00662
$4.95
1
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

To modify the jumpers, users will need soldering equipment and/or a knife.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$8.95
7
Chip Quik No-Clean Flux Pen  - 10mL

Chip Quik No-Clean Flux Pen - 10mL

TOL-14579
$7.95
4
Weller WLC100 Soldering Station

Weller WLC100 Soldering Station

TOL-14228
$67.95
2
Hobby Knife

Hobby Knife

TOL-09200
$2.95
2

Suggested Reading

The MicroMod ecosystem is a unique way to allow users to customize their project to their needs. Click on the banner below for more information.

MicroMod Logo


For users who aren't familiar with the following concepts, we also recommend reading the following tutorials before continuing.

Serial Communication

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

Serial Peripheral Interface (SPI)

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

Pulse Width Modulation

An introduction to the concept of Pulse Width Modulation.

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.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

Processor Interrupts with Arduino

What 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.

SparkFun expLoRaBLE Hookup Guide

Check out our latest LoRaWAN development board with Bluetooth capabilities! With this guide, we'll get you passing data to The Things Network in no time.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!
New!

MicroMod Main Board Hookup Guide

The MicroMod Main Board - Single and Double are specialized carrier boards that allow you to interface a Processor Board with a Function Board(s). The modular system allows you to add an additional feature(s) to a Processor Board with the help of a Function Board(s). In this tutorial, we will focus on the basic functionality of the Main Board - Single and Main Board - Double.

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.

Installing Arduino IDE

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

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Hardware Overview

Board Dimensions

The overall board dimensions are roughly 65 x 35 mm with an approximate 6 mm protrusion of the RP-SMA antenna connector.

board dimensions
The dimensions for the LoRa MicroMod Function Board. (Click to enlarge)

M.2 Edge Connector and Screw Slots

Like other function and processor boards, there is a polarized M.2 edge connector, which provides a standardized electrical connection. The attachment points for the screws prevent users from connecting a processor board into a function board slot and vice-versa.

function board attachment points
The Micromod M.2 edge connector and screw slots on the LoRa Function Board. (Click to enlarge)

Power

There is a power status LED to help make sure that your LoRa function board is getting (5V) power. Power is provided through the (MicroMod) M.2 edge connector. The LoRa module is meant to run on 5V with 3.3V logic levels. A jumper is available on the back of the board to remove power to the LED for low-power applications (see the Jumpers section below).

power led
Power LED on the LoRa MicroMod Function Board. (Click to enlarge)

E19-915M30S LoRa Module

Note: The range verification was performed in a clear and open area (direct line-of-sight) with a 5dBi antenna gain, height of 2.5m, and data rate 0.3 kbps. Users results may vary.

The Chengdu Ebyte E19-915M30S RF transceiver module is a 1W 915MHz LoRa module, based on the SX1276 from Semtech. It is FCC, CE, and RoHS certified and has been tested up to a range of 10km by the manufacturer. PLease refer to the datasheet for more details.

  • Global license free ISM 915MHz band
  • 1W maximum transmission power
    • Software multi-level adjustable
  • 256Byte FIFO data buffer

SX1276

The E19-915M30S transceiver is based on the SX1276 chip from Semtech. Please refer to the datasheet for more details.

Part NumberSX1276
Frequency Range137 - 1020 MHz
Spreading Factor6 - 12
Bandwidth7.8 - 500 kHz
Effective Bitrate.018 - 37.5 kbps
Est. Sensitivity-111 to -148 dBm
CharacteristicDescription
Operating Voltage3.3 - 5.5 V
Current Consumption 630 mA (TX)) 23 mA (RX)) 3 µA (Sleep)
Operating Temperature-40 - 85 °C
Operating Humidity[1]10 - 90%
Communication InterfaceSPI (0 - 10 Mbps)
Logic Level3.3 V
Frequency Range900 - 931 MHz
Transmit Power28.5 - 30 dBm (max)
ModulationLoRa, FSK, GFSK, MSK, GMSK, OOK
Data Rate FSK: 1.2 - 300 kbps
LoRa: 0.018 - 37.5 kbps
Antenna Impedance50 &ohm;

LoRa module
The E19-915M30S RF transceiver module on the LoRa MicroMod Function Board. (Click to enlarge)

Pin Connections

Below is a table of the pin connections available on the E19-915M30S RF transceiver module. However, not all the pins listed are utilized by the LoRa function board (see the Function Board Pinout Table section below).

Pin #Pin NameI/O DirectionPin Description
1GNDGround
2DIO5Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
3DIO4Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
4DIO3Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
5DIO2Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
6DIO1Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
7DIO0Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
8RSTInputReset
9GNDGround
10GNDGround
11VCCInputPower supply: 4.75~5.5V (Ceramic filter capacitoris advised to add)
12SCKInputSPI - Clock Signal
13MISOOutputSPI - Data from Peripheral Device
14MOSIInputSPI - Data to Peripheral Device
15NSSInputSPI - Chip Select
16TXENInputRadio frequency switch control, make sure the TXEN pin is in high level, RXEN pin is in low level when transmitting.
17RXENInputRadio frequency switch control, make sure the RXEN pin is in high level, TXEN pin is in low level when receiving.
18GNDGround
19ANTAntenna
20GNDGround
21GNDGround
22GNDGround

MicroMod Edge Connector

The MicroMod M.2 edge connector provides a standardized interface for the pin connection of a function board.

function board edge connector
The Micromod M.2 edge connector on the LoRa Function Board. (Click to enlarge)

Function Board Pinout Table

The tables below outline the pin on the M2. edge connector and their functions.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
FunctionsBottom
Pin
   Top   
Pin
Functions
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
LoRa Func. Board PinFunctionBottom
Pin
   Top   
Pin
FunctionsLoRa Func. Board Pin
(Not Connected)-75GND
VIN74733.3V3.3V IN
VCC INVIN7271Power ENPower EN
-7069-
-6665-
-6463-
-6261F7
-6059F6LoRa DIO2
-5857F5LoRa DIO1
-5655F4LoRa RST
-5453F3LoRa RX EN
-5251F2PWMLoRa TX EN
-5049F1SPI_CS0LoRa NSS (CS)
-4847F0INTLoRa DIO0
-4645GND
-4443-
-4241-
EEPROM WP-4039GND
A03837USBHOST_D-
EEPROM A0EEPROM_A03635USBHOST_D+
EEPROM A1EEPROM_A13433GND
EEPROM A2EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423I2C_INT
2221I2C_SCLEEPROM SCL
2019I2C_SDAEEPROM SDA
UART_CTS1817
UART_RTS1615UART_RX
1413UART_TX
1211GND
109
87SPI_CIPOLoRa SDO
65SPI_COPILoRa SDI
43SPI_SCKLoRa SCK
21GND
Signal
Group
SignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT
I2S_OUT/CAM_MCLK
OAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN
I2S_IN/CAM_PCLK
IAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC
I2S_WS/PDM_DATA
I/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK
I2S_CLK/PDM_CLK
OAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General
Bus
G0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-
CAM_HSYNC
I/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+
CAM_VSYNC
I/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

EEPROM

There is an I2C serial EEPROM on the LoRa function board. It has been reserved for future use, but users have access to it. A jumper is available on the back of the board to write protect the EEPROM (see the Jumpers section below).

EEPROM
EEPROM on the LoRa MicroMod Function Board. (Click to enlarge)

RP-SMA Antenna Connector

Warning: Users should attach the antenna before powering their LoRa function board. Transmitting without an antenna connected may potentially damage the transceiver module.

The LoRa function board features a sturdy RP-SMA antenna connector for users to attach an antenna of their choice. While this antenna connector is fairly robust, users should not expect to leverage a lot of weight off of it.

The edge-type antenna connector allows for the threads to protrude just beyond the edge of the board. Along with the dimensions of the LoRa function board, this feature is designed so that the connection also extends past the edge of the main board that the function board interfaces with; and is therefore, well suited to be used with an enclosure.

Antenna Connector
RP-SMA antenna connector on the LoRa MicroMod Function Board. (Click to enlarge)

Note: Users who wish to use the u.FL connector can modify the position of this 0&ohm; resistor. Due to the size and position of the resistor, we only recommended for highly experience soldering experts attempt this modification. More novice users could potentially damage their LoRa function board if they attempt this modification.

antenna jumper
Antenna select jumper on the E19-915M30S RF transceiver module. (Click to enlarge)

Jumpers

There are three jumpers available on the LoRa function board.

LED Power

For more low power projects, the PWR jumper can be cut to remove power from the red power LED.

LED power jumper
LED power jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Current Measurement

For users who would like to measure the current going to LoRa function board, the MEAS jumper can be cut and used for measurements. This jumper is only connected to the 5V power, which is used by only the E19-915M30S RF transceiver module and power LED.

Current measurement jumper
Current measurement jumper on the LoRa MicroMod Function Board. (Click to enlarge)

EEPROM Write Protection

To permanently write protect the EEPROM on the LoRa function board, users can bridge the WP jumper.

EEPROM WP jumper
EEPROM WP jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Software Overview

Getting Started with MicroMod

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide. Also, make sure that the correct board definitions are installed in the Arduino IDE, for the associated processor board.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Programming

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the connected processor board. Depending on the processor board, users may need to install drivers (if they have not done so already). For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Arduino Library

Note: The example for this tutorial assumes users have the latest version of the Arduino IDE installed. 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:

Installing an Arduino Library

January 11, 2013

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.

SparkFun External EEPROM Arduino Library

We've written a library to easily get setup and read/write data on the EEPROM. You can install this library through the Arduino Library Manager. Search for SparkFun External EEPROM Arduino Library and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

For more details on this Arduino library and its use, please refer to the Serial EEPROM hookup guide:

Reading and Writing Serial EEPROMs

August 11, 2017

EEPROM is a great way to add extra memory to your microcontroller project. Wait 'til you see how easy it is to use!

RadioLib Arduino Library

The RadioLib library provides support for peer-to-peer RF communication with the 1W LoRa MicroMod Function Board. Users can install this library through the Arduino Library Manager. Search for RadioLib and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

Note: Peer-to-peer refers to direct RF communication using a specific modulation protocol (similar to a 2-way walkie talkie); and is not to be confused with a mesh network or LoRaWAN network integration.

For more details on this Arduino library, check out the Arduino reference page, the API refernce page, and GitHub repository. Additional specifics of the library that users may be interested in can be found in the links below:

Hadware Assembly

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Processor Board and Main Board

To get started users will need a compatible processor and main board. Insert the MicroMod processor board into the M.2 socket for the processor board at an angle, with its edge connector aligned to the matching slots.

Note: The dimensions of the processor board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw insert is spaced to only match the screw key of MicroMod processor boards.

When inserted properly, the processor board will rest at an angle:

MicroMod processor board inserted into the carrier board
Inserting a processor board into the M.2 socket. (Click to enlarge)

To secure the processor board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod processor board attached to the Qwiic carrier board
A processor board attached to the MicroMod Qwiic Carrier Board. (Click to enlarge)

Function Board and Main Board

Warning: The LoRa module is susceptible to electrostatic discharge. Therefore, it is recommended that users a static discharge strap, like the one included in the iFixit Pro Tech Toolkit.


Static discharge strap in the upper righthand corner. (Click to enlarge)

Users should also address any humidity and temperature concerns, when utilizing the LoRa function board.

Note: The dimensions of the function board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw inserts are spaced to only match the screw key of MicroMod function board.

Similarly to the processor board, insert the MicroMod function board into the M.2 socket for the function board at an angle, with its edge connector aligned to the matching slots.

When inserted properly, the function board will rest at an angle:

MicroMod function board inserted into the main board
Inserting a function board into the M.2 socket. (Click to enlarge)

To secure the function board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod function board attached to the main board
A function board attached to the MicroMod Main Board. (Click to enlarge)

Don't forget to attach the antenna for the LoRa function board. Transmitting or powering the LoRa module without an attached antenna has the potential to permanently damage the transceiver.

Fully assembled main board with processor board and function board
Fully assembled main board with processor board and function board. (Click to enlarge)

Main Board Example - Pin Connection Table

This table summarizes the pins utilized on the LoRa function board's MicroMod edge connector and their connections to the main board's processor pins; based on the slot that the LoRa function board is inserted to.

Function Board
Pin Name
MicroMod
Pin Number
I/O
Direction
Description Main Board's
Processor Pin
Slot 0Slot 1
VCC72Input Power supply: 4.75~5.5V
  • Power LED
  • Transceiver's Power
-
3.3V73Input Power supply: 3.3V
  • EEPROM's Power
  • Logc-level conversion
-
GND11-Ground-
Power Enable71InputControls the 3.3V power6866
SCK3InputSPI - Clock signal for transceiverSCK (57)
CIPO7OutputSPI - Data from transceiverCIPO (59)
COPI5InputSPI - Data to transceiverCOPI (61)
NSS49 (F1)InputSPI - Chip select for transceiverCS0 (55)CS1 (70)
RST55 (F4)InputResets transceiverG1 (42)G6 (71)
DIO047 (F0) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).D0 (10)D1 (18)
DIO157 (F5) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G2 (44)G7 (69)
DIO259 (F6) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G3 (46)G8 (62)
TXEN51 (F2)InputTransceiver's RF control switch: The TXEN pin is in high level, RXEN pin is in low level when transmitting.PWM0 (32)PWM1 (47)
RXEN53 (F3)InputTransceiver's RF control switch: The RXEN pin is in high level, TXEN pin is in low level when receiving.G0 (40)G5 (73)
SCL21InputI2C - Clock signal for EEPROMSCL (14)
SDA19 Input
Output
I2C - Data signal for EEPROMSDA (12)
EEPROM WP40InputControls the write protection pin for the EEPROM. Pull low to enable.-
EEPROM A06InputControls EEPROM's I2C address configuration.-
EEPROM A14InputControls EEPROM's I2C address configuration.-
EEPROM A22InputControls EEPROM's I2C address configuration.-

Programming

To program the processor board utilized on the Main Board; connect the board to a computer with a USB-C cable. Depending on the processor board, users may need to install drivers (if they have not done so already).

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the selected processor board. For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Example

Peer-to-Peer Communication

Note: The example codes assume that the LoRa function board is inserted into the 0function board slot of the main board.

The example codes below, allow users to communicate between two LoRa function boards. Simply download, extract the files, and upload the code the main board with associated processor and function boards.

Additional examples have also been provided for users who would like to use their expLoRable (LoRa Thing Plus) board to communicate with a LoRa function board.

The example codes were tested under the following parameters:
  • Arduino IDE version: 1.8.16
    • If not using the Teensy - Windows App Store version 1.8.51.0
  • RadioLib Library version: 4.6.0
  • MicroMod Processor Boards and Arduino Cores:
    ProcessorBoard Definition
    RP2040Arduino Mbed OS RP2040 Boards version: 2.5.2
    ESP32esp32 version: 2.0.0
    STM32SparkFun STM32 Boards version: 2.0.0
    ArtemisSparkFun Apollo3 Boards version: 2.1.1
    SAMD51SparkFun SAMD Boards (dependency Arduino SAMD Boards version 1.8.1) version: 1.8.5
    • Requires - Arduino SAMD Boards (32-bit ARM Cortex-M0+) version: 1.8.11
    nRF52840[DEPRECATED - Please install standalone packages] Arduino Mbed OS Boards version: 1.3.1
    TeensyTeensyduino version: 1.55

Once uploaded, users can open the serial monitor to view the progress of the data transmission or reception. When using the RP2040 processor board, the example code will wait until the Serial Monitor is opened to execute the code and transmit/receive data.

peer-to-peer data transmission example
An example of the data transmission between an expLoRaBLE board and the LoRa MicroMod Function Board in the Serial Monitor. (Click to enlarge)

Code Breakdown

In order to get the built-in example for the RadioLib library working, a few changes needed to be made. Below, is a short explanation of the modifications made to the example code that we provide (see above), to include compatibility with all the available processor boards.

CS Pin Definition

The SPI library for the Arduino IDE, by default expects the chip select pin to be defined as PIN_SPI_SS. However, this pin definition is different for the ESP32 and Artemis (Apollo3) Arduino cores. Therefore, the code below was inserted to allow the code to compile for all the various processor boards.

language:c
// Redefine CS Pin Name
// SPI_CS0:     ESP32
// SS:          ESP32, nRF, RP2040
// SPI_CS:      Artemis
// PIN_SPI_SS:  STM32, SAMD51, nRF, RP2040

#ifndef PIN_SPI_SS
    // For Artemis
    #ifdef SS
        #define PIN_SPI_SS SPI_CS
    #endif
    // For ESP32
    #ifdef SPI_CS0
        #define PIN_SPI_SS SS
    #endif
#endif
MicroMod Pin Names

Unfortunately, for the RP2040 MicroMod processor board hasn't been included in the MbedOS Arduino core; current progress is on hold(please refer to this issue in the GitHub repository). However, with the modifications below, the RP2040 Pico board definition can be used.

By using the RP2040 Pico board definition, the generic MicroMod processor board's pin names obviously can't be used. Therefore, all the pins must be declared by their GPIO pin numbers. In addition, the default pin connections for the SPI bus on the RP2040 MicroMod processor board differs from the RP2040 Pico. To accommodate for the different pin connections, a custom SPI object was created and passed into the library.

language:c
// SX1276 pin connections:
//       | SLOT 0 | SLOT 1 |
//==========================
// cs    |   CS0  |   CS1  |
// dio0  |   D0   |   D1   |
// dio1  |   G2   |   G7   |
// dio2  |   G3   |   G8   |
// rst   |   G1   |   G6   |
// tx_en |  PWM0  |  PWM1  |
// rx_en |   G0   |   G5   |

#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // MM RP2040 Processor Board (Using RP2040 Pico board definition)
    int pin_cs = 21;
    int pin_dio0 = 6;
    int pin_tx_enable = 13;
    int pin_rx_enable = 16;
    int pin_nrst = 17;
    int pin_dio1 = 18;

    // Redefine SPI pins
    int miso = 20;
    int mosi = 23;
    int sck = 22;

    // Custom SPI object
    MbedSPI SPI_mm(miso, mosi, sck);

    SX1276 radio = new Module(pin_cs, pin_dio0, pin_nrst, pin_dio1, SPI_mm);

#else

Similarly to the RP2040, the Teensy MicroMod processor board definition doesn't include the generic MicroMod processor board pin names yet (we are currently working on this update). Therefore, all the pins must be declared by their pin numbers.

language:c
    #if defined(ARDUINO_TEENSY_MICROMOD)
        // MM Teensy Processor Board
        int pin_cs = 10;
        int pin_dio0 = 4;
        int pin_tx_enable = 3;
        int pin_rx_enable = 40;
        int pin_nrst = 41;
        int pin_dio1 = 42;

    #else
RP2040 Special Consideration

As mentioned above, a custom SPI object was created and passed into the library for the RP2040 MicroMod processor board. However, the library doesn't initialize the SPI bus when it is passed in. Therefore, the setup() loop includes a modification to start the SPI bus operation.

In our testing, the RP2040 MicroMod processor board had issues with the printouts on the serial port. Adding a while() statement to wait for the serial port to be accessed by the Serial Monitor, resolved the issue.

language:c
#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // Wait for serial monitor/port to open
    while (!Serial){
        ; // wait for serial port
    }

    // Start SPI bus
    SPI_mm.begin();
#endif
Enabling the STM32 Serial Port

When uploading to the provided example code (see above) to the STM32 MicroMod processor board, users will need to enable the serial port on the processor board. Otherwise, when the Serial Monitor is opened, nothing will appear. The following settings must be used in the in the Tools drop down menu:

STM32 serial port configuration
The STM32 MicroMod processor board settings in the Tools drop-down menu to enable the microcontroller's serial port. (Click to enlarge)

Resources and Going Further

For more information on the SparkFun 1W LoRa Function Board, check out the links below:

Hardware Documentation:

MicroMod Documentation:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

MicroMod Artemis Processor Board Hookup Guide

Get started with the Artemis MicroMod Processor Board in this tutorial!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!

SparkFun MicroMod Input and Display Carrier Board Hookup Guide

A short Hookup Guide to get started with the SparkFun MicroMod Input and Display Carrier Board

MicroMod Machine Learning Carrier Board Hookup Guide

Get hacking with this tutorial on our Machine Learning Carrier Board!

Qwiic Carrier Board Hookup Guide

The Qwiic carrier board is the latest way to rapid prototype with the included M.2 socket to swap processor boards and Qwiic connectors to easily connect I2C devices.

MicroMod Update Tool Hookup Guide

Follow this guide to learn how to use the MicroMod Update Tool to interact directly with the UART on the MicroMod Asset Tracker's SARA-R5. Using this board you can talk directly to the module using u-blox's m-center software as well as update the firmware using EasyFlash.

MicroMod Asset Tracker Carrier Board Hookup Guide

Get started with the SparkFun MicroMod Asset Tracker Carrier Board following this Hookup Guide. The Asset Tracker uses the u-blox SARA-R510M8S LTE-M / NB-IoT module to provide a host of data communication options.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

ARGOS (ARTIC R2) Satellite Communication Guide

$
0
0

ARGOS (ARTIC R2) Satellite Communication Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2123

Introduction

Looking for a satellite communication board for your next project? We've got three to pick from!

ARGOS Satellite Transceiver Shield - ARTIC R2

ARGOS Satellite Transceiver Shield - ARTIC R2

SPX-17236
$199.95
smôl ARTIC R2

smôl ARTIC R2

SPX-18618
$199.95
SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SparkFun IOTA - Satellite Communication Module (ARTIC R2)

SPX-17984
$199.95

This guide provides background information about the ARGOS satellite system and the ARTIC R2 satellite transceiver chipset. If you are looking for specific information about our three boards, you can open their individual hookup guides by clicking on the buttons below:

The ARGOS Satellite System

Pictured is the ANGELS satellite
Image credits: Copyright David Ducros


The ARGOS satellite system has been around for quite a while. It was created in 1978 by the French Space Agency (CNES), the National Aeronautics and Space Administration (NASA) and the National Oceanic and Atmospheric Administration (NOAA), originally as a scientific tool for collecting and relaying meteorological and oceanographic data around the world. Today, ARGOS is revolutionising satellite communication, adding a constellation of 25 nanosatellites to complement the 7 traditional satellites carrying ARGOS instrumentation. The first of these, ANGELS, is already in operation and SparkFun were among the first users to transmit data to ANGELS in October 2020. When the constellation is complete, there will be a maximum of 10-15 minutes between satellite passes.

ARGOS uses a constellation of Low Earth Orbit (LEO), polar-orbiting satellites to provide worldwide two-way data communication. A global network of terrestrial receiving stations and two data processing centers provide support for continuous, round-the-clock operation.

ARGOS can determine the location of a transmitter using Doppler location. By simply transmitting a unique 28-bit serial number (Platform ID), ARGOS can determine where the transmitter is located without needing GPS / GNSS. This is a big deal since it means the data transmissions can be kept very short, dramatically extending your transmitter's battery life. The more times you transmit the better the positioning accuracy becomes, but ARGOS can estimate your position from a single transmission.

ARGOS is also optimized for low power operation. ARGOS transmission (uplink) is centered on 401MHz, towards the bottom end of the Ultra High Frequency (UHF) radio band. The downlink from the satellites is centered on 466MHz. The receivers on the satellites are very sensitive, which means that you can transmit using much lower power compared to other satellite systems, again dramatically extending your transmitter's battery life. We have seen the satellites reliably receive messages with receive signal strengths as low as -140dBm!

The Satellites

Here are the details of the eight satellites carrying ARGOS instrumentation:

NameDesignationAlternate designationLaunchedInstrumentation
NOAA-KNKNOAA-151998ARGOS-2
NOAA-NNNNOAA-182005ARGOS-2
NOAA-PNP (or NN')NOAA-192009ARGOS-3
METOP-AMA2006ARGOS-3
METOP-BMB2012ARGOS-3
METOP-CMC2018ARGOS-3
SARALSR2013ARGOS-3
ANGELSA12019ARGOS-4

The new kid on the block is ANGELS - Argos NEO Generic Economic Light Satellites. Launched in December 2019, ANGELS A1 became operational for ARGOS data in October 2020. ANGELS is a 12U nanosatellite weighing in at only 20kg! ANGELS is important as it supports ARGOS-4, which supports even lower signal strengths further extending your transmitter's battery life. The ANGELS nanosatellite format will be used for the next 25 ARGOS satellites.

The satellite instrumentation is backwards-compatible. ANGELS supports ARGOS 2, 3 and 4. The METOP satellites support ARGOS 2 and 3.

Who can use ARGOS?

At the time of writing, the ARGOS system is currently limited to programs which are related in some way or other to environmental protection, awareness or study, or to protecting human life.

If your project qualifies, then the ARGOS satellite system and our ARTIC R2 products are the perfect solution. The ARGOS instrumentation on board the satellites is extremely sensitive, meaning that your equipment can transmit ARGOS-4 VLD at 100 mW and even lower, extending your battery life considerably. The power draw of our ARTIC R2 products is much lower than equivalent Iridium or Swarm products.

However, the environmental limitations for ARGOS are about to change! Kinéis, heir of the ARGOS System, are in the process of testing a new frequency band between 399.9MHz and 400.05MHz on ANGELS in preparation for the launch of the new constellation of 25 nanosatellites. This new MSS (Mobile Satellite Service) band is not restricted to environmental programmes. Kinéis will become a true Internet-of-Things communication provider - open to all!

The new 399.9MHz to 400.05MHz band is subject to national certification, and so may not be available in all countries.

It is an exciting time for satellite communication. You may enjoy the following news links:

How much does it cost?

The costs for ARGOS are different if you are a Regular, Commercial or Individual User or a Governmental or Institutional (Educational) User.

There is a monthly fee per active platform, plus a daily fee for any day on which you transmit. However, the daily fee is capped allowing unlimited monthly usage for a competitive fixed fee.

You can access your data via ARGOS Web for free, or choose to pay an additional fee to receive your data via email, FTP or SMS.

ARTIC R2

The ARTIC R2 is an integrated, low-power, small-size ARGOS 2/3/4 single chip transceiver. ARTIC implements a message based wireless interface. For satellite uplink communication, ARTIC will encode, modulate and transmit provided user messages. For downlink communication, ARTIC will lock to the downstream, demodulate and decode and extract the satellite messages. The ARTIC can transmit signals in frequency bands around 401MHz and receive signals in the bands around 466MHz, in accordance with the ARGOS satellite system specifications.

The ARTIC R2 supports:

  • Uplink:
    • ARGOS 2/3/4
  • Downlink:
    • ARGOS 3/4

ARGOS Message Formats

The table below summarizes the properties of each ARGOS message format as supported by the ARTIC R2:

Message FormatModeData Rate

(bits/sec) #

Min Length

(bits) *

Max Length

(bits) *

Notes
A2ARGOS-240052276
A3ARGOS-340052276
ZEARGOS-34002828
A3 HDARGOS-34800604636HD = High Data rate
A4 HDARGOS-448009924960HD = High Data rate
A4 MDARGOS-41200480960MD = Medium Data rate
A4 VLDARGOS-42002884VLD = Very Low Data rate

# The data bit rate quoted in the table is the bit rate before convolutional encoding (where used)

* The message lengths quoted in the table include the 28-bit Platform ID but exclude the message length identifier or any required tail bits. The ARTIC R2 always calculates and transmits the FEC for A3 HD and the FCS for A4 HD/MD. The quoted maximum message lengths exclude the FEC/FCS.

The ARGOS-4 VLD mode is exciting since the uplink can use much lower transmit power (100mW or even less) compared to the other modes. The message are short, including only the 28-bit Platform ID, or the Platform ID plus 56 bits of user data. However, 56-bits is enough to encode GNSS position (latitude and longitude) to 4 decimal places and accurate to &pm;5.55m at the equator.

ARGOS-3 ZE and ARGOS-4 VLD (Short) messages contain only the 28-bit Platform ID. ARGOS is still able to calculate the position of the transmitter using Doppler location.

If you want to dig further into the message formats and encoding schemes, they are defined in the CNES Physical Layer Requirements:

Message FormatCNES Physical Layer Requirements
A2AS3-SP-516-2098-CNES
A3 + ZEAS3-SP-516-274-CNES
A3 HDAS3-SP-516-273-CNES
A4 HD/MDA4-SS-TER-SP-0078-CNES
A4 VLDA4-SS-TER-SP-0079-CNES

Don't Panic! Our ARGOS ARTIC R2 Arduino Library does all of the message encoding for you!

Satellite Pass Prediction

There are currently only seven satellites carrying ARGOS instrumentation. This means that there are frequently times when there are no satellites overhead and that you need to wait until the next satellite rises if you want to avoid wasted transmissions.

Depending on the capacity of your battery, how complex you want your tracker to be, and where you are transmitting from, you may decide that simply hoping there is a satellite overhead when you transmit is the best way forward. However, being able to predict when the next satellite will rise is of course very beneficial.

There are two main ways to do this:

ARGOS Web

When you log into your ARGOS Web account, you can use the Satellite pass prediction tool to generate a table or spreadsheet of the times of the satellite passes for the coming days. You can generate the table based on a chosen latitude and longitude, or based on the last known location for an individual ARGOS ID.

The Latitude and Longitude are entered in degrees. Longitudes west of the meridian are entered as negative numbers. The prediction tool asks for the altitude (in km) too. You also need to enter the minimum satellite elevation: 5 degrees is a good minimum if you have a clear view to the horizon; for urban or forested areas a higher elevation is sensible.

Pictured is the ARGOS Web satellite pass prediction tool

Click on Simulate, and the satellite passes are calculated and displayed:

Pictured are the satellite pass predictions

By default, the table lists the satellite passes in date/time order, but you can choose to list them by satellite, middle (highest) elevation, pass duration etc..

The Middle date/time is the date and time when the satellite will be at its highest elevation - the peak of its pass. The time is in UTC (Universal Time Coordinate), you will need to add/subtract your time zone to convert to local time.

The Middle elevation indicates how high the satellite will be in the sky at the peak of the pass. Higher passes are of course better.

The azimuth data shows the heading where the satellite will rise, peak and set. The azimuth is relative to geographic north, not magnetic north. If your view of the sky is obstructed in a particular direction, you may choose to ignore passes where the middle elevation is low in that direction.

The Duration is useful. It indicates how long the satellite pass is from rise to set. Longer durations will allow you to attempt more transmissions. ARGOS transmissions are normally made 90 seconds apart (the "repetition interval") with a mandatory &pm;10% jitter or dither on the interval. On a typical pass, there is usually time for five transmissions. You should not attempt to transmit more frequently than your repetition interval.


Don't Panic! Our ARGOS ARTIC R2 Arduino Library examples handle the repetition interval and jitter/dither for you!

You will notice that - for 55 degrees north - there is an interval ('dead zone') from 12:10 until 17:12 when there are no satellites overhead. That is normal at the moment. When the ANGELS constellation is complete, there will be a maximum of 10-15 minutes between satellite passes.

You can click on the Export button to export the data in a variety of formats.

Pass Prediction Code

Being able to use ARGOS Web to predict the satellite passes is useful, but what if you want your tracker to be able to predict the passes for itself? Never fear! Our ARGOS ARTIC R2 comes to the rescue! Our library contains a pass prediction calculator based on code kindly provided by CLS. If you have included a GPS / GNSS receiver in your tracker project, you can use the latitude, longitude and time to calculate when the next satellite pass will take place. Several of the library examples include pass prediction.

If your tracker will be confined to a particular geographical region, you may not need a GNSS receiver. Knowing the time alone would be enough to predict the next pass.

AOP (Adapted Orbit Parameters)

The pass prediction code also needs to know the orbit parameters for the satellites in order to predict each pass. You will see the parameters included at the start of the "WithPrediciton" examples:

language:c
const char AOP[] =      " MA A 5 3 0 2020 10  1 22  7 29  7195.569  98.5114  336.036  -25.341  101.3592   0.00 MB 9 3 0 0 2020 10  1 23 21 58  7195.654  98.7194  331.991  -25.340  101.3604   0.00 MC B 7 3 0 2020 10  1 22 34 23  7195.569  98.6883  344.217  -25.340  101.3587   0.00 15 5 0 0 0 2020 10  1 22 44 11  7180.495  98.7089  308.255  -25.259  101.0408   0.00 18 8 0 0 0 2020 10  1 21 50 32  7225.981  99.0331  354.556  -25.498  102.0000  -0.79 19 C 6 0 0 2020 10  1 22  7  6  7226.365  99.1946  301.174  -25.499  102.0077  -0.54 SR D 4 3 0 2020 10  1 22 33 38  7160.233  98.5416  110.362  -25.154  100.6146  -0.12";

The orbits of the satellites do change or drift over time. The AOP data remains valid for up to six months, but Kinéis recommend updating every 2 to 3 months.

You can download the AOP data from ARGOS Web by clicking the Download satellite AOP button on the satellite pass prediction page. You can then copy and paste the AOP data directly into your code.

Alternately, you can download the orbit parameters in JSON format. Click on the System button and then click on the Satellite Allcast Info option. You will then see an option to download the allcast data.

Pictured is the ARGOS Web system button

Pictured is the allcast option

Example 9 in our ARGOS ARTIC R2 library demonstrates how to use the JSON format data. It is heavy on RAM use, so we do not recommend it for Arduino platforms with limited RAM.

The satellites themselves also broadcast their AOP data, so your tracker can update the orbit parameters in the field without needing access to ARGOS Web. Example 7 in our ARGOS ARTIC R2 library demonstrates how to download the data and record it in the format needed by the pass prediction code.

Encoding Latitude and Longitude

We normally think of GNSS Latitude and Longitude as both needing 32-bit storage, either as an integer or a floating point value. So, is it possible to send both Latitude and Longitude in the 56-bits available in a single ARGOS-4 VLD (Long) message? Well, yes, of course it is! But you have to be a little bit crafty about how you do it.


Thanks! The following encoding scheme was recommended by Lucas Nicolle at CLS.

If we want to encode latitude and longitude to four decimal places, giving us an accuracy of &pm;5.55m at the equator:

  • Longitude is in the range &pm; 0.0000 to 180.0000 degrees
    • If we allocate one bit for the sign (plus/minus or east/west)
    • And if we multiply the longitude by 10000 and turn it into an integer
    • We need 21 binary bits to encode 180000010 (21 bits can encode values up to 221 - 1 = 2097151)
    • Including the sign, we need 22 binary bits to encode the longitude
  • Latitude is in the range &pm; 0.0000 to 90.0000 degrees
    • If we allocate one bit for the sign (plus/minus or north/south)
    • And if we multiply the latitude by 10000 and turn it into an integer
    • We need 20 binary bits to encode 90000010 (20 bits can encode values up to 220 - 1 = 1048575)
    • Including the sign, we need 21 binary bits to encode the latitude

We use that same format in our ARGOS ARTIC R2 Arduino Library examples. If you ask CLS or Woods Hole Group to apply the SPARKFUN_GPS template to your account on ARGOS Web, the latitude, longitude, south and west fields will appear in your data automatically:

Pictured are the latitude longitude south and west fields

Now, what should we do with those left-over 13 bits!? We'll leave that up to you. You might want to encode altitude as m above sea level. 13 bits would allow you to encode altitudes up to 8191m. For high altitude, you might want to encode altitude as 10's of m?

Platform ID

Each ARGOS transmitter has a unique Platform ID number. When you buy an ARGOS ARTIC R2 board from SparkFun, you will receive a card with it which shows:

  • Your decimal Platform ID
    • This is used and displayed in ARGOS Web
  • The 28-bit hexadecimal Platform ID
    • This is programmed into the ARTIC R2's flash memory and used in all transmissions
  • The transmission repetition interval
    • The default interval is 90 seconds

You will need to ask CLS / Woods Hole Group to add the Platform ID to your account in order to see your data.

You will need to seek special permission from CLS / Woods Hole Group to use a repetition interval shorter than 90 seconds.

We were instructed by CLS to program the (hexadecimal) Platform ID into flash memory, so that the wrong ID could not be entered into code by accident. (Entering the wrong number has happened - a polar bear that was being tracked via ARGOS suddenly appeared to be in Africa!)


If you have one of our very first ARGOS ARTIC R2 Transceiver Shields, it may not have the Platform ID programmed into flash memory. For those boards, and only those boards, it is necessary to use v1.0.9 of the ARGOS ARTIC R2 Arduino Library and enter the HEXADECIMAL Platform ID into your code. Please see the Shield Hookup Guide for more details.

Resources and Going Further

ARGOS Resources:

Arduino Library:

SparkFun Hookup Guides:

Credits


Image Credits: The image of the ANGELS satellite is Copyright David Ducross.


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

MicroMod GNSS Carrier Board (ZED-F9P) Hookup Guide

$
0
0

MicroMod GNSS Carrier Board (ZED-F9P) Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2187

Introduction

The SparkFun MicroMod GNSS Carrier Board (ZED-F9P) combines high-precision GPS and the flexibility of MicroMod onto one board. Utilizing u-blox's ZED-F9P module, MicroMod GNSS Carrier Board is capable of 10mm 3 dimensional accuracy. Yes, you read that right, these boards can output your X, Y, and Z location that is roughly the width of your fingernail. With great power comes a few requirements: high precision GPS requires a clear view of the sky (sorry, no indoor location) and a stream of correction data from an RTCM source. We’ll get into this more in a later section but as long as you have two ZED-F9P breakout boards, or access to an online correction source, your ZED-F9P can output lat, long, and altitude with centimeter grade accuracy.

SparkFun MicroMod GNSS Carrier Board (ZED-F9P)

SparkFun MicroMod GNSS Carrier Board (ZED-F9P)

GPS-17722
$324.95

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.

MicroMod Processor Board

You'll need a Processor Board with the MicroMod GNSS Carrier Board.

SparkFun MicroMod ESP32 Processor

SparkFun MicroMod ESP32 Processor

WRL-16781
$16.95
SparkFun MicroMod Teensy Processor

SparkFun MicroMod Teensy Processor

DEV-16402
$19.95
2
SparkFun MicroMod SAMD51 Processor

SparkFun MicroMod SAMD51 Processor

DEV-16791
$18.95
SparkFun MicroMod Artemis Processor

SparkFun MicroMod Artemis Processor

DEV-16401
$14.95

Antenna

We recommend using a GNSS multi-band magnetic mount antenna for the full RF reception. The length of the antenna cable was also useful in mounting it.

GNSS Multi-Band Magnetic Mount Antenna - 5m (SMA)

GNSS Multi-Band Magnetic Mount Antenna - 5m (SMA)

GPS-15192
$67.95
1
GNSS Multi-Band L1/L2 Surveying Antenna (TNC) - TOP106

GNSS Multi-Band L1/L2 Surveying Antenna (TNC) - TOP106

GPS-17751
$124.95
7
GNSS  Multi-Band L1/L2 Helical Antenna (SMA) BT-560

GNSS Multi-Band L1/L2 Helical Antenna (SMA) BT-560

GPS-17383
$84.95
1
MagmaX2 Active Multiband GNSS Magnetic Mount Antenna - AA.200

MagmaX2 Active Multiband GNSS Magnetic Mount Antenna - AA.200

GPS-17108
$77.95

GPS Antenna Accessories

You can use the GPS antenna ground plate to improve your GPS antenna's performance. If you are using the GNSS Multi-Band L1/L2 Surveying Antenna (TNC) - TOP106, you'll need to grab the interface cable.

Interface Cable - SMA Male to TNC Male (300mm)

Interface Cable - SMA Male to TNC Male (300mm)

CAB-17833
$9.95
GPS Antenna Ground Plate

GPS Antenna Ground Plate

GPS-17519
$6.50

Accessories

At a minimum, you will need a USB C cable to power and program the boards. Depending on your application, you may want to grab a Qwiic cable to connect a Qwiic-enabled device.

SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

KIT-15081
$7.95
13
USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3

Tools

You will need a screw driver to tighten the screw between the processor board and carrier board.

SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Suggested Reading

If you aren't familiar with the MicroMod ecosystem, we recommend reading here for an overview. We recommend reading here for an overview if you decide to take advantage of the Qwiic connector.

MicroMod LogoQwiic Connect System
MicroMod EcosystemQwiic Connect System

If you aren’t familiar with the following concepts, we recommend checking out these tutorials before continuing.

I2C

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

Getting Started with U-Center for u-blox

Learn the tips and tricks to use the u-blox software tool to configure your GPS receiver.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

MicroMod ESP32 Processor Board Hookup Guide

A short hookup guide to get started with the SparkFun MicroMod ESP32 Processor Board.

This tutorial is based on the GPS-RTK2's ZED-F9K. Make sure to check out the breakout boards for more information on GPS-RTK. Be sure to checkout our What is GPS RTK? tutorial.

What is GPS RTK?

September 14, 2018

Learn about the latest generation of GPS and GNSS receivers to get 14mm positional accuracy!

GPS-RTK Hookup Guide

September 13, 2018

Find out where you are! Use this easy hook-up guide to get up and running with the SparkFun high precision GPS-RTK NEO-M8P-2 breakout board.

GPS-RTK2 Hookup Guide

January 14, 2019

Get precision down to the diameter of a dime with the new ZED-F9P from u-blox.

Hardware Overview

One of the key differentiators between the ZED-F9P and almost all other low-cost RTK solutions is the ZED-F9P is capable of receiving both L1 and L2 bands.

L1 and L2 GNSS reception on the ZED-F9P

MicroMod Processor Board Socket

The MicroMod GNSS Carrier Board (ZED-F9P) includes a location for a MicroMod Processor Board. Here is where your chosen Processor Board will reside.

alt text

MicroMod Processor General Pins

Next to the MicroMod Processor Board are extra pins if you need to use a digital or analog pin.

alt text

Power

There are a few ways to power the board. Voltage is regulated down to 3.3V with the AP7361 voltage regulator. The square IC next to the USB C labeled as processor is where you will find the AP7361.

  • USB C Connector - You can connect a USB Type C cable from your computer's USB port to the board through either of the USB Type C connectors labeled as u-center and processor. There are protection diodes connected to the voltage lines so you can connect two USB cables at the same time to power the board. The AP7361 voltage regulator will regulate the 5V from the USB port down to 3.3V for the system voltage.
  • VIN - If you decide to connect to the VIN pin, we recommend a voltage between 3.3V to 6.0V. The AP7361 voltage regulator will regulate the voltage down to 3.3V for the system voltage.
  • 3V3 - If you decide to power the board through the 3.3V pin, you could connect a regulated 3.3V to this pin. Otherwise, you could use this to power any peripherals attached to the board.
  • Qwiic Connector - The Qwiic connector connects to 3.3V and GND to power any Qwiic-enabled devices. Depending on your application, you could connect a regulated 3.3V through this port as well.
  • GND - Of course, you'll need to connect the ground plane to your power source. This pin is available should you decide to power the board through the any of the PTH pins.

alt text

Backup Batteries

There are two built-in backup batteries (ML414H) on the board. The backup battery has a 1mAh capacity and requires 20 minute to charge. The battery near the SMA connector is for the Processor Board's RTC and helps keep the RTC running when the external power is removed. Depending on the processor, it may not be connected.

alt text

The other one that is closest to the USB C connector labeled as u-center is for the ZED-F9P module. The rechargeable battery maintains the battery backed RAM (BBR) on the GNSS module. This allows for much faster position locks (a.k.a. hot start). The BBR is also used for module configuration retention. The battery is automatically trickle charged when power is applied and should maintain settings and GNSS orbit data for up to two weeks without power.

Reset and Boot Buttons

The reset button will reset the processor. The boot button will put the processor into a special boot mode. Depending on the processor board, this boot pin may not be connected.

alt text

SWD Programming Pins

For advanced users, we broke out the SWD programming pins to connect to a MicroMod Processor Board. Note that this is not populated so you will need a compatible header and compatible JTAG programmer to connect.

alt text

Communication Ports

The ZED-F9P is unique in that it has five communication ports which are all active simultaneously. You can read NMEA data over I2C while you send configuration commands over the UART and vice/versa. The only limit is that the SPI pins are mapped onto the I2C and UART pins so it’s either SPI or I2C+UART. The USB port is available at all times.

alt text

USB

As stated earlier, there are two USB ports: one for u-center and another for processor. The USB C connector labeled as u-center makes it easy to connect the ZED-F9P to u-center for configuration and quick viewing of NMEA sentences. It is also possible to connect a Raspberry Pi or other single board computer over USB. The ZED-F9P enumerates as a serial COM port and it is a separate serial port from the UART interface. See Getting Started with U-Center for more information about getting the USB port to be a serial COM port. The USB connector labeled as processor is available to program your MicroMod Processor Board. Make sure to check your respective Processor Board to install the USB-to-serial drivers.

alt text

A 3.3V regulator is provided to regulate the 5V USB down to 3.3V the module requires. External 5V can be applied or a direct feed of 3.3V can be provided. Note that if you’re provide the board with 3.3V directly it should be a clean supply with minimal noise (less than 50mV VPP ripple is ideal for precision locating).

The 3.3V regulator is capable of sourcing 600mA from a 5V input and the USB C connection is capable of sourcing 2A.

I2C (a.k.a DDC)

The u-blox ZED-F9P has a “DDC” port which is really just an I2C port (without all the fuss of trademark issues). These pins are shared with the SPI pins. By default, the I2C pins are enabled. Be sure the SPI jumper on the rear of the board is open. The MicroMod GNSS Carrier Board also includes one Qwiic connector to make daisy chaining this GPS receiver with a large variety of I2C devices. Checkout Qwiic for your next project.

alt text

UART/Serial

The classic serial pins are available on the ZED-F9P but are shared with the SPI pins. By default, the UART pins are enabled. Be sure the SPI jumper on the rear of the board is open.

  • TXO/SDO = TX out from ZED-F9P
  • RXI/SDI = RX into ZED-F9P
Top ViewBottom View

There is a second serial port (UART2) available on the ZED-F9P that is primarily used for RTCM3 correction data. By default, this port will automatically receive and parse incoming RTCM3 strings enabling RTK mode on the board. In addition to the TXO2/RXI2 pins we have added an additional ‘RTCM Correction’ port where we arranged the pins to match the industry standard serial connection (aka the 'FTDI' pinout). While we label this as "Bluetooth" on the back of the board, you can still connect a serial-to-USB converter to this port. This pinout is compatible with our Bluetooth Mate and Serial Basic so you can send RTCM correction data from a cell phone or computer. Note that RTCM3 data can also be sent over I2C, UART1, SPI, or USB if desired.

The RTCM correction port (UART2) defaults to 38400bps serial but can be configured via software commands (checkout our Arduino library) or over USB using u-center. Keep in mind our Bluetooth Mate defaults to 115200bps. If you plan to use Bluetooth for correction data (we found it to be easiest), we recommend you increase this port speed to 115200bps using u-center. Additionally, but less often needed, the UART2 can be configured for NMEA output. In general, we don’t use UART2 for anything but RTCM correction data, so we recommend leaving the in/out protocols as RTCM.

UART2 configuration inside u-center

If you’ve got the ZED-F9P setup for base station mode (also called survey-in mode) the UART2 will output RTCM3 correction data. This means you can connect a radio or wired link to UART2 and the board will automatically send just RTCM bytes over the link (no NMEA data taking up bandwidth).

SPI

The ZED-F9P can also be configured for SPI communication. By default, the SPI port is disabled. To enable SPI close the SPI jumper on the rear of the board. Closing this jumper will disable the UART1 and I2C interfaces (UART2 will continue to operate as normal).

alt text

Antenna

The ZED-F9P requires a good quality GPS or GNSS (preferred) antenna. For a secure connection, we include an SMA female connector. To make the most out of the ZED-F9P, you'll need a multi-band GNSS antenna and an SMA male connector to mate.

alt text

Low-cost magnetic GPS/GNSS antennas can be used (checkout the u-blox white paper) but a 4” / 10cm metal disc is required to be placed under the antenna as a metal ground plane.

GPS Antenna with Ground Plane

LEDs

The board includes five status LEDs as indicated in the image below.

  • PPS: The pulse per second LED will illuminate each second once a position lock has been achieved.
  • GEO: The GEO LED can be configured to turn on/off for geofencing applications.
  • RTK: The RTK LED will be illuminated constantly upon power up. Once RTCM data has been successfully received it will begin to blink. This is a good way to see if the ZED-F9P is getting RTCM from various sources. Once an RTK fix is obtained, the LED will turn off.
  • VIN: The VIN LED will illuminate when there is voltage applied to the VIN pin or over USB.
  • 3V3: The power LED will illuminate when 3.3V is activated either over USB or via the Qwiic bus.

alt text

Jumpers

There are jumpers located throughout the board. Below are the jumpers on the top side of the board.

  • Bypass (BYP): By default, the BYP is left open. Adding a solder jumper bypasses the 2A resettable fuse on the back of the board should you decide to pull more than 2A from your USB source. Proceed with caution should you decide to bypass the jumper.
  • Enable (EN): By default, the EN jumper is left open. This jumper is connected to a processor board's GPIO pin. The processor board can control the ATP's voltage regulator. Depending on the processor, this may not be connected.
  • Current Measurement (MEAS): By default, the MEAS is closed. Cutting the jumper and soldering to the PTH pads will allows you to insert a current meter and precisely monitor the how much current your application is consuming.

alt text

Below are the jumpers on the bottom side of the board.

  • 3V3 LED: By default, the 3V3 LED is closed. Cutting this jumper will disable the LED when there is 3.3V.
  • VIN LED: By default, the VIN LED is closed. Cutting this jumper will disable the LED whenever there is an input voltage.
  • RTK: By default, the RTK is closed. Cutting this jumper will disable the RTK LED. This LED indicates when there is an RTK fix.
  • GEO: By default, the GEO is closed. Cutting this jumper will disable the GEO LED. This LED is used for geofencing applications.
  • PPS: By default, the PPS is closed. Cutting this jumper will disable the PPS LED whenever a position lock has been achieved.
  • SPI: By default, the SPI is open. Closing SPI with solder enables the SPI interface and disables the UART and I2C interfaces. USB will still function.

alt text

Control Pins

These pins are used for various extra control of the ZED-F9P:

  • TX READY: Transmit ready output pin. Can be configured using U-Center to indicate that the transmit buffer is full and ready to be transmitted. This is connected to D0 on the MicroMod Processor Board.
  • ZED RESET: Reset input pin. Pull this line low to reset the module.
  • SFBOOT: Safeboot input pin. This is required for firmware updates to the module and generally should not be used or connected.
  • INT: Interrupt input/output pin. Can be configured using U-Center to bring the module out of deep sleep or to output an interrupt for various module states.
  • PPS: Pulse-per-second output pin. Begins blinking at 1Hz when module gets basic GPS/GNSS position lock.

alt text

Hardware Pinout

AUDIOUARTGPIO/BUSI2CSDIOSPIDedicated
FunctionBottom
Pin
   Top   
Pin
Function
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
FunctionBottom
Pin
   Top   
Pin
Function
(Not Connected)75GND
3.3V7473
RTC_3V7271
7069
6665
6463
6261TXOSDO
6059RXISDI
5857SCLSCK
5655SDACS
5453
5251
5049VIN/3
4847
4645GND
4443
4241
D2G04039GND
A13837
GND3635
A03433GND
3231
3029
2827
2625
2423SWDIO
RXI22221SWDCK
TXO22019TXOSDO
D11817RXISDI
INT1615
SCKSCL1413
CSSDA1211BOOT
TX_READY109VIN
87GND
RESET65USB_D-
3.3V_EN43USB_D+
3.3V21GND
Signal GroupSignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT/I2S_OUT/CAM_MCLKOAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN/I2S_IN/CAM_PCLKIAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC/I2S_WS/PDM_DATAI/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK/I2S_CLK/PDM_CLKOAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General/BusG0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-/CAM_HSYNCI/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+/CAM_VSYNCI/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

Board Dimension

The board is about 2.24"x2.60" and includes four mounting holes on each corner. If you include the length of the connectors sticking out from the edge of the board, the overall size of the board is about 2.52"x2.60".

alt text

Hardware Assembly

If you have not already, make sure to check out the Getting Started with MicroMod: Hardware Hookup for information on inserting your Processor Board to your Carrier Board. Just insert the MicroMod Processor Board at an angle of about 25° into the M.2 socket, push down, and secure with the screw.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

At a minimum, your setup should look like the image below. In this case, we had the MicroMod ESP32 Processor Board secured in the M.2 connector.

alt text

GNSS Multi-band Antenna

As stated earlier, you'll need a multi-band antenna and a metal ground plate to make the best use of the ZED-F9P. Connect the two SMA connectors together and tighten the nut. You'll simply need the nut to be finger tight.

alt text

If you’re indoors you must run a SMA extension cable long enough to locate the antenna where it has a clear view of the sky. That means no trees, buildings, walls, vehicles, or concrete metally things between the antenna and the sky. Be sure to mount the antenna on a 4”/10cm metal ground plate to increase reception.

GPS antenna in grass

Of course, you could also attach the ground plate on a camera tripod. Just make sure to secure it with weights if there are heavy winds when using the ZED-F9P.

GPS Antenna with Ground Plane

USB-C Cable

To program and power the microcontroller, insert the USB-C cable into the USB-C connector labeled as Processor.

alt text

To update the ZED-F9P's firmware or configure the module, insert the USB-C cable into the USB-C connector labeled as u-center.

alt text

You can have both USB cables connected at the same time since there are protection diodes connected on the voltage lines.

Software Installation

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. 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.

The SparkFun u-blox Arduino library enables the reading of all positional datums as well as sending binary UBX configuration commands over I2C. This is helpful for configuring advanced modules like the ZED-F9P but also the NEO-M8P-2, SAM-M8Q and any other u-blox module that use the u-blox binary protocol.

The SparkFun u-blox Arduino library can be downloaded with the Arduino library manager by searching 'SparkFun u-blox GNSS' or you can grab the zip here from the GitHub repository:

Once you have the library installed checkout the various examples.

  • Example1: Read NMEA sentences over I2C using u-blox module SAM-M8Q, NEO-M8P, etc
  • Example2: Parse NMEA sentences using MicroNMEA library. This example also demonstrates how to overwrite the processNMEA function so that you can direct the incoming NMEA characters from the u-blox module to any library, display, radio, etc that you prefer.
  • Example3: Get latitude, longitude, altitude, and satellites in view (SIV). This example also demonstrates how to turn off NMEA messages being sent out of the I2C port. You’ll still see NMEA on UART1 and USB, but not on I2C. Using only UBX binary messages helps reduce I2C traffic and is a much lighter weight protocol.
  • Example4: Displays what type of a fix you have the two most common being none and a full 3D fix. This sketch also shows how to find out if you have an RTK fix and what type (floating vs. fixed).
  • Example5: Shows how to get the current speed, heading, and dilution of precision.
  • Example6: Demonstrates how to increase the output rate from the default 1 per second to many per second; up to 30Hz on some modules!
  • Example7: Older modules like the SAM-M8Q utilize an older protocol (version 18) whereas the newer modules like the ZED-F9P depricate some commands using the latest protocol (version 27). This sketch shows how to query the module to get the protocol version.
  • Example8: u-blox modules use I2C address 0x42 but this is configurable via software. This sketch will allow you to change the module’s I2C address.
  • Example9: Altitude is not a simple measurement. This sketch shows how to get both the ellipsoid based altitude and the MSL (mean sea level) based altitude readings.
  • Example10: Sometimes you just need to do a hard reset of the hardware. This sketch shows how to set your u-blox module back to factory default settings.
  • NEO-M8P
    • NEO-M8P Example1: Send UBX binary commands to enable RTCM sentences on u-blox NEO-M8P-2 module. This example is one of the steps required to setup the NEO-M8P as a base station. For more information have a look at the u-blox manual for setting up an RTK link.
    • NEO-M8P Example2: This example extends the previous example sending all the commands to the NEO-M8P-2 to have it operate as a base. Additionally the processRTCM function is exposed. This allows the user to overwrite the function to direct the RTCM bytes to whatever connection the user would like (radio, serial, etc).
    • NEO-M8P Example3: This is the same example as NEO-M8P's Example2. However, the data is sent to a serial LCD via I2C.
  • ZED-F9P
    • ZED-F9P Example1: This module is capable of high precision solutions. This sketch shows how to inspect the accuracy of the solution. It’s fun to watch our location accuracy drop into the millimeter scale.
    • ZED-F9P Example2: The ZED-F9P uses a new u-blox configuration system of VALGET/VALSET/VALDEL. This sketch demonstrates the basics of these methods.
    • ZED-F9P Example3: Setting up the ZED-F9P as a base station and outputting RTCM data.
    • ZED-F9P Example4: This is the same example as ZED-F9P's Example3. However, the data is sent to a serial LCD via I2C.

This SparkFun u-blox library really focuses on I2C because it's faster than serial and supports daisy-chaining. The library also uses the UBX protocol because it requires far less overhead than NMEA parsing and does not have the precision limitations that NMEA has.

Arduino Examples

Example 1: Positional Accuracy

As a quick test, we will be using the first example in the ZED-F9P folder (located in File Examples > SparkFun u-blox GNSS Arduino Library>ZED-F9P>Example1_GetPositionAccuracy).

If you have not already, select your Board (in this case the SparkFun ESP32 MicroMod), and associated COM port. Upload the code to the board and and set the serial monitor to 115200 baud. Give the ZED-F9P a few minutes to get a satellite lock. The GPS coordinates and the accuracy will be output in a Serial Terminal.

More Examples!

Now that you got it up and running, check out the other examples located in the ZED-F9P folder!

Of course, to get the most out of the ZED-F9P, you will need an RTCM correction source. Depending on your setup, you will probably need a second ZED-F9P for a correction source. The following project tutorials allow you to set up the ZED-F9P as a reference station or rover.

How to Build a DIY GNSS Reference Station

October 15, 2020

Learn how to affix a GNSS antenna, use PPP to get its ECEF coordinates and then broadcast your own RTCM data over the internet and cellular using NTRIP to increase rover reception to 10km!

Setting up a Rover Base RTK System

October 14, 2020

Getting GNSS RTCM correction data from a base to a rover is easy with a serial telemetry radio! We'll show you how to get your high precision RTK GNSS system setup and running.

Resources and Going Further

Now that you've successfully got your MicroMod GNSS Carrier Board (ZED-F9P) up and running, 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:

HX1 APRS Transmitter Hookup Guide

The HX1 is a low-power amateur radio transmitter that can be used to send data to the Automatic Packet Reporting System (APRS) network.

SparkFun GPS Breakout (ZOE-M8Q and SAM-M8Q) Hookup Guide

The SparkFun ZOE-M8Q and SAM-M8Q are two similarly powerful GPS units but with different project applications. We'll compare both chips before getting each up and running.

GNSS Chip Antenna Hookup Guide

You've always wanted to experiment with those tiny GPS antennas. Now you can!

Basic Autonomous Kit for Sphero RVR Assembly Guide

Get your Basic Autonomous Kit for Sphero RVR all hooked up with this guide!

Or check out this blog post for inspiration.


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

Artemis Global Tracker Hookup Guide

$
0
0

Artemis Global Tracker Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t2000

Introduction

The SparkFun Artemis Global Tracker provides a powerful tracking system combining remote short messaging via the Iridium satellite network with GPS tracking and environmental sensing all powered by the SparkFun Artemis module. The Global Tracker design focuses on truly remote tracking, data collection and transmission so whether you're looking to transmit environmental data from the top of a mountain, send data from a traveling balloon, control and monitor remote equipment or maybe communicate in an emergency when other networks are not available; the Artemis Global Tracker may be just the right tool for your remote data project.

SparkFun Artemis Global Tracker

SparkFun Artemis Global Tracker

WRL-18712
$399.95

The Artemis Global Tracker features an Iridium 9603N satellite transceiver, u-blox ZOE-M8Q GNSS module and MS8607 pressure, humidity and temperature sensor. We designed the Artemis Global Tracker with the idea of creating a robust data tracking module that works anywhere in the world, including the polar regions, far beyond the reach of WiFi and GSM networks.

Required Materials

The Artemis Global Tracker (or AGT as we'll sometimes refer to it in this guide) requires a few external components to get up and running properly. First and foremost is a power supply. The AGT receives power via either USB-C, single-cell LiPo battery or an external solar panel or battery pack (max 6V). Take a look at the products below for power supply options for the AGT:

USB-C

Reversible USB A to C Cable - 0.3m

Reversible USB A to C Cable - 0.3m

CAB-15426
$3.95
1
Reversible USB A to C Cable - 0.8m

Reversible USB A to C Cable - 0.8m

CAB-15425
$4.95
1
Reversible USB A to C Cable - 2m

Reversible USB A to C Cable - 2m

CAB-15424
$7.95
USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3

LiPo Battery

Lithium Ion Battery - 1Ah

Lithium Ion Battery - 1Ah

PRT-13813
$9.95
7
Lithium Ion Battery - 1250mAh (IEC62133 Certified)

Lithium Ion Battery - 1250mAh (IEC62133 Certified)

PRT-18286
$9.95
1
Lithium Ion Battery - 2Ah

Lithium Ion Battery - 2Ah

PRT-13855
$12.95
7
Lithium Ion Battery - 6Ah

Lithium Ion Battery - 6Ah

PRT-13856
$29.95
7

Solar Panel

Solar Panel - 6W

Solar Panel - 6W

PRT-13783
$59.00
2
Solar Panel - 3.5W

Solar Panel - 3.5W

PRT-13782
$39.00
1
Solar Panel - 2W

Solar Panel - 2W

PRT-13781
$29.00
1
Solar Panel - 9W

Solar Panel - 9W

PRT-13784
$79.00
1
Note: The Artemis Global Tracker uses a JST connector for both the LiPo and Solar Panel / Battery Pack power inputs. The panels listed above all terminate in a standard barrel jack so users need to modify the termination or use an adapter like this Barrel Jack to JST Adapter.

Antenna

The AGT also requires an external antenna for the 9603N and M8Q modules. The AGT routes both modules' antenna pins to a shared SMA connector so to keep things simple, we recommend a passive antenna tuned for Iridium/GPS/GLONASS bands like the antenna shown below:

Iridium/GPS/GLONASS Passive Antenna

Iridium/GPS/GLONASS Passive Antenna

GPS-16838
$64.95

External Capacitors

Users powering the Artemis Global Tracker with a solar panel or lower-current power configurations need to attach a pair of external 10F capacitors like the ones below to provide the extra current for 9603N SBD transmissions:

Super Capacitor - 10F/2.5V

Super Capacitor - 10F/2.5V

COM-00746
$4.95
3

Satellite Network Line Rental

The Iridium modem requires a monthly rental service to exchange information with the Iridium satellite network. Set up an account with Rock7 here. You only pay for months in which you wish to use the modem. No annual contract is required. Line rental costs £12GBP (about &dollar;15USD) per month and includes access to the RockBLOCK management system for managing your devices. The billing system is built-in, and allows you to pay for only what you use. Airtime for Iridium modems must be purchased from Rock Seven via the admin portal once the units are registered. You cannot use the devices with another Iridium airtime provider by default. If you would like to use it with another provider, you will need to pay an unlock fee of &dollar;60USD per modem.

Recommended Reading

Users who have never used the Artemis module or other Artemis boards may want to read through the following tutorials before getting started with the Artemis Global Tracker:

Three Quick Tips About Using U.FL

Quick tips regarding how to connect, protect, and disconnect U.FL connectors.

Using SparkFun Edge Board with Ambiq Apollo3 SDK

We will demonstrate how to get started with your SparkFun Edge Board by setting up the toolchain on your computer, examining an example program, and using the serial uploader tool to flash the chip.

Designing with the SparkFun Artemis

Let's chat about layout and design considerations when using the Artemis module.

Artemis Development with the Arduino IDE

This is an in-depth guide on developing in the Arduino IDE for the Artemis module and any Artemis microcontroller development board. Inside, users will find setup instructions and simple examples from blinking an LED and taking ADC measurements; to more complex features like BLE and I2C.

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Hardware Overview

Let's take a look at the Artemis Global Tracker and all the hardware on it. There is a lot to cover here so buckle up.

Major AGT Components

The Artemis Global Tracker combines the SparkFun Artemis module, Iridium 9603N Satellite Transceiver, ZOE-M8Q GNSS module and MS8607 PHT sensor to provide location and environmental data to a powerful, low-power processor system capable of transmitting collected data from anywhere on the planet using the Iridium Satellite network. First up we'll cover these major components in more detail.

Photo highlighting the majore components on the AGT.

Artemis Microprocessor

As the name suggests, the SparkFun Artemis Module rests at the core of the Artemis Global Tracker. The Artemis Module is built on the Apollo3 MCU platform and is a Cortex-M4F based module with BLE 5.0 that runs at 48MHz clock frequency (up to 96MHz burst mode) and low-power consumption as low as 6µA per MHz. The Artemis also features plenty of storage space with up to 1MB of Flash memory and up to 384KB RAM, BLE 5 RF sensitivity of -93dBm (typical) and TX peak output power of 4.0dBm. For a complete overview of the Artemis module, please review the Artemis Integration Guide and Graphical Datasheet.

The Artemis works on multiple development platforms; the SparkFun Apollo3 Arduino Core, Python, as well as Ambiq's Apollo3 SDK allowing users to choose which development environment works best for their application. Note, the examples for the Artemis Global Tracker are written for the Arduino IDE.

Iridium 9603N Satellite Transceiver

The AGT uses an Iridium 9603N Satellite Transceiver to take advantage of the Iridium Satellite transmission network to send and receive small data packets in truly remote areas with no WiFi and GSM network coverage. With a clear view of the sky, the Iridium can send short messages anywhere in the world, including polar regions outside the range of traditional wireless networks like WiFi and GSM networks. Refer to the datasheet for more information on the 9603N.

Note: The Iridium modem requires a monthly rental service to exchange information with the Iridium satellite network. You only pay for months in which you wish to use the modem. No annual contract is required. Line rental costs £12GBP (about $17USD) per month and includes access to the RockBLOCK management system for managing your devices. The billing system is built-in, and allows you to pay for only what you use. Airtime for Iridium modems must be purchased from Ground Control (formerly known as Rock Seven) via the admin portal once the units are registered. You cannot use the devices with another Iridium airtime provider by default. If you would like to use it with another provider, you will need to pay an unlock fee of $60USD per modem.

The 9603N is a small form-factor satellite transceiver that uses Iridium's satellite network in Low-Earth Orbit which reduces latency greatly as compared to networks using geostationary satellites. The 9603N design focuses on creating a robust transceiver capable of working in inhospitable environments with an operating temperature range of -40°C to 85°C and up to 75% humidity.

The module draws relatively low current during idle, transmission and receive. Short-Burst-Data transfers require the most current for short periods (8ms) but the design accommodates for that by powering the 9603N with a pair of 1F supercapacitors and charge/current regulation circuit covered in more detail below. The table below shows the typical and max values for each of those operations (all values operating at 5V):

OperationCurrent Draw
Idle34mA avg. (156mA peak)
Transmit145mA avg. (1.3A peak)
Receive39mA avg. (156mA peak)
Short-Burst Data Transfer158mA avg.

The AGT ties the 9603N's Shutdown Pin to Artemis pin D17 to allow software control of power to the module. This software control is important to take note of when transmitting data using an antenna attached to the SMA connector as the 9603N shares an antenna connection with the ZOE-M8Q. The AGT includes a switching circuit to select which module uses the antenna as both modules cannot use the antenna at the same time. This circuit defaults to use the ZOE-M8Q antenna line when the device is powered so make sure to power the GNSS module down prior to transmitting data with the 9603N.

ZOE-M8Q GNSS Module

The ZOE-M8Q GNSS module from u-blox adds positional data to the Artemis Global Tracker. The ZOE-M8Q is an ultra-small GNSS module that works with all major GNSS constellations (GPS, GLONASS, Galileo and BeiDou). For a complete overview of the ZOE-M8Q refer to the datasheet. The module also supports up to four circular geofencing areas so you can trigger alarm messages sent over the Iridium network when your device either enters or exits one of those areas.

The AGT uses the ZOE-M8Q's I2C bus to communicate between the module and the Artemis controller. With a passive antenna, the ZOE-M8Q achieves up to 2.5m accuracy with GPS lock. From a cold start, the module has a Time-To-First-Fix of 29s with GPS and a hot start fix time of 1s on all constellations. The table below outlines the ZOE-M8Q's specifications:

ParameterSpecificationGNSS Constellation
GPS and GLONASSGPSGLONASSBeiDouGalileo
Horizontal Position Accuracy---2.5m2.5m4m3m---
Max Navigation Update RateROM10Hz18Hz18Hz18Hz18Hz
Flash5Hz10Hz10Hz10Hz10Hz
Time-To-First-FixCold Start26s29s30s34s45s
Hot Start1s1s1s1s1s
SensitivityTracking and Navigation-167dBm-166dBm-166dBm-160dBm-159dBm
Reacquisition-160dBm-160dBm-156dBm-157dBm-153dBm
Cold Start-148dBm-148dBm-145dBm-143dBm-138dBm
Hot Start-157dBm-157dBm-156dBm-155dBm-151dBm
Velocity Accuracy0.05m/s
Heading Accuracy0.3 degrees

Power to the ZOE-M8Q is controlled by a P-Channel MOSFET tied to Artemis pin D26. This allows users to turn the module off and on when positioning data is not needed. The board also includes a 1mAh backup battery and charging circuit for the ZOE-M8Q to allow the module to operate in Hardware Backup Mode for up to 12 hours to keep the clock running and allow a hot or warm start later. The backup battery recharges only with USB power connected (to help minimise the 3.3V current draw during sleep).

As a reminder, the ZOE-M8Q shares the antenna connection with the 9603N module. Both modules cannot use the antenna at the same time so the board includes a switching circuit to select which module uses the antenna.

MS8607 PHT Sensor

The Artemis Global Tracker includes the MS8607 Pressure, Humidity and Temperature sensor from TE Connectivity for an integrated environmental monitoring system at your remote station as well an effective altimeter for balloon applications. For a complete overview of the MS8607, refer to the datasheet.

The MS8607 offers a wide operating range with excellent precision for pressure, temperature and humidity. The table below outlines theses parameters.

CharacteristicPressure (mbar)Relative Humidity (%RH)Temperature (°C)
MinTypMaxMinTypMaxMinTypMax
Max. Operating Range1020000100-40+85
Absolute Accuracy @25°C300...1100mbar20...80%RH@25°C
-22-33-11
Resolution (Highest Mode)0.0160.040.01

Power

The Artemis Global Tracker includes three power input options in USB-C, single-cell LiPo battery or a solar panel (or battery pack), LiPo charging circuit and a dedicated supercapacitor power and charging circuit for the 9603N.

Photo highlighting primary power inputs for AGT.

Primary Power Inputs

Low-forward-voltage diodes isolate the three power inputs from each other so that users can have all three power sources present without harming anything on the AGT. If USB voltage is present (along with other power supplies), the AGT prefers to draw power from USB. If just Solar Cell/Battery Pack and LiPo are connected, the AGT defaults to drawing power from the Solar Cell/Battery Pack input, making the LiPo redundant.

Power InputVoltage RangeNotes
USB-C5VAGT selects USB as power if voltage is present along with other power sources (LiPo/Solar/etc.)
LiPo Battery4.2-3.0VCharging circuit only powered with voltage present on USB.
Solar PanelMax 6.0VAdditional 10F capacitors recommended for 9603N module power during transmit cycles.
Battery Pack3.0-6.0V3x Energizer Ultimate Lithium AA or AAA cells are recommended for extreme environments as they operate down to -40°C.

LiPo Battery Charge Circuit

The AGT includes a charging circuit for an attached single-cell LiPo battery using one of our favorite LiPo management controllers, the MCP73831 from Microchip. The charge circuit configuration sets the charge rate to 500mA. The LiPo charging circuit only receives power via VUSB; USB power is required to charge an attached LiPo battery.

Supercapacitors and Charge Circuit

The AGT provides power to the 9603N through a pair of supercapacitors charged by an LTC3225 supercapacitor charger regulated by an ADM4210 in-rush current limit circuit. The charge circuit defaults to source enough current (150mA) to power the 9603N during normal operation and the supercapacitors provide the extra 1.3A required during the Short Burst Data (SBD) transfers (8.3ms).

The charge circuit is configurable to switch to a lower max current (60mA) for low-current power configurations like solar. While in the low max current configuration users need to add a pair of 10F capacitors to provide the extra current required by the 9603N module during normal operation and SBD transfers.

The AGT ties the LTC3225's Shutdown Input pin to Artemis pin D27 which allows users to put the charger into Shutdown Mode to help reduce power consumption when the supercapacitor charge circuit is not needed. Set D27 LOW to put the LTC3225 into Shutdown Mode and reduce current consumption by the charge circuit to approximately 1µA. Users looking for more detailed information on the LTC3225 should refer to the datasheet.

Bus Voltage

The AGT includes a voltage monitoring circuit to keep track of the bus voltage (from the USB, LiPo or external cells). The board uses Artemis pin AD13 for voltage measurement via a simple two resistor divider dividing the bus voltage by three. Power to the resistor divider is switched by an N-channel MOSFET so the power draw can be minimized during sleep.

GPIO PTHs

The AGT breaks out an assortment of helpful GPIO pins from the Artemis module to PTH headers to interface with external devices. The board routes the following: SPI, I2C, Reset, and eleven multi-purpose GPIO pins to PTH headers:

Photo highlighting AGT GPIO PTHs.

SPI/I2C Bus and Reset PTHs

  • SDA
  • SCL
  • RST
  • CIPO
  • COPI

GPIO PTHs

  • AD11~
  • AD12~
  • AD29~
  • AD31~
  • AD32~
  • AD35~ (SPI CS1)
  • D4~ (SPI CS2)
  • D15
  • D37*
  • D42~
  • D43~
  • Pins marked with a "~" are PWM-capable.
  • I2C pins (SDA and SCL) are shared with ZOE-M8Q and MS8607 @3.3V.
  • *D37 is a low-Impedance pin. Useful for controlling MOSFETs to power external devices.

For detailed information on alternate functionality and GPIO multiplexing options, refer to the Designing with the SparkFun Artemis tutorial and Artemis/Apollo3 Pin Function Map.

LEDs

The AGT has seven status LEDs highlighted in the photo below:

Photo highlighting LEDs on the AGT.
  • 9603N PWR: Illuminates when the 9603N is powered on.
  • CHARGING: Illuminates when the supercapacitor charge circuit is active.
  • POWER: Illuminates when 3.3V is present.
  • GNSS: Illuminates when ZOE-M8Q is powered on.
  • D19: General status LED tied to Artemis D19.
  • RX0: UART0 RX data indicator LED.
  • TX0: UART0 TX data indicator LED.

Solder Jumpers

The Artemis Global Tracker has four solder jumpers labeled PWR LED, Supercaps Charge Current, 3.3V EN and MEAS.

Photo highlighting the AGT solder jumpers.

The PWR_LED jumper allows users to disable the Power LED to help reduce power consumption for low-power applications. This jumper is CLOSED by default. Sever the trace between the two pads to open the jumper and disable the Power LED.

The Supercaps Charge Current Jumper adjusts the maximum current for the LTC3225 Supercapacitor charger by tying the PROG pin to Ground through one of two different valued resistors (12k&ohm; (default) and 30.1k&ohm;). By default, it sets the charge current to 150mA, opening the jumper sets the charge current to 60mA. When in this configuration additional capacitors are required to provide the extra power drawn by the 9603N during transmission cycles.

The 3.3V EN Jumper controls the Enable Pin on the 3.3V regulator to VIN. The jumper is CLOSED by default and ties the Enable Pin to VIN. Opening the jumper leaves the Enable Pin tied only to the PTH labeled EN on the AGT allowing users to use that PTH pin to turn the regulator on and off.

The MEAS Jumper allows users to measure the current draw of the AGT. By default, the jumper is CLOSED and nets all three power inputs to VIN.

Board Dimensions

The Artemis Global Tracker measures 2.5in x 2.0in (63.5mm x 50.8mm) with four mounting holes that fit a 4-40 screw.

AGT board dimensions

Hardware Assembly

The Artemis Global Tracker comes basically ready-to-use out of the box for most applications. The only assembly required for basic use is to connect an antenna to the SMA connector and attach your power supply (USB, solar panel and/or battery). Users powering the AGT with a solar panel or other low-current supply most likely need to solder additional supercapacitors to the provided PTH connections.

Basic Assembly (USB/LiPo Battery)

Simple assembly of the AGT only requires a power source and antenna connection. On initial setup you'll want to connect it to a computer via USB to program the board. With your preferred code running on the AGT, connect the antenna to the SMA connector and then power it with either a USB power supply, LiPo battery or solar panel/battery pack connected to the properly labeled connection (USB or JST connector). Reminder, the LiPo charging circuit only operates with voltage from USB.

alt text

Additional Supercapacitor Assembly

Solar powered or other low-current applications may require users to adjust the Charge Current jumper to set the charge rate from 150mA to 60mA. The reduced current provides enough for the 9603N's 39mA average current draw during receive, but larger supercapacitors are needed to supply the average current pulled during a complete receive/transmit cycle.

Before soldering to the board, remove the 9603N from the AGT by unscrewing the mounting screws, carefully unplug the u.Fl cable and then remove the 9603N from the board making sure to pull directly upwards. After removing the 9603N, turn the board over and solder a pair of additional 10F capacitors like these to the labeled pads on the back of the board taking care to match the polarity:

Iridium and Artemis Software Setup

The Artemis Global Tracker requires a couple of software setup steps users need to complete before they start working with the device. You must create an account for Rock7 Operations to set up line rental and message credits for the 9603N. Users wanting to use the AGT with the Arduino IDE may need to install the SparkFun Apollo3 Arduino core to upload code to the Artemis Module.

Rock7 Operations

Head over to Rock7's Operations webpage to create an account to use the 9603N on the Iridium Satellite Network. You must create an account and link the 9603N to it as well as set up a line rental and purchase message credits with Rock7 to send data over the network. The website has easy-to-follow instructions to get the 9603N registered and operating on the network.

Artemis Arduino Guides

Users needing to install the SparkFun Apollo3 Arduino Core should read through the tutorial below:

Artemis Development with the Arduino IDE

September 10, 2020

This is an in-depth guide on developing in the Arduino IDE for the Artemis module and any Artemis microcontroller development board. Inside, users will find setup instructions and simple examples from blinking an LED and taking ADC measurements; to more complex features like BLE and I2C.
Important! The Artemis Global Tracker examples currently work only on version 2.1.0 of the SparkFun Apollo3 Arduino core. Make sure to install that version of the Arduino core when using the Artemis Global Tracker. You can select the version when using the Boards Manager tool in the Arduino IDE or users who prefer to manually manage the board definitions can find version 2.1.0 here. We are currently working on an update to the Arduino core to resolve this issue. You can keep track of the development process on the Apollo3 Arduino core GitHub Repository. We will update this guide once this issue is resolved.

The Artemis Global Tracker uses the Artemis ATP board definitions. The Artemis Arduino Core install includes this board definition but in case you are interested in learning more about the Artemis ATP, head on over to the Hookup Guide:

Hookup Guide for the SparkFun RedBoard Artemis ATP

August 28, 2019

Get started with the RedBoard Artemis ATP - all the functionality of the SparkFun Artemis module wrapped in the Mega Arduino Footprint

Artemis Global Tracker Arduino Examples

The AGT ships with a comprehensive Global Tracker example pre-loaded on the board for users to get started quickly with the Artemis Global Tracker Configuration Tool so if you want to skip ahead and use the Configuration Tool, jump ahead to the next section.

Arduino Examples

Note: These examples assume the latest version of the Arduino IDE is used. If this is your first time using Arduino, please review our tutorials on Installing the Arduino IDE and Installing an Arduino Library.

We've written twenty examples for users to familiarize themselves with all of the hardware present on the Artemis Global Tracker using the Arduino IDE. The examples build on each other to quickly test functionality of different circuits on the AGT and demonstrate how to use the PHT sensor, ZOE-M8Q and 9603N individually with some highlighting features of these components as well as three examples showing how to create a tracking device using the AGT. Download the examples either from the GitHub repository or you can download a ZIP of the GitHub repo by clicking the button below:

Open the examples either from the folder they downloaded to or you can put them in your "Arduino Sketchbook" folder to open them in the Arduino IDE. If you're not certain where your Sketchbook folder is, open the "Preferences" menu in Arduino and look for the filepath under the selection titled "Sketchbook location".

Required Arduino Libraries

The Artemis Global Tracker examples use three SparkFun libraries users need to install prior to working with them:

Install the libraries through the Arduino Library Manager tool by searching for "IridiumSBDi2c", "SparkFun u-blox GNSS Arduino Library" and "SparkFun PHT MS8607 Arduino Library". Users who prefer to manually install the libraries can download the ZIP of each library repository by clicking the buttons below:

Arduino Examples

Reminder: The Artemis Global Tracker Arduino Examples only work on v2.1.0 of the SparkFun Apollo3 Arduino Core. Make sure you are using that version when uploading the examples. We will update this note once the current version of the Apollo3 Arduino Core is compatible with these examples.

With the Artemis Arduino Core and necessary libraries installed we can move on to using the examples. This tutorial covers six of the Arduino examples we find most helpful to demonstrate how to use the major components on the AGT and then how to use them all in conjunction to create a global tracking device.

Users looking to write their own code for the AGT should take note of the following pin definitions and functions:

language:c
// D4 can be used as an SPI chip select or as a general purpose IO pin
#define spiCS1              4  

// Input for the ZOE-M8Qs PIO14 (geofence) pin
#define geofencePin         10 

// Bus voltage divided by 3 (Analog in)
#define busVoltagePin       13 

// Iridium 9603N ON/OFF (sleep) pin: pull high to enable the 9603N
#define iridiumSleep        17 

// Input for the Iridium 9603N Network Available
#define iridiumNA           18 

// White LED
#define LED                 19 

// ADM4210 ON: pull high to enable power for the Iridium 9603N
#define iridiumPwrEN        22 

// GNSS Enable: pull low to enable power for the GNSS (via Q2)
#define gnssEN              26 

// LTC3225 super capacitor charger: pull high to enable the super capacitor charger
#define superCapChgEN       27 

// Input for the LTC3225 super capacitor charger PGOOD signal
#define superCapPGOOD       28 

// Bus voltage monitor enable: pull high to enable bus voltage monitoring (via Q4 and Q3)
#define busVoltageMonEN     34 

// D35 can be used as an SPI chip select or as a general purpose IO pin
#define spiCS2              35 

// Input for the Iridium 9603N Ring Indicator
#define iridiumRI           41     

void gnssON(void) // Enable power for the GNSS
{
  am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
  pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
  pin_config(PinName(gnssEN), pinCfg);
  delay(1);

  digitalWrite(gnssEN, LOW); // Enable GNSS power (HIGH = disable; LOW = enable)
}

void gnssOFF(void) // Disable power for the GNSS
{
  am_hal_gpio_pincfg_t pinCfg = g_AM_HAL_GPIO_OUTPUT; // Begin by making the gnssEN pin an open-drain output
  pinCfg.eGPOutcfg = AM_HAL_GPIO_PIN_OUTCFG_OPENDRAIN;
  pin_config(PinName(gnssEN), pinCfg);
  delay(1);

  digitalWrite(gnssEN, HIGH); // Disable GNSS power (HIGH = disable; LOW = enable)
}

void setup()
{
  // Configure the I/O pins
  pinMode(LED, OUTPUT);

  pinMode(iridiumPwrEN, OUTPUT); // Configure the Iridium Power Pin (connected to the ADM4210 ON pin)
  digitalWrite(iridiumPwrEN, LOW); // Disable Iridium Power
  pinMode(superCapChgEN, OUTPUT); // Configure the super capacitor charger enable pin (connected to LTC3225 !SHDN)
  digitalWrite(superCapChgEN, LOW); // Disable the super capacitor charger
  gnssOFF(); // Disable power for the GNSS

  pinMode(busVoltageMonEN, OUTPUT); // Make the Bus Voltage Monitor Enable an output
  digitalWrite(busVoltageMonEN, HIGH); // Set it high to enable the measurement
  //digitalWrite(busVoltageMonEN, LOW); // Set it low to disable the measurement (busV should be ~zero)

  analogReadResolution(14); //Set resolution to 14 bit

Example 3 - PHT

The first example we'll take a look at is Example 3 - PHT. This example demonstrates how to interact with the MS8607 PHT Sensor to retrieve pressure, humidity and temperature data from the sensor. The code performs all of the AGT pin definitions and custom functions listed above and initializes the MS8607 on the I2C bus:

language:c
if (barometricSensor.begin(agtWire) == false)
  {
    Serial.println("MS8607 sensor did not respond. Trying again...");
    if (barometricSensor.begin(agtWire) == false)
    {
      Serial.println("MS8607 sensor did not respond. Please check wiring.");
      while(1)
        ;
    }
  }

After initializing the sensor, the code polls for temperature (in °C), pressure (in hPa or mbar) and humidity (in %RH) data from the sensor and prints it out over serial every 500ms. Open the serial monitor with the baud set to 115200 to watch the environmental data print out.

Users who prefer to use an external PHT sensor should refer to Example 4 - External PHT for a demonstration of that application.

Example 5 - GNSS

Example 5 shows how to use the ZOE-M8Q to get GNSS positioning data. Upload the example and open the serial terminal with the baud set to 115200 and input set to Newline. The setup initializes the Wire port and sets the clock speed to 100kHz for optimal performance:

language:c
agtWire.begin();
agtWire.setClock(100000);

Before initializing the ZOE-M8Q, the code waits for a user input to confirm the serial monitor settings are correct. After user input, the code turns the ZOE-M8Q on, waits one second for the module to power up, initializes it on the I2C bus, and sets it to output only UBX data:

language:c
Serial.println(F("Please check that the Serial Monitor is set to 115200 Baud"));
Serial.println(F("and that the line ending is set to Newline."));
Serial.println(F("Then click Send to start the example."));
Serial.println();
while(Serial.available() == 0)
;

gnssON(); // Enable power for the GNSS
delay(1000); // Let the ZOE power up

if (myGNSS.begin(agtWire) == false) //Connect to the u-blox module using pads 8 & 9
{
    Serial.println(F("u-blox GNSS not detected at default I2C address. Please check wiring. Freezing."));
    while (1)
        ;
}    

//myGNSS.factoryDefault(); delay(5000); // Uncomment this line to reset the ZOE-M8Q to the factory defaults

//myGNSS.enableDebugging(); // Uncomment this line to enable helpful debug messages on Serial

myGNSS.setI2COutput(COM_TYPE_UBX);

The main loop checks for the GNSS fix and prints out what type of fix the module has (Dead Reckoning, 2D, 3D or GNSS+Dead Reckoning). Once the ZOE-M8Q has a GNSS fix the code pulls and prints out latitude, longitude and altitude data from the module.

The two commented out lines allow the user to reset the ZOE-M8Q to factory defaults and enable serial debugging. Sending the factory default command can help recover the ZOE-M8Q in case it gets stuck in an unresponsive state. Enabling serial debugging tells the ZOE-M8Q to send all debug data over serial for troubleshooting.

Example 6 - Geofence

Example 6 builds on the previous example to set up four geofence areas for the ZOE-M8Q to monitor. The code sets everything up just like the previous GNSS example. When the module finds a 3D fix, the code prints the longitude and latitude, creates settings for the four geofence areas, clears any existing geofences stored and then sets four geofence areas of 5m, 10m, 15m and 20m:

language:c
uint32_t radius = 500; // Set the radius to 5m (radius is in m * 10^-2 i.e. cm)
byte confidence = 2; // Set the confidence level: 0=none, 1=68%, 2=95%, 3=99.7%, 4=99.99%
byte pinPolarity = 0; // Set the PIO pin polarity: 0 = low means inside, 1 = low means outside (or unknown)
byte pin = 14; // ZOE-M8Q PIO14 is connected to the geofencePin

Serial.print(F("Clearing any existing geofences. clearGeofences returned: "));
Serial.println(myGNSS.clearGeofences());

Serial.print(F("addGeofence for geofence 1 returned: "));
Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence, pinPolarity, pin));

radius = 1000; // 10m
Serial.print(F("addGeofence for geofence 2 returned: "));
Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence, pinPolarity, pin));

radius = 1500; // 15m
Serial.print(F("addGeofence for geofence 3 returned: "));
Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence, pinPolarity, pin));

radius = 2000; // 20m
Serial.print(F("addGeofence for geofence 4 returned: "));
Serial.println(myGNSS.addGeofence(latitude, longitude, radius, confidence, pinPolarity, pin));

The main loop monitors the state of the four geofences and prints out both the combined and individual status of the geofences every second:

language:c
geofenceState currentGeofenceState; // Create storage for the geofence state

boolean result = myGNSS.getGeofenceState(currentGeofenceState);

Serial.print(F("getGeofenceState returned: ")); // Print the combined state
Serial.print(result); // Get the geofence state

if (!result) // If getGeofenceState did not return true
{
Serial.println(F(".")); // Tidy up
return; // and go round the loop again
}

// Print the Geofencing status
// 0 - Geofencing not available or not reliable; 1 - Geofencing active
Serial.print(F(". status is: "));
Serial.print(currentGeofenceState.status);

// Print the numFences
Serial.print(F(". numFences is: "));
Serial.print(currentGeofenceState.numFences);

// Print the combined state
// Combined (logical OR) state of all geofences: 0 - Unknown; 1 - Inside; 2 - Outside
Serial.print(F(". combState is: "));
Serial.print(currentGeofenceState.combState);

// Print the state of each geofence
// 0 - Unknown; 1 - Inside; 2 - Outside
Serial.print(F(". The individual states are: "));
for(int i = 0; i < currentGeofenceState.numFences; i++)
{
if (i > 0) Serial.print(F(","));
Serial.print(currentGeofenceState.states[i]);
}

byte fenceStatus = digitalRead(geofencePin); // Read the geofence pin
digitalWrite(LED, !fenceStatus); // Set the LED (inverted)
Serial.print(F(". Geofence pin (PIO14) is: ")); // Print the pin state
Serial.print(fenceStatus);
Serial.println(F("."));

delay(1000);

The on-board LED is configured to illuminate when the AGT is inside the combined geofence areas and will go out when the AGT is outside them to provide a visual indicator for quickly identifying the geofence area limits.

Example 10 - Basic Send

Reminder: The 9603N needs to be linked to an active account and line rental on Rock7 Operations with sufficient message credits for the example to work properly.

Example 10 demonstrates how to perform a basic data transmission using the 9603N to send the classic "Hello, world!" over the Iridium satellite network. The code declares the IridiumSBD object with the sleep (ON/OFF) and RI (Ring Indicator) pins and creates two functions to set up and control Artemis Serial1 to communicate with the 9603N modem:

language:c
IridiumSBD modem(Serial1, iridiumSleep, iridiumRI);

void IridiumSBD::beginSerialPort() // Start the serial port connected to the satellite modem
{
  diagprint(F("custom IridiumSBD::beginSerialPort\r\n"));

  // Configure the standard ATP pins for UART1 TX and RX - endSerialPort may have disabled the RX pin

  am_hal_gpio_pincfg_t pinConfigTx = g_AM_BSP_GPIO_COM_UART_TX;
  pinConfigTx.uFuncSel = AM_HAL_PIN_24_UART1TX;
  pin_config(D24, pinConfigTx);

  am_hal_gpio_pincfg_t pinConfigRx = g_AM_BSP_GPIO_COM_UART_RX;
  pinConfigRx.uFuncSel = AM_HAL_PIN_25_UART1RX;
  pinConfigRx.ePullup = AM_HAL_GPIO_PIN_PULLUP_WEAK; // Put a weak pull-up on the Rx pin
  pin_config(D25, pinConfigRx);

  Serial1.begin(19200);
}    

void IridiumSBD::endSerialPort()
{
  diagprint(F("custom IridiumSBD::endSerialPort\r\n"));

  // Disable the Serial1 RX pin to avoid the code hang
  am_hal_gpio_pinconfig(PinName(D25), g_AM_HAL_GPIO_DISABLE);
}

After uploading the code, open the serial monitor with the baud set to 115200. The code waits for the user to open the serial monitor and press send before continuing with the rest of the sketch. After the input, the code enables the supercapacitor charger, begins the charge cycle and then attempts to initialize the 9603N once the charge cycle is complete. Serial prints accompany all these functions for users to follow along with.

Assuming the 9603N initialized correctly, the code checks the signal quality, prints out a value between 0 and 5 (5 being the strongest signal quality) and then attempts to send a text message of "Hello, world!" over the network. This may take several minutes, if the message was sent successfully, the code prints "Hey, it worked!" otherwise, the code prints "Try again with a better view of the sky.".

Regardless of success or failure of sending the text message, the code finishes by clearing the Mobile Originated message buffer, puts the 9603N to sleep and then disables power to the 9603N and supercapacitor charge circuit. Note, this code is not a loop and if it fails, you'll need to reset the AGT before attempting again.

Example 16 - Global Tracker

The last example this tutorial combines everything together to provide a comprehensive global tracker capable of receiving a host of settings updates either via USB-C or wirelessly using Iridium SBD messages. This means users can monitor and configure the device depending on the application's needs while the AGT is in the field.

The example gets a 3D fix from the ZOE-M8Q, environmental readings from the MS8607, measures the bus voltage, and transmits the data at a set interval via Iridium SBD messages. The code also stores many settings in EEPROM (Flash) to be configured either via the USB port or an Iridium binary message sent from Rock7 Operations.

On top of all that, the example includes the capability for users to add up to eight custom functions for additional sensor or other devices in use with the AGT. For those curious about the message format, please review this page in the GitHub repository.

The code defaults to send a text message every five minutes of the following data fields:

  • DATETIME: GNSS date and time in YYYYMMDDHHMMSS format
  • LAT: GNSS latitude in degrees
  • LON: GNSS longitude in degrees
  • ALT: GNSS altitude above mean sea level in meters

This example works in tandem with the Artemis Global Tracker Configuration Tool we cover in the next section.

Artemis Global Tracker Configuration Tool

The Artemis Global Tracker Configuration Tool lets users quickly update a host of settings on the AGT while running the Global Tracker Arduino Example either locally using a USB-C connection or remotely via Iridium messages.

Artemis Global Tracker Configuration Tool

The AGT Configuration tool provides a helpful GUI (Graphical User Interface) for users to pick and choose what information the AGT sends in its update messages, message format, and various alarm messages. The AGT ships with Example 16 - Global Tracker running on the board to let you use the Configuration Tool out of the box. Note, the AGT must be running this example for the Configuration Tool to function. Users looking to modify the example to add their own functions should note the example allows for adding up to eight custom functions to interact with using the Configuration Tool.

AGT Configuration Tool screenshot.
Having trouble seeing the detail in this screenshot? Click on it for a larger view.

The Configuration Tool is available both as a Python script and Windows executable (.exe). Users familiar with Python and able to install PyQt5 along with all other required modules can run AGTCT.py otherwise users can run the tool as an executable on Windows 64-bit systems. Both versions of the tool are hosted on the GitHub repository in the "Tools" folder and function identically on the front end user interface.

Configuration Tool Options

The Configuration Tool offers a lot of options to customize the data sent by the AGT. Users can customize everything from data sent in messages, various alarm messages ranging from environmental readings, Geofence positions to battery voltage and even custom functions users can write into the Global Tracker Example. Users curious about the message format can read about it on this page in the GitHub repository.

Local Configuration Tool Updates

For local updates, start off by plugging the AGT to your computer with a USB-C cable and take note of the COM port the device enumerates on. Open the Configuration Tool, select your port and click the "Open Port" button. (If you do not see the correct port, click the Refresh button and retry.) You should see a welcome message in the Serial Monitor window with the firmware version after opening the port.

Remote Configuration Tool Updates

Remote configuration using Iridium messages follows nearly the same steps as local configuration. Before selecting the settings in the Configuration Tool, go ahead and log into your Rock7 Operations account. Next, open the Configuration Tool (if it is not open already) and go through the steps to create the configuration files as you would normally do but without opening a port. Once you are ready, click the "Calculate Config" button and you should see a long hex string in the "Configuration Message" window. Select the entire message and copy it.

With the message copied, go to your Rock7 Operations and click on the "Send a message" tab. Make sure to select "Mode Hex" and then paste the configuration message into the "Hex String" window. Select the RockBLOCK serial number for the tracker(s) you want to update and click "Send Message". This saves the settings and stores them for the next time the AGT sends a message.

Artemis Global Tracker Mapping Tools

We also have a suite of Mapping Tools hosted on the GitHub Repository to allow users to track up to eight AGT devices using Google Maps Static API. For more information on these tools and how to use them, refer to this page in the GitHub repository.

Troubleshooting

This tutorial covered a lot so in this section we'll revisit a few troubleshooting tips for the Artemis Global Tracker included in this guide.

Arduino Examples

The Arduino Examples provide the quickest way to troubleshoot most common problems with the AGT. We've done our best to have dedicated examples to most circuits on the board to test everything from the bus voltage to low power mode along with testing the PHT sensor, ZOE-M8Q and 9603N. We recommend any users experiencing issues with their AGT start with these examples to help narrow down and potentially resolve the issue.

Compile Errors

If you experience any compilation or upload errors in Arduino, make sure you are using version 2.1.0 of the Apollo3 Arduino core. Once the latest version of that core has no issues with the AGT Arduino Examples we'll update this section.

Insufficient Power for 9603N SBD Transmission

As a reminder, power configurations using a solar panel or other low-current power supply need to have an additional pair of 10F capacitors soldered to the indicated PTH pads. Solar panels cannot typically provide sufficient current to run the supercapacitor charge circuit at 150mA and we recommend adjusting the Charge Current jumper to set the charge current to 60mA.

Iridium Line Rental and Credits

In order to send and receive messages on the Rock7 network users must set up an account on Rock7, purchase a line rental and credits from Rock7.

Example 10 Message Lost

You may find when running Example 10 (or other messaging examples if you skip Example 10) the message does not arrive at the endpoints/delivery group on first try. We found this message can get "lost" on first use with a new modem. If you do not receive the message on the endpoint, try running the example again and it should send the message. Note, you should not be charged any credits for the first "lost" message.

Antenna Signal

One of the most common causes of issues with both the ZOE-M8Q GNSS transceiver and 9603N modem is antenna signal. If either of these components have issues with receiving or sending data, make sure the antenna has a clear view of the sky away from large objects like buildings or large trees.

Also, remember to only power the 9603N or ZOE-M8Q individually to prevent conflicts using the shared antenna. While the AGT includes a protection circuit to prevent both devices from using the antenna at the same time, the circuit prioritizes the ZOE-M8Q antenna over the 9603N so if both are powered on, only the ZOE-M8Q will have an antenna connection.

General Troubleshooting and Technical Assistance

Resources and Going Further

If you made it this far, congratulations! Your Artemis Global Tracker should be fully configured and ready to transmit data from anywhere on Earth. For more information about the AGT or the components on it, please refer to the resources below:

Artemis Global Tracker Documentation

Artemis Module Documentation

Iridium 9603N Transceiver Documentation

u-blox M8Q Documentation

MS8607 PHT Sensor Documentation

Looking for some inspiration on what to use the Artemis Global Tracker for? Take a look at this interview with Jean Rabault from the Norwegian Meteorological Institute who is using the AGT to track sea ice in the polar regions:


learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

1W LoRa MicroMod Function Board Hookup Guide

$
0
0

1W LoRa MicroMod Function Board Hookup Guide a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t1996

Introduction

Frequency Operation

This LoRa module can only be used in the 915MHzLoRaWAN frequency band (i.e. 902 to 928 MHz). It is not compatible with other frequency bands; double check the frequency band used in your region. Check out these resources from The Things Network for an unofficial summary of regional radio regulations and list of the regional frequency plans.

The 1W LoRa MicroMod Function Board adds LoRa capabilities to your MicroMod project. It is intended to be used in conjunction with a MicroMod processor board and a MicroMod main board, which provides the electrical interface between a processor board and the function board(s).

SparkFun MicroMod LoRa Function Board

SparkFun MicroMod LoRa Function Board

WRL-18573
$39.95

Match up the board's M.2 edge connector to the slot of the M.2 connector and secure the function board with the screws provided with the main board.

Utilizing the 915M30S LoRa module from EBYTE, which is a 1W (30dBm) transceiver based around the SX1276 from Semtech. There is a robust edge mount RP-SMA connector for large LoRa (915MHz) antennas; with modification, a U.FL connector is also available. We've successfully tested a 12 miles line-of-sight transmission with this module (user results may vary).

With the MicroMod standardization, users no longer need to cross-reference schematics with datasheets, while fumbling around with jumper wires. Simply, match up the function board's M.2 edge connector to the slot of the M.2 connector on the main board and secure the function board with screws. All connections are hardwired to compatible pins of the processor board and the pin connections are standardized for the processor boards.

Required Materials

To get started, users will need a few of the items listed below. (You may already have a some of these items; read through the guide and modify your cart accordingly.)

MicroMod Processor Board

A processor board is required for the MicroMod system to operate. Users can choose a processor board, based upon their needs, to attach to the MicroMod M.2 connector of the main board. Below, are few options:

SparkFun MicroMod ESP32 Processor

SparkFun MicroMod ESP32 Processor

WRL-16781
$16.95
SparkFun MicroMod SAMD51 Processor

SparkFun MicroMod SAMD51 Processor

DEV-16791
$18.95
SparkFun MicroMod nRF52840 Processor

SparkFun MicroMod nRF52840 Processor

WRL-16984
$19.95
SparkFun MicroMod STM32 Processor

SparkFun MicroMod STM32 Processor

DEV-17713
$14.95

MicroMod Main Board

A main board provides the electrical connections between the function and processor boards to operate. Users can choose a main board based upon their needs. Below, are few options:

SparkFun MicroMod Main Board - Single

SparkFun MicroMod Main Board - Single

DEV-18575
$14.95
SparkFun MicroMod Main Board - Double

SparkFun MicroMod Main Board - Double

DEV-18576
$17.95

Required Hardware

A Phillips screw driver is necessary to attach the processor board and function board(s) to the main board. Additionally, a USB-C cable is needed to connect the main board to a computer. The LoRa function board also requires a LoRa antenna for the transceiver to operate.

USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$4.95
3
SparkFun Mini Screwdriver

SparkFun Mini Screwdriver

TOL-09146
$0.95
3

Below, is a selection of our 915MHz frequency band RP-SMA antennas.

915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/2 Wave 2dBi

WRL-14876
$7.95
Pycom LoRa and Sigfox Antenna Kit - 915MHz

Pycom LoRa and Sigfox Antenna Kit - 915MHz

WRL-14676
$11.95
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

Optional Hardware

A LoRa gateway provides internet connection for LoRaWAN network. Below are a few options from our LoRa product category.

Nebra Outdoor HNT Hotspot Miner (915MHz)

Nebra Outdoor HNT Hotspot Miner (915MHz)

WRL-17844
10
LoRa Raspberry Pi 4 Gateway with Enclosure

LoRa Raspberry Pi 4 Gateway with Enclosure

WRL-16447
3
Nebra Indoor HNT Hotspot Miner (915MHz)

Nebra Indoor HNT Hotspot Miner (915MHz)

WRL-17843
13

Users can also use other LoRa boards for peer-to-peer communication. Below are a few options from our LoRa product category.

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

SparkFun Pro RF - LoRa, 915MHz (SAMD21)

WRL-15836
$31.50
SparkFun LoRa Thing Plus - expLoRaBLE

SparkFun LoRa Thing Plus - expLoRaBLE

WRL-17506
$49.95
2
Interface Cable RP-SMA to U.FL

Interface Cable RP-SMA to U.FL

WRL-00662
$4.95
1
915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

915MHz LoRa Antenna RP-SMA - 1/4 Wave 2dBi

WRL-14875
$8.95

To modify the jumpers, users will need soldering equipment and/or a knife.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

TOL-09325
$8.95
7
Chip Quik No-Clean Flux Pen  - 10mL

Chip Quik No-Clean Flux Pen - 10mL

TOL-14579
$7.95
4
Weller WLC100 Soldering Station

Weller WLC100 Soldering Station

TOL-14228
$67.95
2
Hobby Knife

Hobby Knife

TOL-09200
$2.95
2

Suggested Reading

The MicroMod ecosystem is a unique way to allow users to customize their project to their needs. Click on the banner below for more information.

MicroMod Logo


For users who aren't familiar with the following concepts, we also recommend reading the following tutorials before continuing.

Serial Communication

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

Serial Peripheral Interface (SPI)

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

Pulse Width Modulation

An introduction to the concept of Pulse Width Modulation.

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.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

Processor Interrupts with Arduino

What 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.

SparkFun expLoRaBLE Hookup Guide

Check out our latest LoRaWAN development board with Bluetooth capabilities! With this guide, we'll get you passing data to The Things Network in no time.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Designing with MicroMod

This tutorial will walk you through the specs of the MicroMod processor and carrier board as well as the basics of incorporating the MicroMod form factor into your own PCB designs!
New!

MicroMod Main Board Hookup Guide

The MicroMod Main Board - Single and Double are specialized carrier boards that allow you to interface a Processor Board with a Function Board(s). The modular system allows you to add an additional feature(s) to a Processor Board with the help of a Function Board(s). In this tutorial, we will focus on the basic functionality of the Main Board - Single and Main Board - Double.

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.

Installing Arduino IDE

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

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Hardware Overview

Board Dimensions

The overall board dimensions are roughly 65 x 35 mm with an approximate 6 mm protrusion of the RP-SMA antenna connector.

board dimensions
The dimensions for the LoRa MicroMod Function Board. (Click to enlarge)

M.2 Edge Connector and Screw Slots

Like other function and processor boards, there is a polarized M.2 edge connector, which provides a standardized electrical connection. The attachment points for the screws prevent users from connecting a processor board into a function board slot and vice-versa.

function board attachment points
The Micromod M.2 edge connector and screw slots on the LoRa Function Board. (Click to enlarge)

Power

There is a power status LED to help make sure that your LoRa function board is getting (5V) power. Power is provided through the (MicroMod) M.2 edge connector. The LoRa module is meant to run on 5V with 3.3V logic levels. A jumper is available on the back of the board to remove power to the LED for low-power applications (see the Jumpers section below).

power led
Power LED on the LoRa MicroMod Function Board. (Click to enlarge)

E19-915M30S LoRa Module

Note: The range verification was performed in a clear and open area (direct line-of-sight) with a 5dBi antenna gain, height of 2.5m, and data rate 0.3 kbps. Users results may vary.

The Chengdu Ebyte E19-915M30S RF transceiver module is a 1W 915MHz LoRa module, based on the SX1276 from Semtech. It is FCC, CE, and RoHS certified and has been tested up to a range of 10km by the manufacturer. PLease refer to the datasheet for more details.

  • Global license free ISM 915MHz band
  • 1W maximum transmission power
    • Software multi-level adjustable
  • 256Byte FIFO data buffer

SX1276

The E19-915M30S transceiver is based on the SX1276 chip from Semtech. Please refer to the datasheet for more details.

Part NumberSX1276
Frequency Range137 - 1020 MHz
Spreading Factor6 - 12
Bandwidth7.8 - 500 kHz
Effective Bitrate.018 - 37.5 kbps
Est. Sensitivity-111 to -148 dBm
CharacteristicDescription
Operating Voltage3.3 - 5.5 V
Current Consumption 630 mA (TX)) 23 mA (RX)) 3 µA (Sleep)
Operating Temperature-40 - 85 °C
Operating Humidity[1]10 - 90%
Communication InterfaceSPI (0 - 10 Mbps)
Logic Level3.3 V
Frequency Range900 - 931 MHz
Transmit Power28.5 - 30 dBm (max)
ModulationLoRa, FSK, GFSK, MSK, GMSK, OOK
Data Rate FSK: 1.2 - 300 kbps
LoRa: 0.018 - 37.5 kbps
Antenna Impedance50 &ohm;

LoRa module
The E19-915M30S RF transceiver module on the LoRa MicroMod Function Board. (Click to enlarge)

Pin Connections

Below is a table of the pin connections available on the E19-915M30S RF transceiver module. However, not all the pins listed are utilized by the LoRa function board (see the Function Board Pinout Table section below).

Pin #Pin NameI/O DirectionPin Description
1GNDGround
2DIO5Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
3DIO4Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
4DIO3Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
5DIO2Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
6DIO1Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
7DIO0Input/OutputConfigurable IO port(Please refer to the SX1276 datasheet).
8RSTInputReset
9GNDGround
10GNDGround
11VCCInputPower supply: 4.75~5.5V (Ceramic filter capacitoris advised to add)
12SCKInputSPI - Clock Signal
13MISOOutputSPI - Data from Peripheral Device
14MOSIInputSPI - Data to Peripheral Device
15NSSInputSPI - Chip Select
16TXENInputRadio frequency switch control, make sure the TXEN pin is in high level, RXEN pin is in low level when transmitting.
17RXENInputRadio frequency switch control, make sure the RXEN pin is in high level, TXEN pin is in low level when receiving.
18GNDGround
19ANTAntenna
20GNDGround
21GNDGround
22GNDGround

MicroMod Edge Connector

The MicroMod M.2 edge connector provides a standardized interface for the pin connection of a function board.

function board edge connector
The Micromod M.2 edge connector on the LoRa Function Board. (Click to enlarge)

Function Board Pinout Table

The tables below outline the pin on the M2. edge connector and their functions.

AUDIOUARTGPIO/BUSI2CSDIOSPI0Dedicated
FunctionsBottom
Pin
   Top   
Pin
Functions
(Not Connected)75GND
3.3V7473G5 / BUS5
RTC_3V_BATT7271G6 / BUS6
SPI_CS1#SDIO_DATA3 (I/O)7069G7 / BUS7
SDIO_DATA2 (I/O)6867G8
SDIO_DATA1 (I/O)6665G9ADC_D- CAM_HSYNC
SPI_CIPO1SDIO_DATA0 (I/O)6463G10ADC_D+CAM_VSYNC
SPI COPI1SDIO_CMD (I/O)6261SPI_CIPO (I)
SPI SCK1SDIO_SCK (O)6059SPI_COPI (O)LED_DAT
AUD_MCLK (O)5857SPI_SCK (O)LED_CLK
CAM_MCLKPCM_OUTI2S_OUTAUD_OUT5655SPI_CS#
CAM_PCLKPCM_INI2S_INAUD_IN5453I2C_SCL1 (I/O)
PDM_DATAPCM_SYNCI2S_WSAUD_LRCLK5251I2C_SDA1 (I/O)
PDM_CLKPCM_CLKI2S_SCKAUD_BCLK5049BATT_VIN / 3 (I - ADC) (0 to 3.3V)
G4 / BUS44847PWM1
G3 / BUS34645GND
G2 / BUS24443CAN_TX
G1 / BUS14241CAN_RX
G0 / BUS04039GND
A13837USBHOST_D-
GND3635USBHOST_D+
A03433GND
PWM03231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423SWDIO
UART_TX2 (O)2221SWDCK
UART_RX2 (I)2019UART_RX1 (I)
CAM_TRIGD11817UART_TX1 (0)
I2C_INT#1615UART_CTS1 (I)
I2C_SCL (I/0)1413UART_RTS1 (O)
I2C_SDA (I/0)1211BOOT (I - Open Drain)
D0109USB_VIN
SWOG1187GND
RESET# (I - Open Drain)65USB_D-
3.3V_EN43USB_D+
3.3V21GND
LoRa Func. Board PinFunctionBottom
Pin
   Top   
Pin
FunctionsLoRa Func. Board Pin
(Not Connected)-75GND
VIN74733.3V3.3V IN
VCC INVIN7271Power ENPower EN
-7069-
-6665-
-6463-
-6261F7
-6059F6LoRa DIO2
-5857F5LoRa DIO1
-5655F4LoRa RST
-5453F3LoRa RX EN
-5251F2PWMLoRa TX EN
-5049F1SPI_CS0LoRa NSS (CS)
-4847F0INTLoRa DIO0
-4645GND
-4443-
-4241-
EEPROM WP-4039GND
A03837USBHOST_D-
EEPROM A0EEPROM_A03635USBHOST_D+
EEPROM A1EEPROM_A13433GND
EEPROM A2EEPROM_A23231Module Key
Module Key3029Module Key
Module Key2827Module Key
Module Key2625Module Key
Module Key2423I2C_INT
2221I2C_SCLEEPROM SCL
2019I2C_SDAEEPROM SDA
UART_CTS1817
UART_RTS1615UART_RX
1413UART_TX
1211GND
109
87SPI_CIPOLoRa SDO
65SPI_COPILoRa SDI
43SPI_SCKLoRa SCK
21GND
Signal
Group
SignalI/ODescriptionVoltage
Power3.3VI3.3V Source3.3V
GNDReturn current path0V
USB_VINIUSB VIN compliant to USB 2.0 specification. Connect to pins on processor board that require 5V for USB functionality4.8-5.2V
RTC_3V_BATTI3V provided by external coin cell or mini battery. Max draw=100μA. Connect to pins maintaining an RTC during power loss. Can be left NC.3V
3.3V_ENOControls the carrier board's main voltage regulator. Voltage above 1V will enable 3.3V power path.3.3V
BATT_VIN/3ICarrier board raw voltage over 3. 1/3 resistor divider is implemented on carrier board. Amplify the analog signal as needed for full 0-3.3V range3.3V
ResetResetIInput to processor. Open drain with pullup on processor board. Pulling low resets processor.3.3V
BootIInput to processor. Open drain with pullup on processor board. Pulling low puts processor into special boot mode. Can be left NC.3.3V
USBUSB_D±I/OUSB Data ±. Differential serial data interface compliant to USB 2.0 specification. If UART is required for programming, USB± must be routed to a USB-to-serial conversion IC on the processor board.
USB HostUSBHOST_D±I/OFor processors that support USB Host Mode. USB Data±. Differential serial data interface compliant to USB 2.0 specification. Can be left NC.
CANCAN_RXICAN Bus receive data.3.3V
CAN_TXO CAN Bus transmit data.3.3V
UARTUART_RX1IUART receive data.3.3V
UART_TX1OUART transmit data.3.3V
UART_RTS1OUART ready to send.3.3V
UART_CTS1IUART clear to send.3.3V
UART_RX2I2nd UART receive data.3.3V
UART_TX2O2nd UART transmit data.3.3V
I2CI2C_SCLI/OI2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDAI/OI2C data. Open drain with pullup on carrier board3.3V
I2C_INT#IInterrupt notification from carrier board to processor. Open drain with pullup on carrier board. Active LOW3.3V
I2C_SCL1I/O2nd I2C clock. Open drain with pullup on carrier board.3.3V
I2C_SDA1I/O2nd I2C data. Open drain with pullup on carrier board.3.3V
SPISPI_COPIOSPI Controller Output/Peripheral Input.3.3V
SPI_CIPOISPI Controller Input/Peripheral Output.3.3V
SPI_SCKOSPI Clock.3.3V
SPI_CS#OSPI Chip Select. Active LOW. Can be routed to GPIO if hardware CS is unused.3.3V
SPI/SDIOSPI_SCK1/SDIO_CLKO2nd SPI Clock. Secondary use is SDIO Clock.3.3V
SPI_COPI1/SDIO_CMDI/O2nd SPI Controller Output/Peripheral Input. Secondary use is SDIO command interface.3.3V
SPI_CIPO1/SDIO_DATA0I/O2nd SPI Peripheral Input/Controller Output. Secondary use is SDIO data exchange bit 0.3.3V
SDIO_DATA1I/OSDIO data exchange bit 1.3.3V
SDIO_DATA2I/OSDIO data exchange bit 2.3.3V
SPI_CS1/SDIO_DATA3I/O2nd SPI Chip Select. Secondary use is SDIO data exchange bit 3.3.3V
AudioAUD_MCLKOAudio master clock.3.3V
AUD_OUT/PCM_OUT
I2S_OUT/CAM_MCLK
OAudio data output. PCM synchronous data output. I2S serial data out. Camera master clock.3.3V
AUD_IN/PCM_IN
I2S_IN/CAM_PCLK
IAudio data input. PCM syncrhonous data input. I2S serial data in. Camera periphperal clock.3.3V
AUD_LRCLK/PCM_SYNC
I2S_WS/PDM_DATA
I/OAudio left/right clock. PCM syncrhonous data SYNC. I2S word select. PDM data.3.3V
AUD_BCLK/PCM_CLK
I2S_CLK/PDM_CLK
OAudio bit clock. PCM clock. I2S continuous serial clock. PDM clock.3.3V
SWDSWDIOI/OSerial Wire Debug I/O. Connect if processor board supports SWD. Can be left NC.3.3V
SWDCKISerial Wire Debug clock. Connect if processor board supports SWD. Can be left NC.3.3V
ADCA0IAnalog to digital converter 0. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
A1IAnalog to digital converter 1. Amplify the analog signal as needed to enable full 0-3.3V range.3.3V
PWMPWM0OPulse width modulated output 0.3.3V
PWM1OPulse width modulated output 1.3.3V
DigitalD0I/O General digital input/output pin.3.3V
D1/CAM_TRIGI/OGeneral digital input/output pin. Camera trigger.3.3V
General
Bus
G0/BUS0I/OGeneral purpose pins. Any unused processor pins should be assigned to Gx with ADC + PWM capable pins given priority (0, 1, 2, etc.) positions. The intent is to guarantee PWM, ADC and Digital Pin functionality on respective ADC/PWM/Digital pins. Gx pins do not guarantee ADC/PWM function. Alternative use is pins can support a fast read/write 8-bit or 4-bit wide bus.3.3V
G1/BUS1I/O3.3V
G2/BUS2I/O3.3V
G3/BUS3I/O3.3V
G4/BUS4I/O3.3V
G5/BUS5I/O3.3V
G6/BUS6I/O3.3V
G7/BUS7I/O3.3V
G8I/OGeneral purpose pin3.3V
G9/ADC_D-
CAM_HSYNC
I/ODifferential ADC input if available. Camera horizontal sync.3.3V
G10/ADC_D+
CAM_VSYNC
I/ODifferential ADC input if available. Camera vertical sync.3.3V
G11/SWOI/OGeneral purpose pin. Serial Wire Output3.3V

EEPROM

There is an I2C serial EEPROM on the LoRa function board. It has been reserved for future use, but users have access to it. A jumper is available on the back of the board to write protect the EEPROM (see the Jumpers section below).

EEPROM
EEPROM on the LoRa MicroMod Function Board. (Click to enlarge)

RP-SMA Antenna Connector

Warning: Users should attach the antenna before powering their LoRa function board. Transmitting without an antenna connected may potentially damage the transceiver module.

The LoRa function board features a sturdy RP-SMA antenna connector for users to attach an antenna of their choice. While this antenna connector is fairly robust, users should not expect to leverage a lot of weight off of it.

The edge-type antenna connector allows for the threads to protrude just beyond the edge of the board. Along with the dimensions of the LoRa function board, this feature is designed so that the connection also extends past the edge of the main board that the function board interfaces with; and is therefore, well suited to be used with an enclosure.

Antenna Connector
RP-SMA antenna connector on the LoRa MicroMod Function Board. (Click to enlarge)

Note: Users who wish to use the u.FL connector can modify the position of this 0&ohm; resistor. Due to the size and position of the resistor, we only recommended for highly experience soldering experts attempt this modification. More novice users could potentially damage their LoRa function board if they attempt this modification.

antenna jumper
Antenna select jumper on the E19-915M30S RF transceiver module. (Click to enlarge)

Jumpers

There are three jumpers available on the LoRa function board.

LED Power

For more low power projects, the PWR jumper can be cut to remove power from the red power LED.

LED power jumper
LED power jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Current Measurement

For users who would like to measure the current going to LoRa function board, the MEAS jumper can be cut and used for measurements. This jumper is only connected to the 5V power, which is used by only the E19-915M30S RF transceiver module and power LED.

Current measurement jumper
Current measurement jumper on the LoRa MicroMod Function Board. (Click to enlarge)

EEPROM Write Protection

To permanently write protect the EEPROM on the LoRa function board, users can bridge the WP jumper.

EEPROM WP jumper
EEPROM WP jumper on the LoRa MicroMod Function Board. (Click to enlarge)

Software Overview

Getting Started with MicroMod

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide. Also, make sure that the correct board definitions are installed in the Arduino IDE, for the associated processor board.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Programming

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the connected processor board. Depending on the processor board, users may need to install drivers (if they have not done so already). For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Arduino Library

Note: The example for this tutorial assumes users have the latest version of the Arduino IDE installed. 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:

Installing an Arduino Library

January 11, 2013

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.

SparkFun External EEPROM Arduino Library

We've written a library to easily get setup and read/write data on the EEPROM. You can install this library through the Arduino Library Manager. Search for SparkFun External EEPROM Arduino Library and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

For more details on this Arduino library and its use, please refer to the Serial EEPROM hookup guide:

Reading and Writing Serial EEPROMs

August 11, 2017

EEPROM is a great way to add extra memory to your microcontroller project. Wait 'til you see how easy it is to use!

RadioLib Arduino Library

The RadioLib library provides support for peer-to-peer RF communication with the 1W LoRa MicroMod Function Board. Users can install this library through the Arduino Library Manager. Search for RadioLib and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

Note: Peer-to-peer refers to direct RF communication using a specific modulation protocol (similar to a 2-way walkie talkie); and is not to be confused with a mesh network or LoRaWAN network integration.

For more details on this Arduino library, check out the Arduino reference page, the API refernce page, and GitHub repository. Additional specifics of the library that users may be interested in can be found in the links below:

LoRaWAN Library

The MCCI LoRaWAN LMIC Library library provides support for an end node/device (i.e. 1W LoRa MicroMod Function Board) integration into a LoRaWAN network and communication with a LoRaWAN server. Users can install this library through the Arduino Library Manager. Search for MCCI LoRaWAN LMIC and you should be able to install the latest version. If you prefer manually downloading the libraries from the GitHub repository, you can grab them here:

Notes:
  • Initially we were inclined to utilize the Arduino-LMIC library. However, we followed the repository's recommendation and chose to utilize the MCCI LoRaWAN LMIC Library instead.
  • Support for this library has only been confirmed with The Things Stack - Community Edition's (i.e. V3 or previously TTN) and Helium's servers.
  • To utilize this library, users are expected to be able to modify various files for regional configuration and compatibility with specific processor boards.
  • We assume that users are familiar with the device registration process for each LoRaWAN server. For more information, please refer to the LoRaWAN server's documentation:
    • Helium Device Registration
      • Usage Cost: 1 Data Credit (1 DC = 0.001¢ in USD) per packet (up to 24 bytes)
      • After a device is first added/registered to an account, it takes approx. 20 min for it to get added to the blockchain. Until then, hotspots will not recognize the device and relay its data packets.
    • The Things Stack Device Registration:
      • The information below also assumes that users have migrated to and are currently using The Things Stack Community Edition (or V3).
      • When manually registering a device on The Things Stack, users will need to set the LoRaWAN version to MAC V1.0.3(per the library specifications).
      • Devices registered with the V3 console will only work with gateways on the V3 console. (i.e. Data transmissions from a device registered on the V3 console will not be passed to the server, if its transmissions are only received by a gateway on registered to the V2 console.)
Warning: The Helium network is a pay-to-use 3rd party service, which does involve the use of cryptocurrency. Please, use at your own discretion.
  • We have no control over its service.
  • We are not liable for any customer's choice to utilize the network.
  • The cryptocurrency market valuation can be volitile.
  • There may be legal and financial implications for digital wallets.
  • etc.

To be able to utilize this library with the 1W LoRa function board and various MicroMod processor boards, users will need to make the following modifications to the library's files:

Regional Configuration

In the lmic_project_config.h file make sure that #define CFG_us915 1 and #define CFG_sx1276_radio 1 are uncommented.

language:c
// project-specific definitions
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au915 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP      /* for as923-JP; also define CFG_as923 */
//#define CFG_kr920 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS
Processor Board Compatibility
nRF52840 Processor Board

In the hal.cpp file, users will need to modify lines 368-370 (based on the default code) to provide compatibility with the nRF52840 processor board to the library:

language:c
#if !defined(ARDUINO_ARDUINO_NANO33BLE)
void hal_sleep () {
    // Not implemented
}
#endif // !defined(ARDUINO_ARDUINO_NANO33BLE)
Artemis Processor Board
Note: Currently, the Apollo3 Arduino core does not support the use of the noInterrupts() and Interrupts() functions. There is already an issue filed with the GitHub repository. Once this issue has been resolved, the modifications below will no longer be necessary.

In the hal.cpp file, users will need to modify lines 368-370 (based on the default code) to provide compatibility with the Artemis processor board to the library:

language:c
void hal_disableIRQs () {
    #if !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
        noInterrupts();
    #endif // !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)

    irqlevel++;
}

void hal_enableIRQs () {
    if(--irqlevel == 0) {
        #if !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
            interrupts();
        #endif // !defined(ARDUINO_APOLLO3_SFE_ARTEMIS_MM_PB)
ES32 Processor Board

In reference to issue #714 for the library, users will need to add the following lines to the end of lmic_project_config.h file, which is the same file used for the regional configuration.

language:c
#if defined(ARDUINO_ESP32_MICROMOD)
    #define hal_init LMICHAL_init  // ESP32: https://github.com/mcci-catena/arduino-lmic/issues/714
#endif // defined(ARDUINO_ESP32_MICROMOD)

Hadware Assembly

For those unfamiliar with the MicroMod ecosystem, be sure to review the Getting Started with MicroMod guide.

Getting Started with MicroMod

October 21, 2020

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

Processor Board and Main Board

To get started users will need a compatible processor and main board. Insert the MicroMod processor board into the M.2 socket for the processor board at an angle, with its edge connector aligned to the matching slots.

Note: The dimensions of the processor board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw insert is spaced to only match the screw key of MicroMod processor boards.

When inserted properly, the processor board will rest at an angle:

MicroMod processor board inserted into the carrier board
Inserting a processor board into the M.2 socket. (Click to enlarge)

To secure the processor board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod processor board attached to the Qwiic carrier board
A processor board attached to the MicroMod Qwiic Carrier Board. (Click to enlarge)

Function Board and Main Board

Warning: The LoRa module is susceptible to electrostatic discharge. Therefore, it is recommended that users a static discharge strap, like the one included in the iFixit Pro Tech Toolkit.


Static discharge strap in the upper righthand corner. (Click to enlarge)

Users should also address any humidity and temperature concerns, when utilizing the LoRa function board.

Note: The dimensions of the function board's edge connector prevents it from mating with the slots of the M.2 socket in reverse. As an extra safeguard, the screw inserts are spaced to only match the screw key of MicroMod function board.

Similarly to the processor board, insert the MicroMod function board into the M.2 socket for the function board at an angle, with its edge connector aligned to the matching slots.

When inserted properly, the function board will rest at an angle:

MicroMod function board inserted into the main board
Inserting a function board into the M.2 socket. (Click to enlarge)

To secure the function board, gently hold down on the board and attach the M.2 screw with a Phillip's head (PH0 or PH1) screw driver. Below, is an example of an assembled MicroMod system:

MicroMod function board attached to the main board
A function board attached to the MicroMod Main Board. (Click to enlarge)

Don't forget to attach the antenna for the LoRa function board. Transmitting or powering the LoRa module without an attached antenna has the potential to permanently damage the transceiver.

Fully assembled main board with processor board and function board
Fully assembled main board with processor board and function board. (Click to enlarge)

Main Board Example - Pin Connection Table

This table summarizes the pins utilized on the LoRa function board's MicroMod edge connector and their connections to the main board's processor pins; based on the slot that the LoRa function board is inserted to.

Function Board
Pin Name
MicroMod
Pin Number
I/O
Direction
Description Main Board's
Processor Pin
Slot 0Slot 1
VCC72Input Power supply: 4.75~5.5V
  • Power LED
  • Transceiver's Power
-
3.3V73Input Power supply: 3.3V
  • EEPROM's Power
  • Logc-level conversion
-
GND11-Ground-
Power Enable71InputControls the 3.3V power6866
SCK3InputSPI - Clock signal for transceiverSCK (57)
CIPO7OutputSPI - Data from transceiverCIPO (59)
COPI5InputSPI - Data to transceiverCOPI (61)
NSS49 (F1)InputSPI - Chip select for transceiverCS0 (55)CS1 (70)
RST55 (F4)InputResets transceiverG1 (42)G6 (71)
DIO047 (F0) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).D0 (10)D1 (18)
DIO157 (F5) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G2 (44)G7 (69)
DIO259 (F6) Input
Output
Transceiver's configurable IO(Please refer to the SX1276 datasheet).G3 (46)G8 (62)
TXEN51 (F2)InputTransceiver's RF control switch: The TXEN pin is in high level, RXEN pin is in low level when transmitting.PWM0 (32)PWM1 (47)
RXEN53 (F3)InputTransceiver's RF control switch: The RXEN pin is in high level, TXEN pin is in low level when receiving.G0 (40)G5 (73)
SCL21InputI2C - Clock signal for EEPROMSCL (14)
SDA19 Input
Output
I2C - Data signal for EEPROMSDA (12)
EEPROM WP40InputControls the write protection pin for the EEPROM. Pull low to enable.-
EEPROM A06InputControls EEPROM's I2C address configuration.-
EEPROM A14InputControls EEPROM's I2C address configuration.-
EEPROM A22InputControls EEPROM's I2C address configuration.-

Programming

To program the processor board utilized on the Main Board; connect the board to a computer with a USB-C cable. Depending on the processor board, users may need to install drivers (if they have not done so already).

Note: Make sure that the correct board definitions are installed in the Arduino IDE, for the selected processor board. For help installing board definitions, use the MicroMod processor boards landing page and review the associated hookup guide for that hardware.

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Peer-to-Peer Example

Note: The example codes assume that the LoRa function board is inserted into the 0function board slot of the main board.

The example codes below, allow users to communicate between two LoRa function boards. Simply download, extract the files, and upload the code the main board with associated processor and function boards.

Additional examples have also been provided for users who would like to use their expLoRable (LoRa Thing Plus) board to communicate with a LoRa function board.

The example codes were tested under the following parameters:
  • Arduino IDE version: 1.8.16
    • If not using the Teensy - Windows App Store version 1.8.51.0
  • RadioLib Library version: 4.6.0
  • MicroMod Processor Boards and Arduino Cores:
    ProcessorBoard Definition
    RP2040Arduino Mbed OS RP2040 Boards version: 2.5.2
    ESP32esp32 version: 2.0.0
    STM32SparkFun STM32 Boards version: 2.0.0
    ArtemisSparkFun Apollo3 Boards version: 2.1.1
    SAMD51SparkFun SAMD Boards (dependency Arduino SAMD Boards version 1.8.1) version: 1.8.5
    • Requires - Arduino SAMD Boards (32-bit ARM Cortex-M0+) version: 1.8.11
    nRF52840[DEPRECATED - Please install standalone packages] Arduino Mbed OS Boards version: 1.3.1
    TeensyTeensyduino version: 1.55

Once uploaded, users can open the serial monitor to view the progress of the data transmission or reception. When using the RP2040 processor board, the example code will wait until the Serial Monitor is opened to execute the code and transmit/receive data.

peer-to-peer data transmission example
An example of the data transmission between an expLoRaBLE board and the LoRa MicroMod Function Board in the Serial Monitor. (Click to enlarge)

Code Breakdown

In order to get the built-in example for the RadioLib library working, a few changes needed to be made. Below, is a short explanation of the modifications made to the example code that we provide (see above), to include compatibility with all the available processor boards.

CS Pin Definition

The SPI library for the Arduino IDE, by default expects the chip select pin to be defined as PIN_SPI_SS. However, this pin definition is different for the ESP32 and Artemis (Apollo3) Arduino cores. Therefore, the code below was inserted to allow the code to compile for all the various processor boards.

language:c
// Redefine CS Pin Name
// SPI_CS0:     ESP32
// SS:          ESP32, nRF, RP2040
// SPI_CS:      Artemis
// PIN_SPI_SS:  STM32, SAMD51, nRF, RP2040

#ifndef PIN_SPI_SS
    // For Artemis
    #ifdef SS
        #define PIN_SPI_SS SPI_CS
    #endif
    // For ESP32
    #ifdef SPI_CS0
        #define PIN_SPI_SS SS
    #endif
#endif

MicroMod Pin Names

Unfortunately, for the RP2040 MicroMod processor board hasn't been included in the MbedOS Arduino core; current progress is on hold(please refer to this issue in the GitHub repository). However, with the modifications below, the RP2040 Pico board definition can be used.

By using the RP2040 Pico board definition, the generic MicroMod processor board's pin names obviously can't be used. Therefore, all the pins must be declared by their GPIO pin numbers. In addition, the default pin connections for the SPI bus on the RP2040 MicroMod processor board differs from the RP2040 Pico. To accommodate for the different pin connections, a custom SPI object was created and passed into the library.

language:c
// SX1276 pin connections:
//       | SLOT 0 | SLOT 1 |
//==========================
// cs    |   CS0  |   CS1  |
// dio0  |   D0   |   D1   |
// dio1  |   G2   |   G7   |
// dio2  |   G3   |   G8   |
// rst   |   G1   |   G6   |
// tx_en |  PWM0  |  PWM1  |
// rx_en |   G0   |   G5   |

#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // MM RP2040 Processor Board (Using RP2040 Pico board definition)
    int pin_cs = 21;
    int pin_dio0 = 6;
    int pin_tx_enable = 13;
    int pin_rx_enable = 16;
    int pin_nrst = 17;
    int pin_dio1 = 18;

    // Redefine SPI pins
    int miso = 20;
    int mosi = 23;
    int sck = 22;

    // Custom SPI object
    MbedSPI SPI_mm(miso, mosi, sck);

    SX1276 radio = new Module(pin_cs, pin_dio0, pin_nrst, pin_dio1, SPI_mm);

#else

Similarly to the RP2040, the Teensy MicroMod processor board definition doesn't include the generic MicroMod processor board pin names yet (we are currently working on this update). Therefore, all the pins must be declared by their pin numbers.

language:c
    #if defined(ARDUINO_TEENSY_MICROMOD)
        // MM Teensy Processor Board
        int pin_cs = 10;
        int pin_dio0 = 4;
        int pin_tx_enable = 3;
        int pin_rx_enable = 40;
        int pin_nrst = 41;
        int pin_dio1 = 42;

    #else

RP2040 Special Consideration

As mentioned above, a custom SPI object was created and passed into the library for the RP2040 MicroMod processor board. However, the library doesn't initialize the SPI bus when it is passed in. Therefore, the setup() loop includes a modification to start the SPI bus operation.

In our testing, the RP2040 MicroMod processor board had issues with the printouts on the serial port. Adding a while() statement to wait for the serial port to be accessed by the Serial Monitor, resolved the issue.

language:c
#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // Wait for serial monitor/port to open
    while (!Serial){
        ; // wait for serial port
    }

    // Start SPI bus
    SPI_mm.begin();
#endif

Enabling the STM32 Serial Port

When uploading to the provided example code (see above) to the STM32 MicroMod processor board, users will need to enable the serial port on the processor board. Otherwise, when the Serial Monitor is opened, nothing will appear. The following settings must be used in the in the Tools drop down menu:

STM32 serial port configuration
The STM32 MicroMod processor board settings in the Tools drop-down menu to enable the microcontroller's serial port. (Click to enlarge)

LoRaWAN Examples

Important Notes:
  • The example below assumes that the LoRa function board is inserted into the 0function board slot of the main board.
  • While there are sketch examples built into the MCCI LoRaWAN LMIC Arduino library for both the Helium and The Things Network (TTN) servers, users should use the example code that we provide below (click the Download buttons). Otherwise, users will run into various issues.
  • The examples below, require a user account and device registration on whichever server you decide to utilize.
    • Click here to setup an account on Helium
      • Usage Cost: 1 Data Credit (1 DC = 0.001¢ in USD) per packet (up to 24 bytes)
      • After a device is first added/registered to an account, it takes approx. 20 min for it to get added to the blockchain. Until then, hotspots will not recognize the device and relay its data packets.
    • Click here to setup an account on The Things Stack
      • The information below also assumes that users have migrated to and are currently using The Things Stack Community Edition (or V3).
      • Devices registered with the V3 console will only work with gateways on the V3 console. (i.e. Data transmissions from a device registered on the V3 console will not be passed to the server, if its transmissions are only received by a gateway on registered to the V2 console.)
Warning: The Helium network is a pay-to-use 3rd party service, which does involve the use of cryptocurrency. Please, use at your own discretion.
  • We have no control over its service.
  • We are not liable for any customer's choice to utilize the network.
  • The cryptocurrency market valuation can be volitile.
  • There may be legal and financial implications for digital wallets.
  • etc.

Our example codes below, allow users to communicate with a LoRaWAN server (through a connected gateway) with the LoRa function board. Simply download, extract the file, modify the sketch to include a registered device's EUIs and application key, and then upload the code the main board with associated processor and function board.

The example codes were tested under the following parameters:
  • Arduino IDE version: 1.8.16
    • If not using the Teensy - Windows App Store version 1.8.51.0
  • MCCI LoRaWAN LMIC Library version: 4.1.0
  • MicroMod Processor Boards and Arduino Cores:
    ProcessorBoard Definition
    RP2040Arduino Mbed OS RP2040 Boards version: 2.5.2
    ESP32esp32 version: 2.0.0
    STM32SparkFun STM32 Boards version: 2.0.0
    ArtemisSparkFun Apollo3 Boards version: 2.1.1
    SAMD51SparkFun SAMD Boards (dependency Arduino SAMD Boards version 1.8.1) version: 1.8.5
    • Requires - Arduino SAMD Boards (32-bit ARM Cortex-M0+) version: 1.8.11
    nRF52840[DEPRECATED - Please install standalone packages] Arduino Mbed OS Boards version: 1.3.1
    TeensyTeensyduino version: 1.55

Configuring the End Device Information

Once users have registered/added an end (i.e. node) device to their user account, they will need to modify the example sketch to include their device's application EUI (APPEUI), device EUI (DEVEUI), and application key (APPKEY) (provided by the server at the end of the device registration process). Simply, replace the FILLMEIN value in { FILLMEIN }, inside of the sketch at these locations:

  • static const u1_t PROGMEM APPEUI[8]={ FILLMEIN };
  • static const u1_t PROGMEM DEVEUI[8]={ FILLMEIN };
  • static const u1_t PROGMEM APPKEY[16] = { FILLMEIN };

in this section of the sketch:

language:c
// For normal use, we require that you edit the sketch to replace FILLMEIN
// with values assigned by the TTN console. 
//# warning "You must replace the values marked FILLMEIN with real values from the TTN control panel!"

// This EUI must be in little-endian format, so least-significant-byte
// first. When copying an EUI from ttnctl output, this means to reverse
// the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,
// 0x70. For Helium issued EUIs the last bytes should be 0xF9, 0x81, 0x60.
static const u1_t PROGMEM APPEUI[8]={ FILLMEIN };
void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}

// This should also be in little endian format, see above.
static const u1_t PROGMEM DEVEUI[8]={ FILLMEIN };
void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}

// This key should be in big endian format (or, since it is not really a
// number but a block of memory, endianness does not really apply). In
// practice, a key taken from ttnctl can be copied as-is.
static const u1_t PROGMEM APPKEY[16] = { FILLMEIN };
void os_getDevKey (u1_t* buf) {  memcpy_P(buf, APPKEY, 16);}

The format of the values should be in a hex format, as shown in the example code below. Users should doublecheck they haven't mixed up their APPEUI and DEVEUI values and that they have entered those values with the least significant byte (lsb) first. These are the most likely culprits, if users aren't seeing a join/accept response or data transmissions in the LoRaWAN server's console or the serial terminal.

language:c
// This EUI must be in little-endian format, so least-significant-byte
// first. When copying an EUI from ttnctl output, this means to reverse
// the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,
// 0x70. For Helium issued EUIs the last bytes should be 0xF9, 0x81, 0x60.
static const u1_t PROGMEM APPEUI[8]={ 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x## };
void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}

// This should also be in little endian format, see above.
static const u1_t PROGMEM DEVEUI[8]={ 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x## };
void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}

// This key should be in big endian format (or, since it is not really a
// number but a block of memory, endianness does not really apply). In
// practice, a key taken from ttnctl can be copied as-is.
static const u1_t PROGMEM APPKEY[16] = { 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x##, 0x## };
void os_getDevKey (u1_t* buf) {  memcpy_P(buf, APPKEY, 16);}

Once uploaded, users can open the serial monitor to view the progress of the device joining their chosen server's network and data transmissions. When using the RP2040 processor board, the example code will wait until the Serial Monitor is opened to execute the code. Users can also view the same information in the server's console, device information page.

Code Breakdown

In order to get the built-in example for the MCCI LoRaWAN LMIC library working, a few changes needed to be made. Below, is a short explanation of the modifications made to the example code that we provide (see above), to include compatibility with all the available processor boards and improve the code performance.

CS Pin Definition

The SPI library for the Arduino IDE, by default expects the chip select pin to be defined as PIN_SPI_SS. However, this pin definition is different for the ESP32 and Artemis (Apollo3) Arduino cores. Therefore, the code below was inserted to allow the code to compile for all the various processor boards.

language:c
// Redefine CS Pin Name
// SPI_CS0:     ESP32
// SS:          ESP32, nRF, RP2040
// SPI_CS:      Artemis
// PIN_SPI_SS:  STM32, SAMD51, nRF, RP2040

#ifndef PIN_SPI_SS
    // For Artemis
    #ifdef SS
        #define PIN_SPI_SS SPI_CS
    #endif // SS
    // For ESP32
    #ifdef SPI_CS0
        #define PIN_SPI_SS SS
    #endif // SPI_CS0
#endif // PIN_SPI_SS

MicroMod Pin Names

Unfortunately, for the RP2040 MicroMod processor board hasn't been included in the MbedOS Arduino core; current progress is on hold(please refer to this issue in the GitHub repository). However, with the modifications below, the RP2040 Pico board definition can be used.

By using the RP2040 Pico board definition, the generic MicroMod processor board's pin names obviously can't be used. Therefore, all the pins must be declared by their GPIO pin numbers. In addition, the default pin connections for the SPI bus on the RP2040 MicroMod processor board differs from the RP2040 Pico. To accommodate for the different pin connections, a custom SPI object was created.

language:c
// SX1276 pin connections:
//       | SLOT 0 | SLOT 1 |
//==========================
// cs    |   CS0  |   CS1  |
// dio0  |   D0   |   D1   |
// dio1  |   G2   |   G7   |
// dio2  |   G3   |   G8   |
// rst   |   G1   |   G6   |
// tx_en |  PWM0  |  PWM1  |
// rx_en |   G0   |   G5   |

#if !defined(USE_STANDARD_PINMAP)
// All pin assignments use Arduino pin numbers (e.g. what you would pass
// to digitalWrite), or LMIC_UNUSED_PIN when a pin is not connected.
    const lmic_pinmap lmic_pins = {
        #if defined(ARDUINO_RASPBERRY_PI_PICO)
            // MM RP2040 Processor Board (Using RP2040 Pico board definition)
            .nss =  21, //Chip Select
            .rxtx = LMIC_UNUSED_PIN,
            .rst =  17,
            .dio =  {6, 18, LMIC_UNUSED_PIN},

Similarly to the RP2040, the Teensy MicroMod processor board definition doesn't include the generic MicroMod processor board pin names yet (we are currently working on this update). Therefore, all the pins must be declared by their pin numbers.

language:c
#elif defined(ARDUINO_TEENSY_MICROMOD)
    // MM Teensy Processor Board
    .nss =  10, //Chip Select
    .rxtx = LMIC_UNUSED_PIN,
    .rst =  41,
    .dio =  {4, 42, LMIC_UNUSED_PIN},

RP2040 Special Consideration

As mentioned above, a custom SPI object was created. However, the custom SPI object must be passed into code execution for the RP2040 MicroMod processor board. Therefore, the setup() loop includes a modification to do this. Additionally, during our testing, the RP2040 MicroMod processor board had issues with the printouts on the serial port. Including a while() statement to wait for the serial port to be accessed by the Serial Monitor, resolved the issue.

language:c
#if defined(ARDUINO_RASPBERRY_PI_PICO)
    // Wait for serial monitor/port to open
    while (!Serial)
        ; // wait for serial port

// Pass object back into SPI
SPI = SPI_mm;
#endif // defined(ARDUINO_RASPBERRY_PI_PICO)

Helium Network Configuration

In order to improve the performance of the example code, the modifications below were made to address a clock timing issue and limit the transmission band.

language:c
// allow much more clock error than the X/1000 default. See:
// https://github.com/mcci-catena/arduino-lorawan/issues/74#issuecomment-462171974
// https://github.com/mcci-catena/arduino-lmic/commit/42da75b56#diff-16d75524a9920f5d043fe731a27cf85aL633
// the X/1000 means an error rate of 0.1%; the above issue discusses using values up to 10%.
// so, values from 10 (10% error, the most lax) to 1000 (0.1% error, the most strict) can be used.
LMIC_setClockError(1 * MAX_CLOCK_ERROR / 40);

LMIC_setLinkCheckMode(0);
LMIC_setDrTxpow(DR_SF7,14);

#if CFG_LMIC_US_like
    // This makes joins faster in the US because we don't wander all over the
    // spectrum.
    LMIC_selectSubBand(1);
#endif

Enabling the STM32 Serial Port

When uploading to the provided example code (see above) to the STM32 MicroMod processor board, users will need to enable the serial port on the processor board. Otherwise, when the Serial Monitor is opened, nothing will appear. The following settings must be used in the in the Tools drop down menu:

STM32 serial port configuration
The STM32 MicroMod processor board settings in the Tools drop-down menu to enable the microcontroller's serial port. (Click to enlarge)

Resources and Going Further

For more information on the SparkFun 1W LoRa Function Board, check out the links below:

Hardware Documentation:

MicroMod Documentation:

Looking for more inspiration? Check out these other tutorials related to MicroMod.

Getting Started with MicroMod

Dive into the world of MicroMod - a compact interface to connect a microcontroller to various peripherals via the M.2 Connector!

MicroMod Weather Carrier Board Hookup Guide

A quick guide to help to create your own MicroMod weather station using the MicroMod Weather Carrier Board and Processor of your choice.

MicroMod SAMD51 Processor Board Hookup Guide

This tutorial covers the basic functionality of the MicroMod SAMD51 and highlights the features of the ARM Cortex-M4F development board.

MicroMod Machine Learning Carrier Board Hookup Guide

Get hacking with this tutorial on our Machine Learning Carrier Board!

MicroMod nRF52840 Processor Hookup Guide

Get started with the MicroMod nRF52840 Processor following this guide.

Qwiic Carrier Board Hookup Guide

The Qwiic carrier board is the latest way to rapid prototype with the included M.2 socket to swap processor boards and Qwiic connectors to easily connect I2C devices.

MicroMod STM32 Processor Hookup Guide

Get started with the MicroMod Ecosystem and the STM32 Processor Board!
New!

MicroMod Main Board Hookup Guide

The MicroMod Main Board - Single and Double are specialized carrier boards that allow you to interface a Processor Board with a Function Board(s). The modular system allows you to add an additional feature(s) to a Processor Board with the help of a Function Board(s). In this tutorial, we will focus on the basic functionality of the Main Board - Single and Main Board - Double.

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado

Viewing all 1123 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>