Files
pool_thermometer/firmware/boards/nrf52840dk_nrf52840.overlay
2026-07-14 13:34:37 +02:00

45 lines
1.1 KiB
Plaintext

/ {
zephyr,user {
io-channels = <&adc 0>;
};
aliases {
pooltemp = &ds18b20_sensor;
};
sensor_power: regulator-sensor-power {
compatible = "regulator-fixed";
regulator-name = "sensor-power";
enable-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; // Check your supply pin here.
startup-delay-us = <2000>;
regulator-boot-on;
};
w1_0: w1-zephyr-gpio {
compatible = "zephyr,w1-gpio";
gpios = <&gpio0 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; // Check your data pin here.
ds18b20_sensor: ds18b20 {
compatible = "maxim,ds18b20";
family-code = <0x28>;
resolution = <12>;
// Removed: supply-gpios = <&sensor_power>;
};
};
};
&adc {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
zephyr,gain = "ADC_GAIN_1_6";
zephyr,reference = "ADC_REF_INTERNAL"; // Internal 0.6 V
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,input-positive = <NRF_SAADC_VDD>; // This reads VDD internally.
zephyr,resolution = <12>;
};
};