This project reads temperature and humidity from a DHT22 sensor using the nRF7002DK and Zephyr RTOS.The DHT22 is connected to GPIO Port 1, Pin 11, and the data is printed on the serial console.
I built this as my first Hackster.io post because I wanted to start small but make something that works and is useful. Most DHT22 tutorials are for Arduino or ESP32 — I couldn’t find a clean, beginner-friendly guide for nRF7002DK, so I made one.
The way it works is pretty simple:
- The nRF7002DK sends a start signal to the DHT22.
- The sensor sends back pulses encoding humidity and temperature.
- The firmware decodes the pulses, formats the values, and prints them to the console.
That’s it — but this is just the start!The nRF7002DK supports Wi-Fi and Bluetooth, so in future projects I’ll be adding features to send this sensor data wirelessly to the cloud or a mobile app.
DHT22 + nRF7002DK (Zephyr) — Step-by-Step1) What you’ll need- nRF7002dk
- DHT22 (AM2302) sensor (module with onboard pull-up preferred)
- Jumper wires
- (If using the raw 4-pin DHT22 sensor) 4.7k–10kΩ pull-up resistor from DATA → 3V3
Power: 3.3 V. Data line is 3.3 V logic (no level shifter needed).2) Wire it up (as per schematic)
- VCC → 3V3
- GND → GND
- DATA → Port 1, Pin 11 (GPIO P1.11 on nRF7002DK)
If using the raw sensor, add a 4.7k–10kΩ pull-up from DATA to 3V3. Many breakout boards already include this.3) Code Flashing
- Once everything is ready, clone the repository, build the code, and simply flash it.
- Always reads 0.0 / fails checksum → Check pull-up resistor on DATA; keep wires short (<20–30 cm).
- Random timeouts → Ensure solid 3.3 V power; try a slightly longer
k_busy_wait()
window (e.g., 40–50 µs sample point). - No logs → Confirm the correct serial port and 115200 baud; verify
CONFIG_UART_CONSOLE=y
.
Comments