← How-Tos
electronics 56 min ago ◯ 4 min read

Getting Started with the Nordic nRF52840 for Makers: Zephyr RTOS and the nRF Connect SDK

nrf52840zephyr rtosnrf connect sdkbluetooth low energyblenordic semiconductorembeddedmicrocontrollerhowto

Every microcontroller article on this site leans heavily on ESP32 and, for lighter embedded work, STM32 and AVR. The Nordic nRF52840 deserves its own entry because it solves a different problem: it's the chip of choice when Bluetooth Low Energy is the actual point of the project, not a bolted-on feature, and it's the chip inside hardware you've probably already encountered, including the Chameleon Ultra RFID tool, the Adafruit Feather nRF52840, and the Seeed XIAO nRF52840. This guide covers the hardware, why Zephyr RTOS and the nRF Connect SDK are the right way to develop for it, and how to get a first BLE project running.

Why the nRF52840 Instead of ESP32 for BLE

FactorESP32nRF52840 BLE stack maturityGood, but BLE shares silicon and sometimes timing with Wi-FiBLE and Bluetooth 5 (including Long Range PHY) are the chip's primary purpose; no Wi-Fi radio competing for airtime Power consumption (BLE-only use)Capable low-power modes, but overall a heavier chipBuilt from the ground up for coin-cell and battery-powered BLE peripherals CoreXtensa LX6/LX7 or RISC-V depending on variantARM Cortex-M4F, well supported by the entire ARM embedded toolchain ecosystem Thread/ZigbeeOnly on newer C6/H2 variantsNative 802.15.4 radio support alongside BLE on the same chip

If a project needs Wi-Fi, or needs to be as cheap as possible, ESP32 usually wins. If the project is a wearable, a BLE sensor tag, or anything where battery life on a coin cell matters more than anything else, the nRF52840 is the more purpose-built choice.

Hardware: Where You'll Find This Chip

Two Development Paths

PathWhat it isWhen to use it nRF5 SDK (legacy)Nordic's older, non-RTOS-based C SDK with the SoftDevice BLE stackMaintaining existing nRF5 SDK projects; not the recommended starting point for new work nRF Connect SDK (NCS) + Zephyr RTOSNordic's current, actively developed SDK, built on top of the open-source Zephyr RTOSAny new project; this is what Nordic itself now recommends and supports

Zephyr is a real RTOS, not a thin wrapper: it brings a proper devicetree hardware description model (similar in spirit to the Linux kernel's devicetree, and to the Raspberry Pi device tree overlays covered elsewhere on this site), Kconfig-based configuration, and a built-in Bluetooth host stack that works identically across Zephyr-supported chips, not just Nordic's.

Getting Your First Project Running

  1. Install the nRF Connect for VS Code extension, which bundles the west meta-tool, the Zephyr SDK toolchain, and project templates. This is the path of least resistance over a manual command-line Zephyr install.
  2. Create a new application from the peripheral_lbs (LED Button Service) sample, a standard "hello world" for BLE peripherals that exposes a button-state and LED-control service.
  3. Build and flash to your board; the DK has onboard debug hardware, so this is a single click in the VS Code extension. On a bare nRF52840 Dongle, you'll need an external J-Link or another DK used as a debugger.
  4. Connect with a generic BLE scanner app (nRF Connect for Mobile, Nordic's own app) to see the advertised service, read the button state, and write to the LED characteristic.

Devicetree and Kconfig: The Learning Curve

The biggest adjustment coming from Arduino or even ESP-IDF is that pin assignments and peripheral settings live in devicetree overlay files, not in C code calling pinMode(). A UART, an I2C bus, or a GPIO's pull direction gets described declaratively in a .overlay file, and the build system wires that description to the driver code. It's more upfront ceremony than Arduino, but it's also exactly how you'd scale from a one-off project to a custom PCB, since the same devicetree model describes Nordic's dev boards and a bare nRF52840 on your own board design.

When Zephyr Is Overkill

If your project is a single BLE sensor broadcasting one value with no real-time constraints, Zephyr's learning curve may not pay for itself versus a simpler Arduino-based nRF52 board package. Reach for the full nRF Connect SDK and Zephyr specifically when you need Nordic's production-grade Bluetooth stack, Thread/Zigbee alongside BLE, DFU (device firmware update) support, or a path toward a certified product, not for a weekend blinky-LED demo.