Stufin
Home Quick Cart Profile

NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module

Buy Now

Pin Configuration

  • NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module Pinout Explanation
  • The NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module is a compact, low-power wireless module designed for Bluetooth Low Energy (BLE) applications. The module provides a 32-bit ARM Cortex-M0 processor, 256 KB flash memory, and 16 KB RAM. Below is a detailed explanation of the module's pins, along with connection guidelines.
  • Pinout Diagram:
  • The NRF51822 BLE4 module has a total of 32 pins, which are divided into four rows of 8 pins each. The pinout diagram is as follows:
  • Row 1:
  • 1. VDD (Pin 1): Power supply pin. Connect to a 1.8V to 3.6V power source.
  • 2. VDDA (Pin 2): Analog power supply pin. Connect to a 1.8V to 3.6V power source.
  • 3. GPIO (Pin 3): General-purpose input/output pin.
  • 4. GPIO (Pin 4): General-purpose input/output pin.
  • 5. GPIO (Pin 5): General-purpose input/output pin.
  • 6. GPIO (Pin 6): General-purpose input/output pin.
  • 7. SWDCLK (Pin 7): Serialized Wire Debug clock input.
  • 8. SWDIO (Pin 8): Serialized Wire Debug data input/output.
  • Row 2:
  • 1. RST (Pin 9): Reset pin. Active low, connect to a pull-up resistor or a reset button.
  • 2. GPIO (Pin 10): General-purpose input/output pin.
  • 3. GPIO (Pin 11): General-purpose input/output pin.
  • 4. GPIO (Pin 12): General-purpose input/output pin.
  • 5. GPIO (Pin 13): General-purpose input/output pin.
  • 6. SPI_MOSI (Pin 14): SPI Master Out Slave In data output.
  • 7. SPI_MISO (Pin 15): SPI Master In Slave Out data input.
  • 8. SPI_SCK (Pin 16): SPI clock input/output.
  • Row 3:
  • 1. SPI_CS (Pin 17): SPI chip select input/output.
  • 2. UART_TX (Pin 18): UART transmit data output.
  • 3. UART_RX (Pin 19): UART receive data input.
  • 4. GPIO (Pin 20): General-purpose input/output pin.
  • 5. GPIO (Pin 21): General-purpose input/output pin.
  • 6. UART_CTS (Pin 22): UART clear-to-send input.
  • 7. UART_RTS (Pin 23): UART request-to-send output.
  • 8. GPIO (Pin 24): General-purpose input/output pin.
  • Row 4:
  • 1. GPIO (Pin 25): General-purpose input/output pin.
  • 2. GPIO (Pin 26): General-purpose input/output pin.
  • 3. GPIO (Pin 27): General-purpose input/output pin.
  • 4. GPIO (Pin 28): General-purpose input/output pin.
  • 5. BLecycle (Pin 29): Bluetooth Low Energy cycle input.
  • 6. MODE (Pin 30): Mode pin, used for setting the module's operation mode.
  • 7. RF_CTRL (Pin 31): RF control pin, used for controlling the module's RF transceiver.
  • 8. GND (Pin 32): Ground pin.
  • Connection Guidelines:
  • 1. Power Supply: Connect VDD and VDDA to a 1.8V to 3.6V power source.
  • 2. Reset: Connect RST to a pull-up resistor (e.g., 10k) or a reset button.
  • 3. GPIO: Connect GPIO pins to peripherals or sensors according to your application's requirements.
  • 4. SPI: Connect SPI_MOSI, SPI_MISO, and SPI_SCK to a SPI master device (e.g., microcontroller).
  • 5. UART: Connect UART_TX, UART_RX, UART_CTS, and UART_RTS to a UART device (e.g., serial terminal).
  • 6. Bluetooth: Connect BLecycle to a Bluetooth antenna or a BLE module.
  • 7. Mode: Connect MODE to a pull-up resistor (e.g., 10k) or a mode selection switch.
  • 8. RF Control: Connect RF_CTRL to a pull-up resistor (e.g., 10k) or an RF control signal.
  • 9. Ground: Connect GND to a ground plane or a common ground point.
  • 10. Antenna: Connect a Bluetooth antenna to the module's antenna pin (not shown in the pinout diagram).
  • Important Notes:
  • Ensure proper power supply and ground connections to avoid damage to the module.
  • Use a level shifter or voltage regulator if your system's voltage is not compatible with the module's operating voltage.
  • Refer to the module's datasheet and application notes for detailed information on pin configurations, electrical characteristics, and operating conditions.
  • Follow proper electromagnetic compatibility (EMC) and electromagnetic interference (EMI) guidelines when designing your system.

