1.. zephyr:code-sample:: grow_r502a
2   :name: GROW R502-A Fingerprint Sensor
3   :relevant-api: sensor_interface
4
5   Store and match fingerprints using the GROW R502-A fingerprint sensor.
6
7Overview
8********
9
10This sample has the below functionalities:
11
12#. Sensor LED is controlled using led APIs from zephyr subsystem.
13#. Shows the number of fingerprints stored in the sensor.
14#. Shows the sensor device's configurations like baud rate, library size, address and data packet size in UART frame.
15#. When SENSOR_ATTR_RECORD_FREE_IDX is set then it search for free index in sensor library.
16#. When SENSOR_ATTR_RECORD_ADD is set then it adds a new fingerprint to the sensor.
17#. When SENSOR_ATTR_RECORD_FIND is set then it tries to find a match for the input fingerprint. On finding a match it returns ID and confidence.
18#. When SENSOR_ATTR_RECORD_DEL is set then it deletes a fingerprint from the sensor.
19
20Note: Fingerprint add functionality work only when SENSOR_TRIG_TOUCH is set.
21
22Wiring
23*******
24
25This sample uses an external breakout for the sensor.  A devicetree
26overlay must be provided to identify the UART bus and the GPIO
27used to control the sensor. Sensor can be powered using mentioned optional GPIO.
28
29References
30**********
31
32For more information about the GROW_R502A Fingerprint Sensor see
33http://en.hzgrow.com/product/143.html
34
35Building and Running
36********************
37
38After providing a devicetree overlay that specifies the sensor location,
39build this sample app using:
40
41.. zephyr-app-commands::
42   :zephyr-app: samples/sensor/grow_r502a
43   :board: esp32_devkitc_wroom/esp32/procpu
44   :goals: build flash
45
46Sample Output
47*************
48
49.. code-block:: console
50
51    *** Booting Zephyr OS build v3.6.0-3147-g8ae1a2e2718e ***
52    template count : 4
53    baud 57600
54    addr 0xffffffff
55    lib_size 200
56    data_pkt_size 128
57    Fingerprint Deleted at ID #3
58    Fingerprint template free idx at ID #3
59    Waiting for valid finger to enroll as ID #3
60    Place your finger
61    Fingerprint successfully stored at #3
62    template count : 4
63    Matched ID : 2
64    confidence : 110
65    <repeats endlessly>
66