• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/04-Jan-2025-3228

src/04-Jan-2025-186145

CMakeLists.txtD04-Jan-2025224 96

README.rstD04-Jan-20251.9 KiB6245

prj.confD04-Jan-202582 54

sample.yamlD04-Jan-2025158 98

README.rst

1.. zephyr:code-sample:: adt7420
2   :name: ADT7420 high-accuracy digital I2C temperature sensor
3   :relevant-api: sensor_interface
4
5   Get temperature data from an ADT7420 sensor using polling and window mode.
6
7Description
8***********
9
10This sample application periodically (1Hz) measures the ambient temperature
11in degrees Celsius. The result is written to the console.
12
13When configured in trigger mode the update interval is 5 s, and the
14sample maintains a |plusminus| 1 |deg| C window around a recent
15temperature.  As soon as the temperature goes outside the window an
16interrupt causes the application to display an event and update the
17upper and lower window boundaries.
18
19References
20**********
21
22 - ADT7420: https://www.analog.com/adt7420
23
24Wiring
25*******
26
27This sample uses the ADT7420 sensor controlled using the I2C interface.
28Connect Supply: **VDD**, **GND** and Interface: **SDA**, **SCL**
29and optionally connect the **INT** to a interrupt capable GPIO.
30The supply voltage can be in the 2.7V to 5.5V range.
31Depending on the baseboard used, the **SDA** and **SCL** lines require Pull-Up
32resistors.
33
34Building and Running
35********************
36
37This project outputs sensor data to the console. It requires an ADT7420
38sensor. It should work with any platform featuring a I2C peripheral interface.
39It does not work on QEMU.
40In this example below the :ref:`nrf52dk_nrf52832` board is used.
41
42
43.. zephyr-app-commands::
44   :zephyr-app: samples/sensor/adt7420
45   :board: nrf52dk/nrf52832
46   :goals: build flash
47
48Sample Output
49=============
50
51.. code-block:: console
52
53   *** Booting Zephyr OS build zephyr-v2.1.0-538-g12b2ed2cf7c3  ***
54   device is 0x2000101c, name is ADT7420
55   [0:00:00.011]: temperature 21.203125 Cel
56   [0:00:01.015]: temperature 21.171875 Cel
57   [0:00:02.019]: temperature 21.171875 Cel
58   [0:00:03.023]: temperature 21.187500 Cel
59   [0:00:04.027]: temperature 21.140625 Cel
60
61<repeats endlessly>
62