Code Examples

NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module Documentation
Overview
The NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module is a compact, low-power Bluetooth 4.0 module based on the nRF51822 System-on-Chip (SoC) from Nordic Semiconductor. This module provides a reliable and efficient way to add Bluetooth Low Energy (BLE) capabilities to various devices and applications.
Key Features
Bluetooth 4.0 compliant
 2.4 GHz frequency band
 nRF51822 SoC with 256 KB of flash memory and 16 KB of RAM
 Supports multiple roles (central, peripheral, broadcaster, observer)
 Range: up to 100 meters (line of sight)
 Power consumption: 10.5 mA (transmit) and 11.5 mA (receive)
Code Examples
### Example 1: Basic BLE Advertising ( Peripheral Role)
This example demonstrates how to configure the NRF51822 module as a BLE peripheral device and advertise a custom service.
Hardware Requirements
NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module
 Microcontroller (e.g., Arduino Uno)
 Breadboard and jumper wires
Software Requirements
Nordic Semiconductor's nRF5 SDK (Software Development Kit)
 Keil Vision IDE (or alternative C compiler)
Code
```c
#include <stdbool.h>
#include <string.h>
#include "nrf_drv_ble.h"
#include "nrf_gpio.h"
#include "app_util.h"
#define ADVERTISEMENT_INTERVAL 100 // 100 ms advertisement interval
#define DEVICE_NAME "MyPeripheral"
int main(void) {
    // Initialize the NRF51822 module
    nrf_drv_ble_init();
// Configure the device name
    ble_gap_conn_params_t conn_params;
    conn_params.p_device_name = DEVICE_NAME;
    conn_params.device_name_type = BLE_ADVTYP_FLAGS_GENERAL;
// Start advertising
    nrf_drv_ble_adv_start(ADVERTISEMENT_INTERVAL, NULL);
while (true) {
        // Wait for incoming connections
        sd_app_evt_wait();
    }
}
```
Description
In this example, we initialize the NRF51822 module and configure the device name using the `ble_gap_conn_params_t` structure. We then start advertising using the `nrf_drv_ble_adv_start()` function, specifying the advertisement interval and a NULL pointer for the advertisement data.
### Example 2: BLE Central Role - Scanning for Devices (Central Role)
This example demonstrates how to configure the NRF51822 module as a BLE central device and scan for available BLE peripherals.
Hardware Requirements
NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module
 Microcontroller (e.g., Arduino Uno)
 Breadboard and jumper wires
Software Requirements
Nordic Semiconductor's nRF5 SDK (Software Development Kit)
 Keil Vision IDE (or alternative C compiler)
Code
```c
#include <stdbool.h>
#include <string.h>
#include "nrf_drv_ble.h"
#include "nrf_gpio.h"
#include "app_util.h"
#define SCAN_INTERVAL 100 // 100 ms scan interval
#define SCAN_WINDOW 50 // 50 ms scan window
int main(void) {
    // Initialize the NRF51822 module
    nrf_drv_ble_init();
// Configure the scanner
    ble_gap_scan_params_t scan_params;
    scan_params.active = 0; // Passive scanning
    scan_params.interval = SCAN_INTERVAL;
    scan_params.window = SCAN_WINDOW;
    scan_params.timeout = 0; // No timeout
// Start scanning
    nrf_drv_ble_scan_start(&scan_params);
while (true) {
        // Wait for scan results
        sd_app_evt_wait();
    }
}
```
Description
In this example, we initialize the NRF51822 module and configure the scanner using the `ble_gap_scan_params_t` structure. We set the scan interval, window, and timeout parameters, and then start scanning using the `nrf_drv_ble_scan_start()` function.
Note: These examples are simplified and intended to demonstrate basic BLE functionality. In a real-world application, you would need to add error handling, implement callback functions for BLE events, and ensure compliance with BLE specifications.
Additional Resources
Nordic Semiconductor's nRF5 SDK documentation
 BLE specifications (Bluetooth SIG website)
 NRF51822 datasheet (Nordic Semiconductor website)
By following these examples and consulting the provided resources, you can develop more complex BLE applications using the NRF51822 BLE4 2.4GHz Bluetooth 4.0 Module.