Originally shared on the public FactorioPrints / Factorio School archive (factorioprints.com · factorio.school). Authorship preserved from the public catalog.
Using a decider combinator and constant combinator you can create a clock. connect that to a constant combinator and speaker you can use both the signal of an item's quantity and a range within the clock to enable the speaker for only a limited time that both the clock is above x and the item in a chest or network is below an amount.