Show us a good image of your wiring.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0
Is the power supply a rock solid 5VDC all the time?
Use 470 Ω resistor, not 1000K
Show us a good image of your wiring.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0
Is the power supply a rock solid 5VDC all the time?
Use 470 Ω resistor, not 1000K