Skip to the content
PCBKitNew board
4 layers91 × 50 mmNRF52832 visitcard, the printed circuit board in 3D

PCB Visit Card designed around nRF 52832 Nordic chip

Size
91 × 50 mm
Copper layers
4
Thickness
1.3 mm
Parts
67
Nets
73
Pads
211
Tracks, vias
1,029, 149
Pours
3
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
19 Sep 2024
Updated
28 Apr 2025

Overview

NRF52832 visitcard is an open-source printed circuit board by codeandrelax, from the codeandrelax/nRF-Visit-Card repository on GitHub, published under the MIT licence. It is a 4-layer board of 91 × 50 mm with 67 parts on 73 nets, routed with 1,029 tracks and 149 vias.

Its parts include 21 resistors, 18 diodes, 16 capacitors, 3 inductors and 2 ICs. It belongs with the nRF52 and nRF5x boards of this library.

README

README.md

Bluetooth Compass Project

This project is a personal showcase of my skills in PCB design, embedded firmware development, and Android application programming—centered around a custom-built Bluetooth-enabled digital compass.

I created this project as a demonstration of my capability to design and manufacture a clean, self-contained PCB solution, free from the reliance on off-the-shelf BLE modules. It’s a manifestation of my passion for building systems from scratch, with a focus on RF design and embedded software.


🛠️ Hardware Overview

  • Microcontroller: Nordic nRF52832 with integrated BLE support
  • Antenna: Custom-designed meandering line antenna tuned to 2.4 GHz
  • Magnetometer: QMC5883L for 3-axis magnetic field sensing (I2C communication)
  • LEDs:
    • 12x Blue LEDs in a circular layout to represent compass directions
    • 6x Status LEDs: USER, CONNECTIVITY INDICATOR, HEARTBEAT
  • Battery: CR2032 coin cell slot
  • Programming Interface: SWD (SWCLK, SWDIO), UART connector
  • Clock: 32 MHz external crystal for BLE SoftDevice
  • PCB Stack: 4-layer custom design, credit-card sized

The reset pin is repurposed as a user input button. The reset functionality is disabled in software to allow this.


🔧 Firmware Overview

Firmware is built on Zephyr RTOS, enabling modular and modern embedded software design.

A custom Bluetooth service, CompassService, is implemented, exposing three key characteristics:

  1. Button State
  2. User LED Control
  3. Direction Output

📡 Magnetometer Integration

  • QMC5883L communicates over I2C.
  • Each axis (X, Y, Z) is read as a signed 16-bit value:
c
int16_t value = (MSB << 8) | LSB;
  • Orientation is calculated using the X and Y components:
c
float angle_rad = atan2f((float)mag_y, (float)mag_x);
float angle_deg = angle_rad * (180.0f / M_PI);
if (angle_deg < 0) angle_deg += 360.0f;

The direction value is then:

  • Broadcast over BLE using notify characteristics
  • Rendered via LEDs in a circular fashion to act as a real-time compass

The system runs on the internal RC oscillator, while the external crystal is reserved for BLE operations.


📱 Android App Overview

Developed using Android Studio, the app uses the Processing library to render a dynamic compass needle.

  • BLE scanning locates the BluetoothCompass
  • On connection, the app:
    • Performs service discovery
    • Subscribes to the Direction characteristic
    • Updates the compass needle UI in real-time

This part was relatively straightforward and served as a creative outlet for UI/UX.


🎯 Purpose

This project was built as a self-test and demonstration of:

  • Designing an RF-friendly PCB with custom Bluetooth antenna
  • Working with the nRF52 ecosystem and BLE stack (SoftDevice + Zephyr)
  • Integrating hardware components like magnetometers and CR2032 power
  • Creating a polished user-facing Android application

🧠 Lessons Learned

Building this project wasn't without hiccups—but every mistake taught me something valuable:

  1. Reversed Magnetometer Pins
    Costly PCB error discovered only post-manufacturing. Lesson: Triple-check schematic-to-layout connections.

  2. QFN Soldering Difficulties
    My aging soldering iron made soldering QFN packages (magnetometer, MCU) unreliable. Eventually outsourced to JLCPCB assembly for these parts.

  3. Signed-to-Unsigned Mistake
    I accidentally cast signed 16-bit values from the magnetometer to uint16_t, causing direction errors—reminding me of the infamous Ariane 5 bug.

  4. Magnetometer Proximity to Battery
    The CR2032 placement near the magnetometer introduced magnetic interference. If I were to redo the board, I’d increase their separation.

  5. No Tilt Compensation
    Since the magnetometer acts as a compass only when the board is level, tilts skew the readings. A better design would include an accelerometer for tilt compensation:

    text
    heading = atan2(-Y, X)
    pitch = asin(Z / sqrt(X² + Y² + Z²))
    compensated_heading = heading adjusted for pitch/roll

🏁 Conclusion

This project embodies my passion for electronics, firmware engineering, and RF system design. Despite having a Master’s degree in electronics and professional experience in embedded development, this personal build was a humbling and rewarding journey. Interestingly, the Android app—which I only work on as a hobby—turned out to be the smoothest part of the whole process!


🤝 Feedback Welcome!

I enjoy building things I can be proud of—and I’m always open to feedback and suggestions.
If anything in this project sparks your interest or you’d like to collaborate, feel free to reach out.

Detailed

image

This is how it started:

Schematics

image

image

image

image

image

image

image

image

image

image

image

Layout - bottom copper layer

image

Rendered images of the board

image

Soldered board

image

nRF Connect notes

How to program the board

