How to use Rpi UART to read Wiegand data?
No you can't. Wiegand and UART are different animals. They don't talk
to each other.
But you can use two Rpi GPIO pins and write a simple python program instead. See details below.
Wiegand format summary
(1) has two output signal wires, one carrying Bit 1 signal, the other Bit 0
(2) uses 26 bits format (16 bit for card number),
(3) has no clock.
Rpi GPIO reading Wiegand
To use Rpi to read Wiegand, you can use a HC00 Quad NAND to preprocess
the two signals, then use two input mode GPIO pins to read the
processed data. It might take an average Rpi python hobbyist programmer one or two days to write a program (Of course you can borrow C++ code from the Arduino guys! :)). See Reference 2 below for more details.
Converting 5V/12V Input Signals to 3.3V for Rpi
Only hobbyists use resistor voltage dividers. The EE guys usually use
CMOS CD4050 (Note 1), which is low side single supply (3V3 in this
case) and specially designed for high to low level conversion. All
theses years I have been using CD4050 to convert 5V to 3V for Rpi, and
so far so good.
Note 1 - Of course hex converter CD4050 is not the only choice. For stepping down just one or two 5V signals to 3V3 say, EE guys usually prefer to use one small signal diode to do the step down (5V - diode drop at cutoff is "usually" safe for high impedance 3V3 logic CMOS input - but no guarantee!)
CD4050B CMOS Hex Buffer and Converter (5V (max 20V) Logic to 3V3, Vcc = 3V3) - TI
Understanding Wiegand Format
Wiegand Serial Format
AliExpress DC12V Access Control 26/34 Wiegand Reader
Raspberry Pi and Wiegand: Step by Step (Useless!)
CD4050B CMOS Hex Buffer and Converter (5V Logic to 3V3, Vcc = 3V3) - TI
Appendix A - Quick and dirty buggy WieGand reader program draft V0.1
# *** Initialiation ***
Note - GPIO pinA reads Bit 0, GPIO pinB reads Bit 0
import GPIO module
set GPIO pinA and pinB to input mode
declare 16 elements dataBitList to store card number
# *** Read a pulse from either pinA or PinB ***
Note - wait for pulse coming at PinA or pinB
while (pinA OR pinB) NOT Low
if pinA Low
# *** Main program ***
Note - just read one card number, no parity checked.
initialize pinA, pinB, dataBitList
loop 26 times
read start pulse
loop to read 8 factory data bits and discard
loop to read 16 card number bits and store in dataBitlist
read partity pulse
print card number in the dataBitList