Skip to the content
4 layers36 × 38 mmKicad temp, the printed circuit board in 3D

A complete IoT sensor system featuring adaptive power management, BLE communication, and data logging. The system consists of a Raytac MDBT50Q (nRF52840) sensor node and a Raspberry Pi host application.

Size
36 × 38 mm
Copper layers
4
Thickness
1.6 mm
Parts
38
Nets
79
Pads
187
Tracks, vias
294, 92
Pours
176
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
29 Aug 2025
Updated
29 Aug 2025

Overview

Kicad temp is an open-source printed circuit board by alexDickhans, from the alexDickhans/ul-temp-sensor repository on GitHub. It is a 4-layer board of 36 × 38 mm with 38 parts on 79 nets, routed with 294 tracks and 92 vias.

It is built around the MDBT50Q-1MV2, BME280 and RV-3028-C7. Its parts include 13 resistors, 7 capacitors, 4 ICs, 2 inductors and 1 connector. It belongs with the nRF52 and nRF5x boards of this library.

Main components

3

README

README.md

Adaptive BLE Sensor Node System

A complete IoT sensor system featuring adaptive power management, BLE communication, and data logging. The system consists of a Raytac MDBT50Q (nRF52840) sensor node and a Raspberry Pi host application.

🏗️ System Architecture

text
┌─────────────────┐    BLE Advertisement    ┌─────────────────┐
│   Sensor Node   │ ──────────────────────► │  Raspberry Pi   │
│                 │                         │     Host        │
│ • nRF52840      │                         │                 │
│ • BME280        │                         │ • BLE Scanner   │
│ • Battery       │                         │ • Data Logger   │
│ • Adaptive PM   │                         │ • SQLite DB     │
└─────────────────┘                         └─────────────────┘

📋 Features

MCU Firmware (nRF52840)

  • Adaptive Power Management: 4-tier power system based on battery voltage
  • BME280 Integration: Temperature, pressure, and humidity sensing
  • BLE Advertising: Non-connectable advertisements with sensor data
  • Deep Sleep: System OFF mode with RTC wake-up
  • Battery Monitoring: ADC-based voltage sensing

Raspberry Pi Host

  • BLE Scanner: Continuous scanning for sensor advertisements
  • Data Decoding: Parses manufacturer-specific data payloads
  • SQLite Database: Local data storage with indexing
  • Data Viewer: Query and display sensor data
  • Systemd Service: Automatic startup and management

🔋 Power Management Tiers

TierBattery RangeWake IntervalBLE RateDescription
Normal4.2V - 3.8V5 minutes1 HzFull performance
Conserve3.8V - 3.6V15 minutes0.2 HzReduced frequency
Reserve3.6V - 3.4V30 minutes0.1 HzMinimal operation
Survival3.4V - 3.2V60 minutes0.1 HzCritical battery

📦 Hardware Requirements

Sensor Node

  • MCU: Raytac MDBT50Q (nRF52840 inside)
  • Sensor: Bosch BME280 (I²C)
  • Battery: Li-Po pouch (3.7V, 1000mAh+)
  • PMIC: BQ25570 (solar charging)
  • Connections: I²C, ADC, RTC

Host System

  • Platform: Raspberry Pi (any modern Pi with BLE)
  • OS: Raspberry Pi OS or Ubuntu
  • Storage: SD card with 8GB+ free space

🚀 Quick Start

1. MCU Firmware Setup

bash
# Install nRF Connect SDK
# Follow: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_installing.html

# Clone and build
cd mcu_firmware
./build.sh

# Flash to device
west flash -d build

2. Raspberry Pi Host Setup

bash
# Install dependencies
sudo apt update
sudo apt install python3-pip python3-venv bluetooth bluez

# Create virtual environment
cd pi_host
python3 -m venv venv
source venv/bin/activate

# Install Python packages
pip install -r requirements.txt

# Run scanner
python3 sensor_scanner.py

3. View Data

bash
# List known devices
python3 data_viewer.py --list-devices

# View recent data
python3 data_viewer.py --hours 24 --stats

# Filter by device
python3 data_viewer.py --device AA:BB:CC:DD:EE:FF

📊 BLE Data Format

The sensor node broadcasts manufacturer-specific data with the following structure:

