In the first video (below), I introduce the nRF Thingy: 91X, which has some incredible capabilities out of the box. This makes for a nice demo, but what's really interesting is the ability to program it for your own custom low-power cellular applications.
In this writeup (and in the second video), I show how to install basic modem shell firmware on the Thingy:91 X using VSCode. Nordic's nRF51L15-DK board assists with flashing duties, while Nordic's excellent Power Profiler Kit II is used to evaluate power consumption–a huge issue for remote IoT installations.
An unboxing of the Thingy:91 X is shown in the first video 👆, while an unboxing of the nRF51L15-DK, plus the Power Profiler Kit II is shown 👇. You'll also need a 10-pin, 1.27mm pitch connector, like this one, to attach the Thingy:91 X to the nRF51L15-DK board.
Toolchain SetupSet up the required software tools, including nRF Connect, SEGGER J-Link, and VSCode with the nRF Connect Extension Pack. Software is available for Windows, Mac, and Linux. I used a Macintosh for this demonstration.
The installation process is laid out in Lesson 1, Exercise 1 of the Nordic DevAcademy nRF Connect SDK Fundamentals course. The course also takes you through procedures like flashing your first "blinky, " so it's a good reference as you get started with these tools.
Hardware Flashing SetupWhile it's possible to flash the Thingy:91 X via onboard debugging, it's easier to use the nRF54L15-DK board. Connect the -DK board to your computer via USB, then connect the two via the -DK board's DEBUG OUT port and the '91 X's corresponding connector, using the 10-pin connector as shown below.
Remember to turn both the -DK and '91 X devices on (via switches toward the front of both devices), and set the switch shown below to nRF91.
Optionally, plug the '91 X into power via the USB-C port in the front. With its onboard battery, it can operate without external power for some time, but you might as well connect it if handy.
Build and Flash Your BlinkyOpen VS Code (as configured earlier). Click on the nRF Connect icon in the left panel, then Create a new application under the Welcome menu. Select Copy a Sample, then start typing "blinky" and select zephyr/samples/basic/blinky when it pops up. Choose a location on your computer, then open the application via the dialog box that pops up.
Click on the nRF Connect icon as needed and select Add build configuration under applications. Under board target, type "thingy91x." Select the thingy91x/nrf9151/ns option. For this exercise, you can safely ignore the other settings. Scroll down, click Generate and Build, and wait for your computer to complete the process.
Once that is done, hit the Erase and Flash to Board icon to send the program to the Thingy:91 X. After this is complete, cycle the 91 X's power switch off and on to start it blinking.
Congratulations, you have officially flashed a Thingy: 91 X device to blink an LED. Now the real fun begins!
If you haven't yet done so, insert the SIM card (included with the '91 X, as shown in the first video). This allows the Thingy:91 X to connect to the Internet with no further setup (i.e. no entering WiFi credentials etc.).
Go through the same new application/build process as you did with the Blinky example, but in this case, use the modem_shell sample as shown below. Once complete, flash-erase your newly built modem shell firmware onto the Thingy:91 X via the nRF51L15-DK. Cycle the power for good luck and/or to get it working.
With the modem firmware flashed, you now have a functional cellular communication device. Connect the Thingy:91 X directly to your computer via USB-C and open a new nRF Serial Terminal in VSCode as shown below:
Select /dev/tty.usbmodem14402 (highlighted in blue in the image below) to interface with the Thingy:91 X. You may wish to verify that you're connecting to the proper device by disconnecting/reconnecting the '91 X and re-initiating the nRF Serial Terminal to observe the results.
Once connected, type "at" into the terminal, which will produce a little blurb about using AT commands. As shown below, you also ping websites via the command "ping -d hackster.io" (or whatever other site you feel like testing).
One of the most important aspects of an off-grid IoT installation is power consumption/battery life. The Thingy:91 X is well-suited to meet low-power requirements, and it includes a current measurement and debug board that plugs into the front of the unit as shown below. When connected, the debug board (via a clever switching setup) acts as the device's power supply.
Nordic also sells a Power Profiler Kit II (PPK II) separately, which (as you might have guessed) allows you to profile, i.e. record, the power profile of a device over time. Turn on the Thingy:91 X, and connect the two devices as shown in the image above. Connect the PPK II to your computer via the USB DATA/POWER (Mirco-USB) port. Note that the PPK II can be used to profile other devices (including those not made by Nordic), but it is especially well-suited for this experiment.
Open nRF Connect for Desktop. From that interface, open (install if needed) the Power Profiler application. Select PPK2 in the upper-left corner of the Power Profiler application, and enable DATA LOGGER mode. Set supply voltage to 3307 mV (The 91 X will operate from 3.0-5.5, this does not have to be exact), hit Start to initiate recording, then toggle the Enable power output switch to on to observe the Thingy:91 X's power consumption behavior.
Power ObservationsFrom this application, you can observe the power behavior of your connected device, i.e. the Thingy:91 X. Typically you'll see a significant startup current, followed by a lower average current as it stays largely inactive while intermittently checking for updates over cellular.
To further observe the Thingy:91 X's capabilities, try pinging Hackster again via the terminal/VSCode as outlined above (be sure you're connected to your computer directly via USB-C). You'll see another flurry of activity/current consumption, then a return to its more standard behavior.
Try disabling the UART via the "uart disable 10" command (where 10 is the number of seconds that the UART will be disabled). You'll notice a significant drop in power usage (to under 1 mA) as this communication channel does not have to be maintained.
While not tested here, the Thingy:91 X can also use extended discontinuous reception (eDRX) and power saving mode (PSM) to cut power consumption by as much as two orders of magnitude–into the 10-20 microamp (µA) range. With proper low-power design, the Thingy:91 X–or devices that you develop based on its hardware, i.e. the nRF9151 SiP–can last for a very long time on battery power.
Low-Power IoT Development With Thingy:91 XThe Thingy:91 X, especially when combined with Nordic's Power Profiler Kit II and the nRF51L15-DK, presents a powerful set of tools for low-power IoT development and experimentation. Check out the video below for my further thoughts on this setup:
Any Amazon links are affiliate.
Comments