I'm trying to read a NFC reader's output with an Arduino Nano ESP32 through Wiegand protocol.
Basically, the Wiegand protocol transmit the binary code with two pins: D0 (for the zeroes digits) and D1 (for the 1 digits). Both normally stays high (+5v), and when a digit is transmitted the signal drops to GND.
Here the graphical explenation:
Here is a physical test on the oscilloscope:
I tried to read this signal with an Arduino Nano ESP32 using this circuit:
(Here the D0 signal only, D1 will be the same. I don't care that the signal shape is mirrored.)
The issue is that Arduino cannot read it properly, some bits get lost.
Here is the scope of the PC817's output [Arduino's D9 pin] (Blue) compared with the NFC reader's output (Yellow):
List of components:
- Optocoupler PC817;
- MOSFET 2N7000;
- Resistors;
- Wiegand NFC reader.
I'm going to replace the 2N7000 with a MOSFET Depletion-mode DN2530
How can I have a better output from the optocoupler?