c
struct sensor_adv_data {
    uint8_t version;           // Protocol version (1)
    uint8_t tier;              // Power tier (0-3)
    uint16_t battery_mv;       // Battery voltage in mV
    int16_t temperature;       // Temperature * 100 (°C)
    uint16_t pressure;         // Pressure * 10 (hPa)
    uint16_t humidity;         // Humidity * 100 (%)
    uint32_t timestamp;        // Unix timestamp
};

Company ID: Nordic Semiconductor (0x0059)

🔧 Configuration

MCU Configuration

Edit mcu_firmware/prj.conf for:

  • BLE power settings
  • I²C configuration
  • ADC settings
  • Power management options

Host Configuration

Command-line options for sensor_scanner.py:

  • --db: Database file path
  • --scan-duration: BLE scan duration (seconds)
  • --log-level: Logging verbosity

📈 Data Analysis

Database Schema

sql
CREATE TABLE sensor_data (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    device_address TEXT NOT NULL,
    device_name TEXT,
    timestamp DATETIME NOT NULL,
    temperature REAL,
    pressure REAL,
    humidity REAL,
    battery_mv INTEGER,
    power_tier INTEGER,
    rssi INTEGER,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

Example Queries

sql
-- Average temperature by hour
SELECT strftime('%Y-%m-%d %H:00:00', timestamp) as hour,
       AVG(temperature) as avg_temp
FROM sensor_data 
GROUP BY hour 
ORDER BY hour DESC;

-- Battery status over time
SELECT timestamp, battery_mv, power_tier
FROM sensor_data 
WHERE device_address = 'AA:BB:CC:DD:EE:FF'
ORDER BY timestamp DESC;

🔍 Troubleshooting

Common Issues

  1. No BLE advertisements detected

    • Check device is powered and firmware is flashed
    • Verify BLE is enabled on Raspberry Pi
    • Check for interference or range issues
  2. High power consumption

    • Verify deep sleep is working (measure current <3µA)
    • Check BLE advertising intervals
    • Monitor battery voltage thresholds
  3. Sensor reading errors

    • Check I²C connections
    • Verify BME280 address (0x76 or 0x77)
    • Check power supply stability

Debug Commands

bash
# Monitor MCU serial output
west espressif monitor -d build

# Check BLE devices
sudo hcitool lescan

# Monitor system logs
journalctl -u sensor-scanner -f

# Check database integrity
sqlite3 sensor_data.db "PRAGMA integrity_check;"

🔄 Systemd Service

Create /etc/systemd/system/sensor-scanner.service:

ini
[Unit]
Description=BLE Sensor Scanner
After=bluetooth.service
Wants=bluetooth.service

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/sensor-system/pi_host
Environment=PATH=/home/pi/sensor-system/pi_host/venv/bin
ExecStart=/home/pi/sensor-system/pi_host/venv/bin/python sensor_scanner.py
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable and start:

bash
sudo systemctl enable sensor-scanner
sudo systemctl start sensor-scanner

📚 Development

Project Structure

text
temp-sensor-code/
├── mcu_firmware/           # nRF52840 firmware
│   ├── src/               # Source files
│   ├── boards/            # Device tree overlays
│   ├── prj.conf          # Zephyr configuration
│   └── build.sh          # Build script
├── pi_host/              # Raspberry Pi application
│   ├── sensor_scanner.py # Main scanner
│   ├── data_viewer.py    # Data query tool
│   └── requirements.txt  # Python dependencies
└── README.md             # This file

Adding New Sensors

  1. Extend the sensor_adv_data structure
  2. Update the Python decoder
  3. Modify database schema
  4. Update data viewer

Power Optimization

  • Use forced mode for BME280 (not continuous)
  • Minimize BLE advertising duration
  • Optimize RTC wake intervals
  • Monitor current consumption with multimeter

📄 License

This project is open source. See LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📞 Support

For issues and questions:

  • Check the troubleshooting section
  • Review the code comments
  • Open an issue on GitHub

Note: This system is designed for educational and prototyping purposes. For production use, consider additional security measures and environmental protection.

Parts

38
QtyValueFootprintReferences
4MountingHole_PadMountingHole:MountingHole_3.2mm_M3_PadH1, H2, H3, H4
34.7uCapacitor_SMD:C_0603_1608MetricC4, C6, C7
3FiducialFiducial:Fiducial_1.5mm_Mask3mmFID1, FID2, FID3
21.87mResistor_SMD:R_0603_1608MetricR3, R11
210nCapacitor_SMD:C_0603_1608MetricC3, C5
24.22mResistor_SMD:R_0603_1608MetricR6, R10
247kResistor_SMD:R_0402_1005MetricR8, R9
25.1kResistor_SMD:R_0402_1005MetricR12, R13
25.62mResistor_SMD:R_0603_1608MetricR2, R5
1100nCapacitor_SMD:C_0603_1608MetricC1
110uInductor_SMD:L_0805_2012MetricL1
122uInductor_SMD:L_0805_2012MetricL2
122uCapacitor_SMD:C_0603_1608MetricC2
15.49mResistor_SMD:R_0603_1608MetricR4
17.32mResistor_SMD:R_0603_1608MetricR1
18.66mResistor_SMD:R_0603_1608MetricR7
1BME280Package_LGA:Bosch_LGA-8_2.5x2.5mm_P0.65mm_ClockwisePinNumberingU4
1BQ25570Package_DFN_QFN:QFN-20-1EP_3.5x3.5mm_P0.5mm_EP2x2mmU2
1Battery_CellConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalBT1
1MDBT50Q-1MV2RF_Module:Raytac_MDBT50QU1
1RV-3028-C7Package_SON:MicroCrystal_C7_SON-8_1.5x3.2mm_P0.9mmU3
1SCL_TPTestPoint:TestPoint_Pad_D2.0mmTP2
1SDA_TPTestPoint:TestPoint_Pad_D2.0mmTP1
1Solar_CellConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalSC1
1USB_C_Plug_USB2.0Connector_USB:USB_C_Receptacle_Molex_105450-0101P1

Similar boards

  • 2 layers70 × 110 mmThermostat pcb, the printed circuit board in 3D

    Thermostat pcb

    mikegormack/thermostat-pcb

    knob thermostat PCB Kicad

    103 parts
  • 2 layers245.2 × 100 mmV5 main, the printed circuit board in 3D

    V5 main

    zynthian/zynthian-hw

    Zynthian hardware stuff: PCBs, schemes, parts specifications, pin assignment, ...

    160 parts156
  • 2 layers75 × 40 mmPicoTop Board Rev2, the printed circuit board in 3D

    PicoTop Board Rev2

    7west/PicoTop

    A very basic computer & OS based on the RP2350 microcontroller

    86 parts66
  • 2 layers47.2 × 55.5 mmTinta l2, the printed circuit board in 3D

    Tinta l2

    c0de111/tinta

    Battery-powered e-paper sign: room signage, sensor graphs, home automation, or anything over Wi-Fi. Wakes by real-time clock, NFC tap, or button. Raspberry Pi Pico W firmware, custom PCB, and 3D-printed case included.

    60 parts39Apache-2.0
  • 2 layers36.4 × 29.4 mmKicad Smart Watch, the printed circuit board in 3D

    Kicad Smart Watch

    AFLProjects/DIY-Smart-Watch

    DIY Smart Watch with ATMEGA32U4 , ST7789 SPI display and RV3028-C7 Extreme Low Power RTC Module

    63 parts12
  • 6 layers50 × 23 mmEsp32p4amoled3.19, the printed circuit board in 3D

    Esp32p4amoled3.19

    v-cu/dpf-load-monitor-wide

    ESP32-P4 diagnostic display for VAG diesels — live DPF and engine data over CAN (UDS) on a 3.19" ultra-wide AMOLED. Firmware, KiCad files, BOM and 3D enclosure.

    115 parts12
  • 4 layers51 × 77 mmBODAQS A8 board v1 0, the printed circuit board in 3D

    BODAQS A8 board v1 0

    benconnor1972/BODAQS

    Bicycle Open Data Acquisition System

    120 parts9
  • 2 layers90 × 100 mmHost shell, the printed circuit board in 3D

    Host shell

    shapoco/wildcardboy

    Handheld Game Console with Replaceable MCU

    241 parts5

Questions

How big is the Kicad temp PCB?

It measures 36 × 38 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Kicad temp use?

38 parts, built around the MDBT50Q-1MV2, BME280 and RV-3028-C7. 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 Kicad temp KiCad files?

From the alexDickhans/ul-temp-sensor repository on GitHub, at the commit this page was made from: the board is hardware/kicad_temp/kicad_temp.kicad_pcb and its schematic hardware/kicad_temp/kicad_temp.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Kicad temp design in my own project?

Its repository states no licence, so its author keeps all rights: ask alexDickhans before reusing the design.