Answer: It would seem to be prohibited to set an alarm clock to go off on Shabbat based on the Baraita (Shabbat 18a) which states, “One may not place wheat into a water-operated mill (before Shabbat) in order for the wheat to be ground on Shabbat.” Although no forbidden work is being performed on Shabbat as the wheat is being placed in the mill before the onset of Shabbat and it will only be ground on Shabbat as a result of the water’s movement, nevertheless, since the mill produces noise on Shabbat, this constitutes a disrespect for the Shabbat. The Sages of the Talmud disagree whether or not the Halacha follows the opinion of this Baraita. Some conform this Baraita to all opinions and it will therefore be forbidden to begin any forbidden work before the onset of Shabbat if it will continue on Shabbat and produce noise. Others explain that this Baraita is contingent upon another related disagreement between Bet Shammai and Bet Hillel such that according to Bet Hillel, there is no concern with such noise being produced on Shabbat and it will be permissible to place wheat into a mill before Shabbat in order for it to be ground on Shabbat itself.
Halachically speaking, Maran Ha’Shulchan Aruch (Chapter 252) rules that “It is permissible to place wheat into a water mill shortly before the onset of Shabbat and we are not concerned that as a result of the noise, people will say that so-and-so’s mill operates on Shabbat.” The Rama, on the other hand, rules: “Some rule stringently regarding a mill and anything else which produces noise. We are indeed preferably concerned with this view; however, in situations of financial loss, there is room for leniency.”
Based on the above, regarding our situation, it seems that according to the Rama that one may not cause noise to be produced on Shabbat, it will likewise be forbidden to set an alarm clock to go off on Shabbat, for this constitutes a disrespect for the Shabbat as it seems that one is operating the alarm clock on Shabbat and causing noise to emanate. According to this, it will be forbidden for Ashkenazim to set an alarm clock to go off on Shabbat.
Indeed, Hagaon Harav Moshe Feinstein zt”l rules likewise in his Responsa Igrot Moshe (Orach Chaim, Volume 4, Chapter 70) and writes that Ashkenazim, who follow the rulings of the Rama, may not set an alarm clock to go off on Shabbat if it can be heard outside of the room it is located in. (However, if the volume of the alarm clock is not so strong and can only be heard within the room it is located in, even Harav Feinstein rules leniently.) We see that Hagaon Feinstein equates the law of an alarm clock to a vessel which produces noise on Shabbat.
Nevertheless, Maran Rabbeinu Ovadia Yosef zt”l (in a response printed in Yalkut Yosef, Shabbat, Part 1, page 89) quotes several Acharonim who rule that there is room for leniency in this regard, even according to the Rama’s opinion, for according to all opinions, if the noise is not heard immediately after the action the individual performs, such as regarding a mill, and is only heard later, there is no prohibition of producing noise here. Additionally, most people do not set their alarm clocks to go off every day; rather, it is already set to wake them up at the same time every day. If this is the case, there is certainly no room to prohibit setting an alarm clock for Shabbat, for the Poskim (quoted by the Bet Yosef in Chapter 338) that it is permissible before Shabbat to set a clock to go off and make noise every hour of Shabbat since everyone knows that such a clock is set once and no one sets it every day. The Rama himself quotes this as Halacha.
Thus, halachically speaking, it is permissible for both Sephardic and Ashkenazi Jews to set alarm clock before the onset of Shabbat to go off on Shabbat. Hagaon Harav Eliezer Yehuda Waldenberg zt”l and other great Poskim rule likewise.