A 5.1-volt zener diode clamps the output of the smoke alarm to about 5 volts, helping to protect the input of the microcontroller. You may also wish to add extra protection in
Read 10 or more switches using only two I/O pins of a microcontroller - EDN
f. Switching another PC and its attached devices on and off via USB - PC USB Projects
Zener diode makes for a lousy regulator - Bald Engineer
How Does Zener Diode Do Overvoltage Protection in Circuit?
Microcontroller - Adding an LED and Testing the Programmer using an LED and a 330 ohm resistor
Does zener diode connected at the input pin of a controller affect the controller when internal pull up is enabled at that pin? - Electrical Engineering Stack Exchange
Interfacing LED with 8051 Microcontroller Circuit - ElectronicsHub
TMS320F28388D: power sequence for 28388 - C2000 microcontrollers forum - C2000™︎ microcontrollers - TI E2E support forums
cheap power supply for microcontroller through zener diode