nRF52 DK can be used to program the visit card.

nRF Visit Card board has exposed pads that are used for programming. visitCard_programming_witg_nRF52_DK

Pinout

image

Internal oscilator enable

To enable internal oscilator for nRF52832 in the proj.conf file add:

text
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON=y

Enable rest pin to be input GPIO

In the overlay file add:

text
&uicr {
	/delete-property/ gpio-as-nreset;
};

after it make sure to call:

text
nrfjprog --eraseuicr
nrfjprog --program <path to hex file> --verify

You might need to reset the board after this - unplug it and plug it back in.

If printk is not working

In the proj.conf file add:

text
CONFIG_CONSOLE=y

Disabling NFC pins

Pins P0.09 and P0.10 are NFC pins and if you wan't to use them as GPIO pins you need to disable NFC. nrf52 enabling gpio on nfc pins

text
CONFIG_NFCT_PINS_AS_GPIOS=y

Enable printing via SWD IO and SWD CLK

In the proj.conf file add:

text
CONFIG_LOG=y
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y

then you can use printf function.

text
uint16_t a = getAzimuth();
printf("Azimuth: %d\n", a);

Make sure to connect to RTT (Real-Time Transfer).

image

Knowledge Library

nRF Connect SDK Fundamentals

Bluetooth Low Energy Fundamentals

Find BLE devices

Processing for Android

Parts

67
QtyValueFootprintReferences
181kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR3, R4, R5, R6, R7, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20 +2
18LEDLED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD1, D2, D3, D4, D5, D6, D7, D10, D11, D12, D13, D14, D15, D16, D17, D18 +2
3100nCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC1, C4, C8
2100nCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC11, C16
2100pCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC13, C14
212pCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC5, C6
22k2Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR1, R2
24u7Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC2, C10
28pCapacitor_SMD:C_0402_1005Metric_Pad0.74x0.62mm_HandSolderC7, C15
110kResistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR21
110uInductor_SMD:L_0603_1608Metric_Pad1.05x0.95mm_HandSolderL1
110uCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC12
115nInductor_SMD:L_0603_1608Metric_Pad1.05x0.95mm_HandSolderL2
11uCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC3
132 MHzCrystal:Crystal_SMD_2016-4Pin_2.0x1.6mmY1
13n9Inductor_SMD:L_0603_1608Metric_Pad1.05x0.95mm_HandSolderL3
1Antenna_DipoleRF_Antenna:Texas_SWRA117D_2.4GHz_RightAE1
1Battery_CellBattery:BatteryHolder_Multicomp_BC-2001_1x2032BT1
1Gauge_50mm_Type1_SilkScreenTopCalibration_Scale:Gauge_50mm_Type1_SilkScreenTop
1ProgrammingSMD_edgeConnector_4pin:SMD_edgeConnector_4pinJ1
1SW_PushButton_Switch_SMD:SW_Push_1P1T_NO_6x6mm_H9.5mmSW1
1UARTSMD_edgeConnector_4pin:SMD_edgeConnector_4pinJ2
1u22Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC9
1~Package_LGA:LGA-16_3x3mm_P0.5mmU2
1~Package_DFN_QFN:QFN-48-1EP_6x6mm_P0.4mm_EP4.6x4.6mmU1

Questions

How big is the NRF52832 visitcard PCB?

It measures 91 × 50 mm and has 4 copper layers, 1.3 mm thick.

What parts does the NRF52832 visitcard use?

67 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the NRF52832 visitcard KiCad files?

From the codeandrelax/nRF-Visit-Card repository on GitHub, at the commit this page was made from: the board is nRF52832_visitcard/nRF52832_visitcard.kicad_pcb and its schematic nRF52832_visitcard/nRF52832_visitcard.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the NRF52832 visitcard design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 4 layers22 × 15 mmAmp cpw hmc311, the printed circuit board in 3D

    Amp cpw hmc311

    loxodes/vna

    Under development open hardware microwave vector network analyzer

    67 parts205
  • 4 layers51.4 × 60.6 mmGb rp2040 cart, the printed circuit board in 3D

    Gb rp2040 cart

    deltabeard/DBGC

    A Game Boy cartridge using the Raspberry Pi RP2040 with RTC and MBC support.

    67 parts57
  • 4 layers100 × 40 mmMotor controller, the printed circuit board in 3D

    Motor controller

    reubenstr/zuko

    A quadruped robot dog!

    67 parts51MIT
  • 4 layers49 × 43 mmSk005-monitor resyncer, the printed circuit board in 3D

    Sk005-monitor resyncer

    mirdej/synkie

    The Synkie is a modular open source analog video processor, developed by Michael Egger, Max Egger and Flo Kaufmann

    67 parts47
  • 4 layers30 × 26.5 mmDriver tmc2208, the printed circuit board in 3D

    Driver tmc2208

    calithameridi/corevus

    High-flexibility, low-cost mechatronics controller for 3D printers

    67 parts25
  • 4 layers50.3 × 33 mm154-watch, the printed circuit board in 3D

    154-watch

    martinberlin/H-spi-adapters

    PCB design for SPI adapters (HATs)

    67 parts23
  • 4 layers82.3 × 37.2 mmRIDE, the printed circuit board in 3D

    RIDE

    LIV2/RIDE

    To add the A0 Bonus RAM to the system you will need to use the addram command included in the RIDE-Software adf/lha found under Releases.

    67 parts17
  • 4 layers76 × 76.5 mmNumbpad, the printed circuit board in 3D

    Numbpad

    calvin-mcd/travaulta

    topre pcb for the vault35

    67 parts16