Q. Blessings Kvod Harav. Can one, who suffers from acid stomach difficulties when drinking coffee, take pills to stay awake during the learning night of Shavuos?
Chag Sameach.
A. On question 3226 regarding if one who is sleepy and tired take a pep or stimulant pills during Shabbos, we wrote:
“Shemiras Shabbos K’ (34: 31) quoting Minchas Yitzchok (3: 21) prohibits pep or stimulant pills during Shabbos. (see also 39-Melochos 2 p. 497).
However on question 3220 in regard to take sleeping pills during Shabbos we wrote:
"Ketzos Hashulchan (138: n.31) and other Poskim maintain that one suffering from insomnia or fatigue is permitted to take sleeping pills to stimulate sleep. He argues that it is not considered a ‘Refuah” or healing, which would be prohibited on Shabbos, since lack of sleep is not in itself a sickness and the pills taken are not a cure”
Horav Shlomo Miller’s Shlit’a opinion is that they are permitted when needed.
Rabbi A. Bartfeld as revised by Horav Shlomo Miller, Horav Dovid Pam, Horav Aharon Miller and Horav Chanoch Ehrentreu Shlit’a