Child pages
  • Digi International XBee Cellular LTE CAT 1
Skip to end of metadata
Go to start of metadata

Introduction

Since the Internet of Things (IoT) has had some time to grow, companies are starting to realize a large market for slower and smaller cellular devices. A typical IoT system will wake up after a long interval just to send out a small amount of data before going back to sleep. There are cellular modules as well as very cheap plans that can support these systems. For a more detailed explanation, read IoT, Slower, Small and Lower is Better! Digi International’s XBee Cellular LTE CAT 1 is one of these modules and making it a standalone device will be the focus of this article.

Resources

Throughout this article there will be references to where the information came from. They will be located below the title of that part and will reference one of the two below guides as well as the section they were found in. 

(90002219) Digi MicroPython Programming Guide

Interactive

https://www.digi.com/resources/documentation/Digidocs/90002219/

PDF

https://www.digi.com/resources/documentation/Digidocs/PDFs/90002219.pdf

(90001525) Digi XBee Cellular Embedded Modem User Guide

Interactive

https://www.digi.com/resources/documentation/digidocs/90001525/

PDF

https://www.digi.com/resources/documentation/digidocs/PDFs/90001525.pdf

Power Limitations

Analog is 0-2.5V not 3.3V

90002219->Examples->I/O Pins->Measure voltage on the pin

The ADC inputs provide 12-bit values but will read the max value of 4095 at 2.5V which means if you have a 3.3V sensor connected to it you will need to look at offsetting the values otherwise you will see 100% feedback when it will really only be about 75%. 

Sourcing and Sinking Current Restrictions

90001525->Technical Specs->Electrical Specifications

Making sure you don’t burn up the device is another problem to keep in mind. The outputs and inputs are only able to source or sink 6mA of current per pin. To power larger devices you will have to use a solid state relay since standard coil relays typically use far more than 6mA of current. 

Helpful Information

List of all the Ctrl commands

90002219->Examples->REPL

Ctrl+A: Enter raw REPL mode

Ctrl+B: Print the MicroPython banner

Ctrl+C: Regain control of the terminal

Ctrl+D: Reboot the MicroPython REPL

Ctrl+E: Enter paste mode

Ctrl+F: Upload code to flash

Ctrl+R: Run code in flash

Pinout

90001525->Hardware->Pin Signals
PinNameDirectionDefaultDescription
1

VCC

  Power supply
2DOUTOutputOutputUART Data Out
3

DIN / CONFIG

InputInputUART Data In
4DIO12EitherDisabledDigital I/O 12

5

RESET

Input

  
6PWM0 / RSSI / DIO10EitherOutputPWM Output 0 / RX Signal Strength Indicator / Digital I/O 10
7PWM1 / DIO11EitherDisabledPWM Output 1 / Digital I/O 11
8[reserved]  Do not connect
9

DTR / SLEEP_RQ/ DIO8

EitherDisabledPin Sleep Control Line or Digital I/O 8
10GND  Ground
11DIO4EitherDisabledDigital I/O 4
12

CTS / DIO7

EitherOutputOutput Clear-to-Send Flow Control or Digital I/O 7
13

ON /SLEEP/DIO9

OutputOutputModule Status Indicator or Digital I/O 9
14VREF- Feature not supported on this device. Used on other XBee devices for analog voltage reference.
15Associate / DIO5EitherOutputAssociated Indicator, Digital I/O 5
16

RTS / DIO6

EitherDisabledInput Request-to-Send Flow Control, Digital I/O 6
17

AD3 / DIO3

EitherDisabledAnalog Input 3 or Digital I/O 3
18AD2 / DIO2EitherDisabledAnalog Input 2 or Digital I/O 2
19

AD1 / DIO1

EitherDisabled

Analog Input 1 or Digital I/O 1

20AD0 / DIO0EitherInputAnalog Input 0, Digital I/O 0

The Project

Introduction

This project will show the very basics of how to make Digi International’s XBee Cellular LTE CAT 1 module a standalone project. We will be simply controlling a 5V LED by texting the XBee as well as using a magnetic switch to have it text you when the switch goes off. With these basics you will be able to branch out to a variety of different projects.

Parts List

Digi XBee Cellular LTE CAT 1 Kit: 602-1975-ND

Solid State Relay: 255-1546-5-ND

Breakout Board: 1568-1099-ND

Female Headers: 1528-1392-ND

Male Headers: 929834E-01-20-ND

3.3V Power Supply: 62-1234-ND

5V Power Supply: Q972-ND

Power Barrel to Wire (x2): 839-1148-ND

Green LED: 754-1736-ND

Magnetic Door Switch: 1528-1907-ND

Breadboard, wires, wire stripper, etc.

 

I recommend getting the XBee Cellular Kit mainly because it includes the development board which is requited to program it as well as the antennas. It also included 6 months of free service so you can start experimenting and testing without setting up any cellular service.

Installing the Software

Everything was programmed using Digi’s XCTU software. Instructions on how to install and connect to the board can be found on their site.

Setup

After you get the software installed and can see that board, you will need to update the firmware. Select update next to the read and write buttons.

Be sure to change it to XBC LTE Cat 1 Verizon and select the newest firmware version.

Once the newest firmware is on there, reset all the settings to their default values just to make sure everything is correct. Once that is done, you will need to change just a couple values:

IP IP Protocol = SMS [2]

AP API Enable = MicroPython REPL [4]

The Code

Open the MicroPython Terminal. If you get a blank window, try maximizing the window. This happened to me periodically.

All code must be copied and pasted into the terminal so you will need to create your code in a text file or a Python editor. You can find a list of common commands above.

 

The below code will work while the XBee is still on the development board. To test it out, texting On or Off will control DS4 LED which is located next to the XBee module. Since the LED is active low, the instructions are reversed so texting On will actually turn it off. The relay in the schematic is active high so this will be fixed once put into the circuit. You can also press SW2 on the development board to send yourself a text.  

#Importing all the libraries
import machine
from machine import Pin             
import network
import time

#Creating all the variables and setting the pins
led = Pin("D4", Pin.OUT, value=0)
dio0 = Pin("D0", Pin.IN, Pin.PULL_UP)
c = network.Cellular()
ph = ##########    #Put the phone number that you want to text here without dashes or spaces
doorClosed = None

while (True):
    msg = c.sms_receive()
    if msg:
        if msg['message'] == "On":    #You can change the text to anything you want, but remember that it is case sensitive
            led.value(1)
        if msg['message'] == "Off":
            led.value(0)
    time.sleep_ms(150)

    if (dio0.value() == 1 and doorClosed):
        try:
            c.sms_send(ph, 'Door Opened')
        except OSError:
            print("ERROR - Failed to send SMS.")
        doorClosed = False

    if (dio0.value() == 0):
        doorClosed = True

Schematic

To make this a standalone circuit, you will need to upload the code to flash (Ctrl+F) and be sure to say yes when it asks if you want to run on start. 

Here are the project files for the above schematic, the symbols for the parts, and a footprint design for the XBee Pro.

Schematic Project.zip

Symbols.lib

XBEE_Pro.kicad_mod

Additional Resources

You can check out the video on this product and feel free to ask any questions on the TechForum.

  • No labels