Quectel BG96 topic
- Introduction
- Connecting a BG96 to a Mayfly
- Manufacturer Documentation
- Modem Constructor
- Example Code
- Reference
- Detailed Descriptions
Introduction
The Quectel BG96 is another LTE CatM1/NB1 chip. This same constructor should work for most boards based on this chip, including the Dragino and Nimbelink boards.
This is the only cellular module that I have found to function well on only a 500mA power supply - provided the cellular signal is strong and 2G fallback isn't required. To enable 2G fallback, expect power draws of up to 2A.
Connecting a BG96 to a Mayfly
To my knowledge, there are not any Quectel BG96 modules available that can directly connect to a Mayfly. Although both the Dragino and Nimbelink boards linked above would fit the physical XBee footprint on the Mayfly, neither will work without some additional interface or other modifications. The Dragino module comes really close, but it will not actually work because the BG96 requires more power than the Mayfly can provide on its own but cannot be connected directly to a LiPo because it cannot handle a voltage over 3.6V. The Nimbelink module has the same power supply problem, voltage reference problems, and requires 3 extra ground pins that aren't available on the Mayfly.
Manufacturer Documentation
The module datasheet and AT commands are available here: https:/
Modem Constructor
Construct a new Quectel BG96 object. The constuctor initializes all of the provided member variables, constructs a loggerModem parent class with the appropriate timing for the module, calls the constructor for a TinyGSM modem on the provided modemStream, and creates a TinyGSM Client linked to the modem. Should be set to a negative number if the modem should be continuously powered or the power cannot be controlled by the MCU.
Should be set to a negative number if the modem status pin cannot be read. This is the pin labeled
QuectelBG96::
Parameters
modemStream
The Arduino stream instance for serial communication.
powerPin
The digital pin number of the mcu pin controlling power to the modem (active
HIGH
).
statusPin
The digital pin number of the mcu pin connected to the modem status output pin.
modemResetPin
The digital pin number of the pin on the mcu attached the the hard or panic reset pin of the modem.
modemSleepRqPin
The digital pin number of a pin on the mcu used to request the modem enter its lowest possible power state.
apn
The Access Point Name (APN) for the SIM card.
STATUS
in Quectel's integration guide.
Should be set to a negative number if the modem reset pin is not connected to the MCU. This is the pin labeled RESET_N
in Quectel's integration guide.
Should be set to a negative number if there is no pin usable for deep sleep modes or it is not accessible to the MCU. This is the pin labeled PWRKEY
in Quectel's integration guide.
Example Code
The Quectel BG96 is used in the menu a la carte.
Classes
- class QuectelBG96
- The loggerModem subclass for Dragino, Nimbelink, or any other module based on the Quectel BG96.
Modem Pin Settings and Timing
The timing and pin level settings for a Quectel BG96
- #define BG96_STATUS_LEVEL = HIGH
- The loggerModem::
_statusLevel. - #define BG96_STATUS_TIME_MS = 5000L
- The loggerModem::
_statusTime_ms. - #define BG96_RESET_LEVEL = LOW
- The loggerModem::
_resetLevel. - #define BG96_RESET_PULSE_MS = 300
- The loggerModem::
_resetPulse_ms. - #define BG96_WAKE_LEVEL = LOW
- The loggerModem::
_wakeLevel. - #define BG96_WAKE_PULSE_MS = 110
- The loggerModem::
_wakePulse_ms. - #define BG96_WAKE_DELAY_MS = 100
- The loggerModem::
_wakeDelayTime_ms. - #define BG96_ATRESPONSE_TIME_MS = 10000L
- The loggerModem::
_max_atresponse_time_ms. - #define BG96_DISCONNECT_TIME_MS = 5000L
- The loggerModem::
_disconnetTime_ms.
Define documentation
#define BG96_STATUS_LEVEL = HIGH
#include <src/modems/QuectelBG96.h>
The loggerModem::
Status of the BG96 can be monitored on the STATUS(D0)
pin. Time after end pulse until status pin becomes active is 4.8s.
#define BG96_STATUS_TIME_MS = 5000L
#include <src/modems/QuectelBG96.h>
The loggerModem::
Status of the BG96 can be monitored on the STATUS(D0)
pin. Time after end pulse until status pin becomes active is 4.8s.
#define BG96_RESET_LEVEL = LOW
#include <src/modems/QuectelBG96.h>
BG96 is reset with a 150-460ms low pulse on the RESET_N
pin
#define BG96_RESET_PULSE_MS = 300
#include <src/modems/QuectelBG96.h>
The loggerModem::
BG96 is reset with a 150-460ms low pulse on the RESET_N
pin
#define BG96_WAKE_LEVEL = LOW
#include <src/modems/QuectelBG96.h>
Module is switched on by a >100 millisecond LOW
pulse on the PWRKEY
pin. Module is switched on by a >650 millisecond LOW
pulse on the PWRKEY
pin. Using something between those times for wake and using AT commands for sleep, we should keep in the proper state.
#define BG96_WAKE_PULSE_MS = 110
#include <src/modems/QuectelBG96.h>
The loggerModem::
Module is switched on by a >100 millisecond LOW
pulse on the PWRKEY
pin. Module is switched on by a >650 millisecond LOW
pulse on the PWRKEY
pin. Using something between those times for wake and using AT commands for sleep, we should keep in the proper state.
#define BG96_WAKE_DELAY_MS = 100
#include <src/modems/QuectelBG96.h>
The loggerModem::
Time after VBAT
is stable before PWRKEY
can be used on BG96 is >30ms
#define BG96_ATRESPONSE_TIME_MS = 10000L
#include <src/modems/QuectelBG96.h>
The loggerModem::
The BG96 has USB active at >4.2 sec, status at >4.8 sec, URAT at >4.9
#define BG96_DISCONNECT_TIME_MS = 5000L
#include <src/modems/QuectelBG96.h>
The loggerModem::
Documentation for the BG96 says to allow >2s for clean shutdown.